目標空值從這裏https://msdn.microsoft.com/en-us/library/system.windows.data.bindingbase.targetnullvalue(v=vs.110).aspx,如何指定一個空字符串作爲在XAML
它給指定的「TargetNullValue」的例子:
<TextBox Width="150"
Text="{Binding Source={StaticResource object2},
Path=PropertyB, BindingGroupName=bindingGroup,
TargetNullValue=please enter a string}" />
我的問題是我怎麼可以指定一個空字符串TargetNullValue?
我已經試過"TargetNullValue= }"
(有=和}之間的空間,但是,這並不可行,目標空值爲null,而不是一個空字符串。
謝謝。
我得到「在XML命名空間‘’未知類型」靜態HTTP:/ /schemas.microsoft.com/winfx/2006/xaml'' – n179911
我在名稱空間 – n179911
中添加了'xmlns:system =「using:System」我嘗試複製並粘貼您的名稱空間聲明,然後更改爲但我仍然收到相同的編譯器錯誤:XamlCompiler錯誤WMC0001:未知類型'XML'名稱空間中'靜態'http://schemas.microsoft.com/winfx/2006/x –
n179911