1
votes

Im building a couple of UWP apps, and am cruising through some of the example code from various Microsoft documents.

One thing I see regularly, are references to obscure baked-in static resources or theme resources.

Also often when I generate a copy of a control template in Blend I see references to styles and templates that I cannot seem to access.

For example, the standard template for NavigationView includes a property called PaneToggleButtonStyle, with a default value of {StaticResource PaneToggleButtonStyle}.

So what's in this PaneToggleButtonStyle resource ?

In WPF there were ways of extracting these resources using XamlWriter, but that class is not available in UWP

Does Microsoft publish anywhere the source XAML for all of their controls? If so, does anyone know where it is, or how to get hold of these baked-in resources?

Thanks

1

1 Answers

6
votes

You can find the Xaml for these styles in the 'generic.xaml' file found at this folder location:

'C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.16299.0\Generic\'

Where '10.0.16299.0' can be replaced with whatever versions you have installed on your computer.