-
Hi all! I apologize for a possibly stupid question in advance. I would like to use some opensource controls in my project (i.e. https://github.com/Dirkster99/NumericUpDownLib) via NuGet assembly. These controls basically consist of a text field and two buttons with various useful stuff wrapped around them. When I add NumericUpDown controls to my project (that uses Material Design), they change size and appearance (I assume because MatDes styles are automatically applied to nested basic controls of a parent complex control) in an utterly undesirable way. Is there somehow I can take control of nested controls styles? And if not, is it possible to switch off styles for the entire control? Setting the Style="{x:Null}" option for the control doesn't make any difference. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @faguetan yes, you likely want to set explicit styles on the controls inside of your template (setting them to |
Beta Was this translation helpful? Give feedback.
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 theStyle
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