I created a wrapper over the NumbericUpDown control. Wrapper is generic and can support int? and double?
I would like to write a method that will do the following.
public partial class NullableNumericUpDown<T> : UserControl where T : struct { private NumbericUpDown numericUpDown; private T? Getvalue() { T? value = numericUpDown.Value as T?;
Of course, there is no fill between the decimal and double comma? or int? so i need to use a specific conversion method. I would like to avoid switching or expressions.
What would you do?
To clarify my question, I provided more code ...
source share