【发布时间】:2023-04-08 10:42:01
【问题描述】:
我是 Silverlight 开发的新手。在我的活动中,我遇到了无法单击带有样式的日历日期的问题。我的主要目的是单击日期并用颜色显示。我点击了这个链接How to customize holiday appearance in the Silverlight Calendar,我写了日期点击事件。但它没有触发。
这是.xaml
<UserControl
xmlns:ext="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
xmlns:prim="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls">
<UserControl.Resources>
<Style x:Key="CalendarDayButtonStyle1" TargetType="prim:CalendarDayButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="prim:CalendarDayButton">
<Grid Background= "{Binding Converter={StaticResource BackgroundConverter}, Path=Date}">
<ContentControl x:Name="Content" Margin="5,1,5,1" Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
【问题讨论】:
标签: c# date xaml silverlight calendar