Current Date in Silverlight XAML TextBlock

Posted by user292110 on Stack Overflow See other posts from Stack Overflow or by user292110
Published on 2010-03-12T05:22:05Z Indexed on 2010/03/12 5:27 UTC
Read the original article Hit count: 600

Filed under:
|
|
|
|

I am coming from Flex where you can do just about anything inside of curly braces. I am trying to get a TextBlock to display today's Date and Time without just coding it in C#. I have tried many different variations of the following with no luck.

TextBlock Text="{Source=Date, Path=Now, StringFormat='dd/MM/yyyy'}"

I know I could probably just set a property MyDate and bind to that but why can't I bind directly to the DateTime.Now property?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about binding