博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Binding中的TargetNullValue属性(项目)
阅读量:4603 次
发布时间:2019-06-09

本文共 1002 字,大约阅读时间需要 3 分钟。

Wilma项目中的例子:

View Code
1 
16
17
18
19
20
21

其中TargetNullValue和Binding的Path指定的后台property做对应,当后台property为null时,这个TextBox.Text={

x:Static sys:String.Empty}表现为文档框里是的empty。相反如果文档框里是Empty的话后台的property就被set去‘null’

参考:

 

 

    The above code will set the Total property to null if the value is entered is 0.00 and if Total property is null it will display 0.00. The same functionality can be achieved by checking for null in the property getter and setters, but this is very handy and you don't have to do it in all the places where you want to achieve this behaviour.

MSDN:http://msdn.microsoft.com/en-us/library/system.windows.data.bindingbase.targetnullvalue.aspx

 

转载于:https://www.cnblogs.com/shawnzxx/archive/2013/05/09/3069222.html

你可能感兴趣的文章
如何在Objective-C中实现链式语法
查看>>
select2 下拉搜索控件
查看>>
WebAPI常见的鉴权方法,及其适用范围
查看>>
08. 删除重复&海量数据
查看>>
重新想象 Windows 8 Store Apps (71) - 其它: C# 调用 C++
查看>>
发布mvc遇到的HTTP错误 403.14-Forbidden解决办法
查看>>
记录一些好用的工具
查看>>
超链接样式设置(去下划线)(转)
查看>>
2016012003+陈琦+散列函数的应用及其安全性
查看>>
Android 状态栏通知Notification、NotificationManager详解
查看>>
UIApplicationDelegate协议
查看>>
Jmeter测试dubbo接口填坑
查看>>
[zz]GDB调试精粹及使用实例
查看>>
数据库的创建和删除
查看>>
最简单的三层实例【插入据
查看>>
设计模式学习笔记——Prototype原型模式
查看>>
pom.xml里有红叉报错的解决办法
查看>>
Perl last和next的用法区别
查看>>
Selenium 管理 Cookies
查看>>
exceptionfunction[LeetCode]Permutations
查看>>