views:

12

answers:

0

The documention for the GridView.GridViewStyleKey says (emphasis by me):

You can use this read-only static property in Extensible Application Markup Language (XAML) by assigning its static value to another property value. Specifically, this property's static value defines the resource key that is used to look up the default ListView style. To redefine this style, reference the GridViewStyleKey by using the x:Static Markup Extension and assign that value as the x:Key Directive of the new Style.

How does this actually work? A Style for a ListView defined like this

<Style x:Key="{x:Static GridView.GridViewStyleKey}" TargetType="{x:Type ListView}"/>
<ListView>
    <ListView.View>
        <GridView>
        ...

is never picked up. I tried defining it in the resources of the Window, Application, Themes\Generic.xaml and Themes\Aero.NormalColor.xaml. Or am I misunderstanding the documentation? When I step through the framework it actually seems to always load the style from the assembly of the ResourceKey, which is PresentationFramework.