似乎我需要使用主题中预定义的TextBlock样式设置以下ListBox的样式(特别是项目)。我什至不知道从哪里开始。这是ListBox:
<code>
<ListBox Grid.Row="1" Grid.Column="0"
ItemsSource="{Binding Path=PowerOnList}"
Width="140" Height="160"
Foreground="Black" Background="White"
HorizontalAlignment="Left"
Name="PowerOnListBox"
SelectedIndex="{Binding PowerOnSelection}">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Focusable" Value="True"/>
<Setter Property="FontSize"
Value="{Binding Source={StaticResource MediumFontSize},
Converter={StaticResource fontSizeConverter}}" />
<Setter Property="Foreground" Value="Black"/>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</code>
这是主题中预定义的TextBlock样式:
<code>
<Style x:Key="{ComponentResourceKey
TypeInTargetAssembly={x:Type themes:OurThemeResources},
ResourceId=NormalTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="FontSize"
Value="{Binding Source={StaticResource DefaultFontSize},
Converter={StaticResource fontSizeConverter}}" />
<Setter Property="FontFamily"
Value="{StaticResource DefaultFont}" />
<Setter Property="Foreground"
Value="{StaticResource NormalTextBrush}" />
</Style>
</code>
帮助?