Стиль ListViewItem, заданный стиль TextBlock в теме - PullRequest
0 голосов
/ 20 ноября 2018

Кажется, мне нужно стилизовать следующий ListBox (в частности, элементы), используя стиль TextBlock, предопределенный в теме.Я не знаю, с чего начать.Вот 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>

Справка?

...