数据透视表头模板问题 Windows 通用 C# XAML
Pivot Header Template Issue Windows Universal C# XAML
我看不到我的 PivotItem,它不可见但绑定是正确的:
我的模板在 App.xaml:
<DataTemplate x:Key="GoldStyle">
<ContentPresenter>
<TextBlock Text="{Binding}" FontFamily="Segoe Script" Foreground="Gold" FontSize="10" Margin="0,70,0,0" />
</ContentPresenter>
</DataTemplate>
我的支点:
<Pivot HeaderTemplate="{StaticResource GoldStyle}">
<PivotItem Header="Public Profile" >
<Grid>
<TextBlock Text="-Set your Steam Profile to Public (Steam Settings)" FontFamily="Segoe Script" TextWrapping="Wrap" Foreground="WhiteSmoke"></TextBlock>
</Grid>
</PivotItem>
<PivotItem Header="Features">
<TextBlock FontFamily="Segoe Script" Text="-Calculate Price" Foreground="WhiteSmoke"></TextBlock>
</PivotItem>
我做错了什么?
乍一看我觉得这很奇怪,但唯一的问题是在 ContentPresenter 的 TextBlock 中,您将 Margin="0,70,0,0" 替换为 Margin="0,0, 0,0".
其他都对。
我看不到我的 PivotItem,它不可见但绑定是正确的:
我的模板在 App.xaml:
<DataTemplate x:Key="GoldStyle">
<ContentPresenter>
<TextBlock Text="{Binding}" FontFamily="Segoe Script" Foreground="Gold" FontSize="10" Margin="0,70,0,0" />
</ContentPresenter>
</DataTemplate>
我的支点:
<Pivot HeaderTemplate="{StaticResource GoldStyle}">
<PivotItem Header="Public Profile" >
<Grid>
<TextBlock Text="-Set your Steam Profile to Public (Steam Settings)" FontFamily="Segoe Script" TextWrapping="Wrap" Foreground="WhiteSmoke"></TextBlock>
</Grid>
</PivotItem>
<PivotItem Header="Features">
<TextBlock FontFamily="Segoe Script" Text="-Calculate Price" Foreground="WhiteSmoke"></TextBlock>
</PivotItem>
我做错了什么?
乍一看我觉得这很奇怪,但唯一的问题是在 ContentPresenter 的 TextBlock 中,您将 Margin="0,70,0,0" 替换为 Margin="0,0, 0,0".
其他都对。