简体   繁体   中英

WPF User Control Apply Style

I created a custom TimePicker control. It has a label and some combo boxes on it. It is inside a UserControl library.

Now I added a reference to that project in my Desktop project and added the TimePicker to a window.

Finally, I have some styles defined in a 3rd project. I would like to create a style in the Styles project for the TimePicker on my window.

How do I set that TimePicker's style in the Desktop project?

  1. Load Resource Dictionary from your style project.
  2. Set button style defined in your Resource Dictionary.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM