【发布时间】:2013-10-21 19:27:14
【问题描述】:
我有这样的用户控件:
<Grid x:Name="LayoutRoot" Background="Transparent">
<Image Source="/Images/btn1_normal@2x.png" Stretch="Fill" />
<TextBlock x:Name="Text" Text="Button" Foreground="Black"
VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
我在另一个 XAML 中像这样使用这个 userControl:
<MyControlls:MyButton Width="90" Height="55"/>
现在我如何访问这个 XAML 中名为 Text 的 textBlock 并更改他的文本(在 Windows phone 8 中)? 像这样的:
<MyControlls:MyButton Width="90" Height="55">
<MyButton.Text Text="Hello World!" />
</MyControlls:MyButton>`
谢谢。
【问题讨论】:
标签: c# silverlight xaml windows-phone