0
我已採用DatePicker並自定義了平板電腦上使用的樣式。我發現雖然可以選擇幾個月,但這個月不能改變。儘管應用了鼠標懸停式樣,但單擊上一個/下一個按鈕或月份名稱都沒有任何影響。在指定自定義CalendarStyle時,Silverlight DatePicker不能更改月份
我已經採取了默認的日曆風格,插入視框,以增加大小,建議由Mike Taulty:http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2010/11/17/touched-part-5-touch-ready-controls.aspx
<Style TargetType="controls:Calendar" x:Key="TabletCalendar">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:Calendar" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
<StackPanel x:Name="Root" HorizontalAlignment="Center" >
<Viewbox Width="480" Height="440">
<controlsPrimitives:CalendarItem x:Name="CalendarItem" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" xmlns:controlsPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls" />
</Viewbox>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="controls:DatePicker" x:Key="TabletDatePicker">
<Setter Property="CalendarStyle" Value="{StaticResource TabletCalendar}" />
.....
</Style>