wpf - xaml date format string ignored -


My label is displaying '7/27/2010' instead of '27 July 2010 '. Can anyone please tell me why my markup code has been ignored? Ribbon label content = "{binding source = {x: static system: date time} today, string format = '{} {0: mmmm d, yyyy}'}"

  & lt; Ribbon label & gt; & Lt; TextBlock Text = "{Binding Source = {x: Static System: DateTime} Today, string format = '{} {0: MMMM d, yyyy}'}" /> & Lt; / RibbonLabel & gt;  

You can also define datatyme for datetime and then you can only set up the content nowadays:

  & lt; window. Resources & gt; & Lt; DataTemplate DataType = "{x: type: date time}" & gt; & Lt; Text block text = "{binding string format = '{} {0: MMMM d, yyyy}'}" /> & Lt; / DataTemplate & gt; & Lt; /Window.Resources> ... & lt; Ribbon label content = "{binding source = {x: static system: datetime.}}" & Gt;  

Edit: A simple solution to use the ContentStringFormat property

  & lt; Ribbon label content = "{binding source = {x: static Sys: DateTime.Today}}" content string format = "{} {0: MMMM d, yyyy}" />  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -