2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
When designing and developing, part of a control library meets the UI style we want, and the other part comes from another control library. We want to integrate the styles of the two libraries into the same control resource. Simply referencing will cause the original style to be overwritten. This is achieved by setting a global style.
1. Install the control library nuget package: HandyControl, MaterialDesign
2. Introduce the control library style in App.xaml in the global style
3. Create a new Style folder, create a new resource dictionary file GlobalDictionary.xaml in the folder, and introduce it into the global style of the App.xaml file
4. Write the control style in the GlobalDictionary.xaml file
The button style here inherits from the button style in the MaterialDesign control, and this style is declared as a global style for GreenButton
5. Use a style with two control libraries: Here we use a global style inherited from MaterialDesign and the poptip.Content property from HandyControl
By introducing a resource file to inherit some styles from another control library and declaring it in the global style, it can be used in all interfaces and some style properties of other controls can be introduced.