Skip to content

Style for complex controls #3183

Closed Answered by Keboo
faguetan asked this question in Q&A
May 4, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @faguetan yes, you likely want to set explicit styles on the controls inside of your template (setting them to {x:Null} should revert them back to the default styling). Really any explicit assignment to the Style property of then controls will prevent the implicit style from being applied. Though rather than setting it to null you might want to make a style specific for you controls and use that. This is effectively what this library does for things like the "clear" button inside of our TextBox template. https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TextBox.xaml#L234

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@faguetan
Comment options

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