Declare a Nullable int (int?) using XAML -


I am trying to bind a combo box to the property on my ViewModel. Target type is small? and I should have the option of null . In fact, I value the value of the first item in the combo box {x: Null} .

  & lt; ComboBox Grid.Row = "9" would like to have a grid. Column = "1" selected value = "{binding priority}" & gt; & Lt; Clr: int16 & gt; & Lt; / Clr: int16 & gt; & Lt; Clr: int16 & gt; 1 & lt; / Clr: int16 & gt; & Lt; Clr: int16 & gt; 2 & lt; / Clr: int16 & gt; & Lt; Clr: int16 & gt; 3 & lt; / Clr: int16 & gt; & Lt; Clr: int16 & gt; 4 & lt; / Clr: int16 & gt; & Lt; Clr: int16 & gt; 5 & ​​lt; / Clr: int16 & gt; & Lt; Clr: int16 & gt; 6 & lt; / Clr: int16 & gt; & Lt; Clr: int16 & gt; 7 & lt; / Clr: int16 & gt; & Lt; Clr: int16 & gt; 8 & lt; / Clr: int16 & gt; & Lt; Clr: int16 & gt; 9 & lt; / Clr: int16 & gt; & Lt; Clr: int16 & gt; 10 & lt; / Clr: int16 & gt; & Lt; / ComboBox & gt;  

Any suggestions?

If you use XAML 2009 / .NET 4 then you can create a new syntax for generic using XAML You can use.

  xmlns = "http://schemas.microsoft.com/netfx/2009/xaml/presentation" & lt; Nullable X: Type Argument = "CLR: Int16" />  

This XAML has other, more complex, scannerios for generic.


Comments