WPF DateTime in XAML。如何添加日子? [英] WPF DateTime in XAML. How to add days?
本文介绍了WPF DateTime in XAML。如何添加日子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在XAML中指定日期时,如何添加当前日期的10天?我正在使用以下行当前日期。日期需要是今天+ 10天
How do I add 10 days to the current date while specifying a date in XAML? I am using the below line for current date.The date needs to be today + 10 days
<TextBlock Text="{Binding Source={x:Static sys:DateTime.Now}}>
提前感谢
Thanks in advance
推荐答案
您可以实现 ValueConverter ,但是您需要以某种方式刷新绑定,因为默认情况下没有更新通知。
You could implement a ValueConverter for that, however you need to somehow refresh the binding as there are no update notifications by default.
这篇关于WPF DateTime in XAML。如何添加日子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文