문제

Trying to format a datetime bound value in my XAML using Silverlight 5 like so:

<TextBlock Text="{Binding ContactDate, Mode=OneWay, StringFormat={}{0:'dd/MM/yyyy'}}" Margin="5,0" />

I'm getting the following error: Unexpected Token after end of Markup Extension.

This is driving me insane!

도움이 되었습니까?

해결책

Try: Text="{Binding ContactDate, Mode=OneWay, StringFormat='{}{0:dd/MM/yyyy}'}"

Unless you mean that you want singlequotes before and after the date string.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top