i want to create a custom control library with winui 3/uwp.
The question is How should I introduce dictionaries and styles?
Why did PowerToys put some dictionaries in the generic file? And put some other dictionaries in the app.xaml file?
I also noticed that one of the dictionaries (IsEnabledTextBlock) was placed in both the generic file and the app.xaml file. why?
If we want to create a custom control library, how should we introduce these dictionaries and styles?
CodePudding user response:
If you are developing a library that contains custom controls, the default styles of these controls should be defined in a resource dictionary called themes/generic.xaml
. This is where the framework will look for them by convention.
A class library has no concept of an app global App.xaml
file since it's not an app.