Thursday, April 21, 2011

WPF Format DateTime in TextBlock?

I have a TextBlock thats bound to a DateTime property how do i configurate the format of the date?

From stackoverflow
  • There is a string format property available when you are declaring the binding:

    <Textbox Text={Binding Path=DateTimeValue, StringFormat=dd-MM-yyyy} />
    

    (You need to be on .NET 3.5 SP1 for this property to exist)

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.