<!-- Static images --> <BitmapImage x:Key="HiddenItemsImage" UriSource="pack://application:,,,/MindFusion.Scheduling.Wpf;component/Resources/MoreDown.png" /> <BitmapImage x:Key="RecurrenceImage" UriSource="pack://application:,,,/MindFusion.Scheduling.Wpf;component/Resources/Recurrence.png" /> <BitmapImage x:Key="RecurrenceExImage" UriSource="pack://application:,,,/MindFusion.Scheduling.Wpf;component/Resources/RecurrenceEx.png" /> <BitmapImage x:Key="ReminderImage" UriSource="pack://application:,,,/MindFusion.Scheduling.Wpf;component/Resources/Reminder.png" /> <BitmapImage x:Key="ArrowLeftImage" UriSource="pack://application:,,,/MindFusion.Scheduling.Wpf;component/Resources/ArrowLeft.png" /> <BitmapImage x:Key="ArrowRightImage" UriSource="pack://application:,,,/MindFusion.Scheduling.Wpf;component/Resources/ArrowRight.png" /> <BitmapImage x:Key="ArrowUpImage" UriSource="pack://application:,,,/MindFusion.Scheduling.Wpf;component/Resources/ArrowUp.png" /> <BitmapImage x:Key="ArrowDownImage" UriSource="pack://application:,,,/MindFusion.Scheduling.Wpf;component/Resources/ArrowDown.png" />
<Style TargetType="local:CellPresenter"> <Style.Triggers>
<DataTrigger Binding="{Binding StyleKey, RelativeSource={RelativeSource Self}}" Value="Simple"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:CellPresenter">
<Border DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{Binding CellStyle.BorderBrush}" BorderThickness="{Binding CellStyle.BorderThickness}" Background="{Binding Background}" Margin="{Binding CellMargin}" />
</ControlTemplate> </Setter.Value> </Setter> </DataTrigger>
<DataTrigger Binding="{Binding StyleKey, RelativeSource={RelativeSource Self}}" Value="WithHeader"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:CellPresenter">
<Border DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{Binding CellStyle.BorderBrush}" BorderThickness="{Binding CellStyle.BorderThickness}" Background="{Binding Background}" Margin="{Binding CellStyle.Margin}"> <Grid> <Border BorderBrush="{Binding CellHeaderStyle.BorderBrush}" BorderThickness="{Binding CellHeaderStyle.BorderThickness}" Background="{Binding CellHeaderStyle.Background}" Margin="{Binding CellHeaderStyle.Margin}" Width="{Binding HeaderWidth}" Height="{Binding HeaderHeight}" VerticalAlignment="{Binding HeaderVerticalAlignment}" HorizontalAlignment="{Binding HeaderHorizontalAlignment}" /> <Border Visibility="{Binding Path=IsTodayCell, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource visibleConverter}, ConverterParameter=true}" Margin="{Binding CellHeaderStyle.Margin}" Width="{Binding HeaderWidth}" Height="{Binding HeaderHeight}" VerticalAlignment="{Binding HeaderVerticalAlignment}" HorizontalAlignment="{Binding HeaderHorizontalAlignment}"> <Border Visibility="{Binding Path=CellSettings.ShowToday, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource visibleConverter}, ConverterParameter=true}" BorderBrush="{Binding CellSettings.TodayBrush}" BorderThickness="{Binding CellHeaderStyle.BorderThickness}" Background="{Binding CellSettings.TodayFillBrush}"> </Border> </Border> <Border BorderThickness="{Binding CellHeaderStyle.BorderThickness}" Margin="{Binding CellHeaderStyle.Margin}" Width="{Binding HeaderWidth}" Height="{Binding HeaderHeight}" VerticalAlignment="{Binding HeaderVerticalAlignment}" HorizontalAlignment="{Binding HeaderHorizontalAlignment}"> <TextBlock FontFamily="{Binding CellHeaderStyle.FontFamily}" FontSize="{Binding CellHeaderStyle.FontSize}" FontStretch="{Binding CellHeaderStyle.FontStretch}" FontStyle="{Binding CellHeaderStyle.FontStyle}" FontWeight="{Binding CellHeaderStyle.FontWeight}" Foreground="{Binding CellHeaderStyle.Foreground}" TextAlignment="{Binding CellHeaderStyle.TextAlignment}" VerticalAlignment="{Binding CellHeaderStyle.VerticalAlignment}" HorizontalAlignment="{Binding CellHeaderStyle.HorizontalAlignment}" Margin="{Binding CellHeaderStyle.ContentMargin}" Text="{Binding HeaderText}"> <TextBlock.LayoutTransform> <RotateTransform Angle="{Binding HeaderTextRotation, FallbackValue=0}" /> </TextBlock.LayoutTransform> </TextBlock> </Border> <Image Name="hiddenItemsCue" Source="{StaticResource HiddenItemsImage}" Margin="0,0,1,1" HorizontalAlignment="Right" Visibility="{Binding HiddenItemsCueVisibility}" VerticalAlignment="Bottom" Width="14" Height="7" Stretch="None" /> </Grid> </Border>
</ControlTemplate> </Setter.Value> </Setter> </DataTrigger>
</Style.Triggers> </Style> |