Search code examples
uwpvisual-studio-2019uwp-xamlwindows-community-toolkit

How to get Default Template(Style Code) of UWP for Controls in Microsoft.Toolkit.Uwp.UI.Controls using VisualStudio 2019?


I had included the Nuget Package for Microsoft.Toolkit.Uwp.UI.Controls in my UWP project. I tried to get the Default Template for any controls inside this package like DataGrid using VS2019. But, Edit Template-->Edit Copy options was Disabled. How to get the default Template and Styles of this Package?enter image description here

Controls from Microsoft.UI.Xaml like Button,TextBox,etc.. have Edit copy options. Controls from the toolkit package only not available. Why?


Solution

  • Yes, this is the same with WinUI controls when using WinUI 2.X NuGet package., you can't directly create a default style from the Visual Studio.

    How to get the default Template and Styles of this Package?

    You could go to the Github page of Community Toolkit and check the source code of the Community controls. For example, you could find the style of DataGrid here:DataGrid.xaml.