I’m using the ‘Extended WPF Toolkit’ ( http://wpftoolkit.codeplex.com/ ),
and for my own purposes I’ve created a generic version of its NumericUpDown control called GNumericUpDown< T > which actually lets me specify what type to use, ie. GNumericUpDown< int >.
(This is done to make sure the control respects the appropriate Min/MaxValues of the wanted type)
To be able to use different types from Xaml, I’ve created a new project with specific derived versions, f.e. NumericUpDownFloat which is derived from GNumericUpDown< float>.
But when I use the NumericUpDownFloat in XAML, nothing is displayed.
I assume this is because there’s only a style specified for the WPF Toolkit’s NumericUpDown in the Generic.xaml resourcedictionary of the WPF Toolkit project.
So how can I make all my specific versions (NumericUpDownInt, NumericUpDownByte, ..) actually use that style ?
You should get the latest source code for the Extended WPF Toolkit. The updated NumericUpDown control allows you to specify what data type to use in the editor. The following code specifies to use an Int32 as the data type instead of the default double. As you can see this is done by setting the ValueType property on the NumericUpDown control.
This will eliminate the need for the seperate project with specific dervied controls.