user16474396
user16474396

Reputation:

Right way to create a custom control library in winui

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?

Upvotes: 0

Views: 768

Answers (1)

mm8
mm8

Reputation: 169370

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.

Upvotes: 1

Related Questions