2017-06-07 43 views
0

WPFカレンダーからこの境界線を削除できますか?この境界線をカレンダーから削除するWPFスタイルの

私は簡単な例のXAMLと同じ効果を試してみてください。

<Grid > 
    <StackPanel Orientation="horizontal" > 
     <Calendar BorderThickness="0px" Background="Beige" Foreground="Beige" BorderBrush="Beige"         
       SelectedDate="6/4/2017" 
       DisplayDate="6/4/2017" DisplayDateStart="5/1/1900" DisplayDateEnd="7/1/3000" 
       DisplayMode="Month" 
      /> 
    </StackPanel> 
</Grid> 

border white line

+0

カレンダーのパディングではありませんか? –

答えて

0

私はこれのためにテンプレートを変更する必要かもしれないと思います。内部の境界線のCalendarItemスタイルの一部です。

<Style x:Key="CalendarItemStyle1" TargetType="{x:Type CalendarItem}"> 
     <Setter Property="Margin" Value="0"/> 
     <Setter Property="Padding" Value="0"/> 
     <Setter Property="Template"> 
      <Setter.Value> 
       <ControlTemplate TargetType="{x:Type CalendarItem}"> 
        <ControlTemplate.Resources> 
         <DataTemplate x:Key="{x:Static CalendarItem.DayTitleTemplateResourceKey}"> 
          <TextBlock Foreground="#FF333333" FontWeight="Bold" FontSize="9.5" FontFamily="Verdana" HorizontalAlignment="Center" Margin="0,6,0,6" Text="{Binding}" VerticalAlignment="Center"/> 
         </DataTemplate> 
        </ControlTemplate.Resources> 
        <Grid x:Name="PART_Root"> 
         <Grid.Resources> 
          <SolidColorBrush x:Key="DisabledColor" Color="#A5FFFFFF"/> 
         </Grid.Resources> 
         <VisualStateManager.VisualStateGroups> 
          <VisualStateGroup x:Name="CommonStates"> 
           <VisualState x:Name="Normal"/> 
           <VisualState x:Name="Disabled"> 
            <Storyboard> 
             <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_DisabledVisual"/> 
            </Storyboard> 
           </VisualState> 
          </VisualStateGroup> 
         </VisualStateManager.VisualStateGroups> 
         <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="1"> 

// get rid of the border thickness here and it's gone 
          <Border BorderBrush="Purple" BorderThickness="2" CornerRadius="1"> 
           <Grid> 
            <Grid.Resources> 
             <ControlTemplate x:Key="PreviousButtonTemplate" TargetType="{x:Type Button}"> 
関連する問題