Skip to content

How do I create a custom theme? #16239

Answered by maxkatz6
Shadowblitz16 asked this question in Q&A
Discussion options

You must be logged in to vote

I did manage to get a style to look like it with this...

Design.PreviewWith is not really a reusable part. It's only used for the previewer to render current XAML file.
As per that documentation page, you need to create a ControlTheme defined in the resources. And then reference it in your controls.

How would I do something like this for a button's normal state?

Going with the same example, you need to define ControlTheme and a ControlTemplate inside of it. Template is an actual "function" that builds the control each time it's displayed. And while on it, ContentPresenter is an actual container for the "Content" your control has. Without ContentPresenter it would be just a group of bo…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
3 replies
@Shadowblitz16
Comment options

@maxkatz6
Comment options

@maxkatz6
Comment options

Comment options

You must be logged in to vote
7 replies
@Shadowblitz16
Comment options

@maxkatz6
Comment options

@Shadowblitz16
Comment options

@maxkatz6
Comment options

@maxkatz6
Comment options

Answer selected by Shadowblitz16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants