Search code examples
wpfxaml.net-7.0

How to access .NET 7 WPF controls default templates?


In .Net Framework I could use blend or visual studio using menu Edit Template - Create a Copy to have complete XAML of a default style.

Today I tried to have a Button default style in .NET 7 WPF app in VS2022 and the Create a Copy option is grayed-out.

Where am I supposed to get it from now?


Solution

  • Add a button to your designer and then right click the button for the context menu. Then selecting Edit Template -> Edit a Copy will show a dialog that will allow you to save the ControlTemplate either locally or in App.xaml

    ContextMenu