Where to find Generic.xaml (or other code with the default look) for native WPF controls such as Button, CheckBox, TextBox, etc?
xaml is available in the \(Program Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\<SDK version>\Generic folder from a Windows Software Development Kit (SDK) installation.
xaml. If the style is not found in the theme dictionary, it looks in Generic. xaml i.e for controls whose look doesn't depend on the theme. This only applies to any custom controls you have defined i.e. classes derived from Control, directly or indirectly.
In Silverlight (and I know that your question is about WPF) this information is more accessible than in WPF. You can get this information from any of these sources:
Control Styles and Templates on MSDN.
You can look at the resources of the relevant Silverlight assembly and extract the themes/generic.xaml
embedded in a resource. I use Reflector to do this.
You can extract the control template of a specific control using a tool. I use Expression Blend to do this. This also works for WPF.
Unfortunately the XAML for native controls is not directly available as a file. You need to use a program for peeking into the WPF assemblies and extracting that info. I personally have used the Mole for Visual Studio tool, which has done the job very well. It integrates as a debugger-visualiser, which is quite handy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With