I'm trying to use: Modern UI for WPF and Extended WPF Toolkit, more specifically IntegerUpDown, and the problem is, the IntegerUpDown don't follow the selected ModernUI theme. It's clearer when we changed it to dark theme, the IntegerUpDown stays with white background.
First, I try something like...
<Style TargetType="{x:Type local:IntegerUpDown}" BasedOn="{StaticResource {x:Type TextBox}}" />
...but in runtime I get the exception "Can only base on a Style with target type that is base type 'IntegerUpDown'." I understand it, in the end IntegerUpDown is a "composite" control, not directly derived from Textbox...
So, I don't know how I do. In my research, I found that files that can be relevant:
BUT I'm not a XAML expert to tie the 2 informations to get a solution OR if there is another some simple solution that I cannot see...
Thanks for any help.
As you have noticed, when dealing with Custom Controls you'll often need to do some custom styling to reconfigure the layout. It all depends how far you want to take it, but to give you an idea I believe the workflow below should fix the backgroundcolor.
The backgroundcolor is bound to Xceed's resource themes, snippet from Wpf Toolkit:
The ModernUI Style (following the chosen theme) for these properties folows e.g. ModernUI TextBox:
The DynamicResources are found in the theme file, for example ModernUI.Dark.xaml
You can now hard code them in your Style, making them fixed on 1 theme
For extensive styling you'll need to put in more work, for example this post adresses restyling the Watermark property.