WPF Binding StringFormat Short Date String

前端 未结 7 1310
走了就别回头了
走了就别回头了 2020-11-29 19:14

I would like to use Short Date named string format in WPF.

I tried something like:



        
相关标签:
7条回答
  • 2020-11-29 20:05

    Be aware of the single quotes for the string format. This doesn't work:

        Content="{Binding PlannedDateTime, StringFormat={}{0:yy.MM.dd HH:mm}}"
    

    while this does:

        Content="{Binding PlannedDateTime, StringFormat='{}{0:yy.MM.dd HH:mm}'}"
    
    0 讨论(0)
提交回复
热议问题