Buj*_*uju 9 font-size windows-phone-7 panorama-control
设置全景项目标题的字体大小的最简单方法是什么,以便它可以用于我的应用程序中的所有项目标题?
Mat*_*cey 23
没有办法自动为您应用中的所有标题执行此操作.您需要为每个设置样式.
芒果更新中会出现隐式样式,这应该允许这样做.
更新
这是你现在可以做的.
为所需的FontSzie创建全局模板样式.就像是:
<Application.Resources>
<DataTemplate x:Key="MyItemHeaderTemplate">
<Grid>
<ContentPresenter>
<TextBlock Text="{Binding}" FontSize="20" />
</ContentPresenter>
</Grid>
</DataTemplate>
</Application.Resources>
Run Code Online (Sandbox Code Playgroud)
然后在我希望以这种方式设置样式的每个PanoramaItem中,我设置HeaderTemplate:
<controls:PanoramaItem Header="first" HeaderTemplate="{StaticResource MyItemHeaderTemplate}">
// ...
</controls:PanoramaItem>
Run Code Online (Sandbox Code Playgroud)
小智 5
这对我来说也是一个难题.但是我找到了一个非常简单的解决方案来处理每个你要调整大小/ headweight/font ...的头项目.我已经从我正在处理的当前项目中插入了一个片段.请注意控件的xaml部分:PanoramaItem.HeaderTemplate.这是为标题项修改模板的地方.祝好运!
<!--Panorama item one-->
<controls:PanoramaItem Header="Locations">
<Grid>
<ListBox Height="498" HorizontalAlignment="Left" Margin="2,0,0,0" Name="listBox1" VerticalAlignment="Top" Width="424" />
</Grid>
<controls:PanoramaItem.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" FontSize="55" FontFamily="Segoe WP Bold" Foreground="Black" TextAlignment="Left" FontWeight="Normal" FontStyle="Italic" />
</DataTemplate>
</controls:PanoramaItem.HeaderTemplate>
</controls:PanoramaItem>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16502 次 |
| 最近记录: |