Where is the "ListViewItemPlaceholderBackgroundThemeBrush" located?

I have a problem understanding one style definition in Windows 8 apps.

When you create a metro style app with VS, there is also a folder named

Are common

created. Inside this folder there is a file called

StandardStyles.xaml

The following snippet from this file:

<!-- Grid-appropriate 250 pixel square item template as seen in the GroupedItemsPage and ItemsPage --> <DataTemplate x:Key="Standard250x250ItemTemplate"> <Grid HorizontalAlignment="Left" Width="250" Height="250"> <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}"> <Image Source="{Binding Image}" Stretch="UniformToFill"/> </Border> <StackPanel VerticalAlignment="Bottom" Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}"> <TextBlock Text="{Binding Title}" Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}" Style="{StaticResource TitleTextStyle}" Height="60" Margin="15,0,15,0"/> <TextBlock Text="{Binding Subtitle}" Foreground="{StaticResource ListViewItemOverlaySecondaryForegroundThemeBrush}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,15,10"/> </StackPanel> </Grid> </DataTemplate> 

What I do not understand here is the definition of a static resource, for example. for the border

 Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" 

It's not about how you work with templates, bindings, and resources.

Where is this ListViewItemPlaceholderBackgroundThemeBrush located ?

Many thanks for your help.

Dimi

+6
source share
2 answers

This is one of those incredibly disappointing things that should be in the Microsoft documentation, but for now (for now).

ListViewItemPlaceholderBackgroundThemeBrush - one of the system brush resources. It is determined by the Metro theme "Light" or "Dark" (depending on what you have chosen for your application).

You can see the full list of system brushes in Blend. (Unfortunately, I did not find a way to list them in the code. There seems to be no programmatic way to check topic resources.)

Here are a few steps to take you to the complete list. (Of course, you can shorten the steps if you are already familiar with Blend.)

  • Open expression.
  • Create a new project and select XAML (Metro Metro style)> Blank App (XAML) and press OK.
  • Click on a design surface to select a Grid. (In the "Objects and Timeline" windows, the "[Grid]" line will be highlighted in the lower left corner.)
  • In the Properties window, located in the upper right corner, find the Brush category.
  • Right below, where it says "Background: no brush," there is a line of five buttons. Click the right-most button (Brush Resources).

A list of system brush resources appears in the list.

enter image description here

+5
source

In the preview of the Windows 8 client, you can find the file containing the resource definition (including ListViewItemPlaceholderBackgroundThemeBrush) at:

C: \ Program Files (x86) \ Windows Kits \ 8.0 \ Include \ winrt \ xaml \ design \ themeresources.xaml

+7
source

Source: https://habr.com/ru/post/917780/


All Articles