绑定到日期时间字符串格式的 WPF 文本框在使用转换器时不起作用
WPF textbox bound to datetime string format not working when using converters
<TextBox Text="{Binding CurrentGameDate,Mode=OneWay,
Converter={StaticResource DateTimeConverter},
StringFormat='{}{0:dd/MM/yyyy}'}" />
字符串格式似乎不起作用。
我只想要日期。
我试过了stringformat=d
日期的字符串格式仅适用于 DateTime 类型的变量。因此,您应该 return 日期时间而不是来自转换器的字符串。
<TextBox Text="{Binding CurrentGameDate,Mode=OneWay,
Converter={StaticResource DateTimeConverter},
StringFormat='{}{0:dd/MM/yyyy}'}" />
字符串格式似乎不起作用。
我只想要日期。
我试过了stringformat=d
日期的字符串格式仅适用于 DateTime 类型的变量。因此,您应该 return 日期时间而不是来自转换器的字符串。