0
DataTemplate中的项目我有这样的DataTemplate在我的XAML的Windows Phone:编辑代码
<phone:PhoneApplicationPage.Resources>
<DataTemplate x:Key="DataTemplate1">
<Grid d:DesignWidth="485" d:DesignHeight="166" Height="104" Width="456">
<StackPanel Margin="92,0,0,1">
<TextBlock x:Name="nTitle" Text="{Binding title}" FontSize="18.667"/>
</StackPanel>
</Grid>
</DataTemplate>
</phone:PhoneApplicationPage.Resources>
我想编辑名为“n标题”的代码fontSize的属性的TextBlock。我做了这个,但后来我不知道该怎么办:
DataTemplate template = (DataTemplate)this.Resources["DataTemplate1"];
//template.???
其实我想在用户按下按钮时增加fontSize。这是一个错误的方式来做到这一点?
我没有问题,改变颜色的按钮时,点击它是不同的,我说。我有一个列表框,每个项目都有一个图像和一个文本。 dataTemplate是什么决定文本的fontSize。我想要达到该模板并在按下按钮时更改文本的fontSize。 – 2013-03-04 16:06:31