开发者

How to access typeconverted elements declared in XAML?

开发者 https://www.devze.com 2023-03-13 21:41 出处:网络
I declared <sys:DateTime> 2009/09/01 3:33:33 </sys:DateTime>in xaml via <ListBox xmlns:sys=\"clr-namespace=System;assembly:mscorlib\" >

I declared

<sys:DateTime> 2009/09/01 3:33:33 
</sys:DateTime>  in xaml via <ListBox xmlns:sys="clr-namespace=System;assembly:mscorlib" >

开发者_如何学CI'm doing this

DateTime newDate = ((DateTime)(MyListBox.Items.GetItemAt(1)));
newDate = DateTime.Now;

but sys:DateTime's value is not changing??


DateTime is a value type. It will not exhibit reference semantics like you wish. You'll have to assign back to the original in order to update it.

0

精彩评论

暂无评论...
验证码 换一张
取 消