WPF 日历显示日期 BUG
谁能解释为什么日历不能正确显示 DisplayDate?
如果我将 DatePicker 放在 ContentControl 之外,它可以完美工作,但是当它被 ControlTemplate 包装时,它就无法工作。
关于如何强制日历正确显示 DisplayDate 有什么建议吗?
<StackPanel>
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<DatePicker DisplayDate="12/12/2011"
HorizontalAlignment="Left"
VerticalAlignment="Top"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ContentControl.Style>
</ContentControl>
<DatePicker DisplayDate="12/12/2011"
HorizontalAlignment="Left"
VerticalAlignment="Top"/>
</StackPanel>
Can anyone explain why the Calendar doesn't show correctly DisplayDate?
If I put the DatePicker outside the ContentControl it work perfectly, but somehow it doesn't work when it's wrapped by a ControlTemplate.
Any suggestion on how to force the Calender to show correctly DisplayDate?
<StackPanel>
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<DatePicker DisplayDate="12/12/2011"
HorizontalAlignment="Left"
VerticalAlignment="Top"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ContentControl.Style>
</ContentControl>
<DatePicker DisplayDate="12/12/2011"
HorizontalAlignment="Left"
VerticalAlignment="Top"/>
</StackPanel>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论