Declare a Nullable int (int?) using XAML

前端 未结 1 2039
长情又很酷
长情又很酷 2020-12-31 16:28

I am trying to bind a combo box to a property on my ViewModel. The target type is short? and I would like to have null be an option. Basically I w

相关标签:
1条回答
  • 2020-12-31 16:48

    If you are using XAML 2009 / .NET 4 then you can use a new syntax for creating generics using XAML.

    xmlns="http://schemas.microsoft.com/netfx/2009/xaml/presentation"
    
    <Nullable x:TypeArguments="clr:Int16" />
    

    This article has other, more complex, scenerios for generics in XAML.

    0 讨论(0)
提交回复
热议问题