WPF format DateTime in TextBlock?

前端 未结 3 805
再見小時候
再見小時候 2020-12-07 22:12

I have a TextBlock that is bound to a DateTime property. How do I configure the format of the date?

3条回答
  •  死守一世寂寞
    2020-12-07 22:45

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

    
    

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

提交回复
热议问题