<Style TargetType="local:ItemPresenter" x:Key="ComplexItemStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:ItemPresenter"> <local:ResizeBands Orientation="{TemplateBinding Orientation}" DataContext="{Binding Path=., RelativeSource={RelativeSource TemplatedParent}}" ItemSettings="{TemplateBinding ItemSettings}" ResizeBandsVisible="{TemplateBinding Selected}"> <local:SideBorders> <Border Background="{Binding ItemStyle.Background}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <StackPanel Orientation="Vertical"> <Image Source="/MindFusion.Scheduling.Silverlight;component/Resources/Recurrence.png" Visibility="{Binding RecurrenceIconVisibility}" Margin="1" /> <Image Source="/MindFusion.Scheduling.Silverlight;component/Resources/RecurrenceEx.png" Visibility="{Binding RecurrenceExceptionIconVisibility}" Margin="1" /> <Image Source="/MindFusion.Scheduling.Silverlight;component/Resources/Reminder.png" Visibility="{Binding ReminderIconVisibility}" Margin="1" /> </StackPanel> <StackPanel Grid.Column="1" Orientation="Vertical"> <Border BorderBrush="{Binding ItemStyle.LineBrush}" BorderThickness="0,0,0,1" Height="{Binding ItemSettings.HeaderSize}" Margin="6,0,6,0"> <TextBlock x:Name="HeaderBlock" TextWrapping="Wrap" Text="{Binding Item.HeaderText, RelativeSource={RelativeSource TemplatedParent}}" DataContext="{TemplateBinding ItemStyle}" Foreground="{Binding Foreground}" TextAlignment="{Binding TextAlignment}" VerticalAlignment="{Binding VerticalAlignment}" FontFamily="{Binding FontFamily}" FontSize="{Binding FontSize}" FontStretch="{Binding FontStretch}" FontStyle="{Binding FontStyle}" FontWeight="{Binding FontWeight}" /> </Border> <TextBlock DataContext="{TemplateBinding Item}" TextWrapping="Wrap" Text="{Binding DescriptionText}" Margin="5,1,1,1" Grid.Column="1" Grid.Row="1" /> </StackPanel> </Grid> </Border> </local:SideBorders> </local:ResizeBands> </ControlTemplate> </Setter.Value> </Setter> </Style>
<Style TargetType="local:ItemPresenter" x:Key="SimpleItemHorizontalStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:ItemPresenter"> <Grid DataContext="{Binding Path=., RelativeSource={RelativeSource TemplatedParent}}" Background="{Binding ItemStyle.Background}"> <local:SideBorders> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" /> <ColumnDefinition /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <Image Grid.Column="0" Visibility="{TemplateBinding StartArrowImageVisibility}" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None" Margin="1" Source="/MindFusion.Scheduling.Silverlight;component/Resources/ArrowLeft.png" /> <StackPanel Orientation="Horizontal" Grid.Column="1"> <Image Source="/MindFusion.Scheduling.Silverlight;component/Resources/Recurrence.png" Visibility="{Binding RecurrenceIconVisibility}" Stretch="None" Margin="1" /> <Image Source="/MindFusion.Scheduling.Silverlight;component/Resources/RecurrenceEx.png" Visibility="{Binding RecurrenceExceptionIconVisibility}" Stretch="None" Margin="1" /> <Image Source="/MindFusion.Scheduling.Silverlight;component/Resources/Reminder.png" Visibility="{Binding ReminderIconVisibility}" Stretch="None" Margin="1" /> </StackPanel> <TextBlock x:Name="HeaderBlock" Grid.Column="2" TextWrapping="Wrap" Text="{Binding Item.HeaderText, RelativeSource={RelativeSource TemplatedParent}}" DataContext="{TemplateBinding ItemStyle}" Foreground="{Binding Foreground}" TextAlignment="{Binding TextAlignment}" VerticalAlignment="{Binding VerticalAlignment}" FontFamily="{Binding FontFamily}" FontSize="{Binding FontSize}" FontStretch="{Binding FontStretch}" FontStyle="{Binding FontStyle}" FontWeight="{Binding FontWeight}" /> <Image Grid.Column="3" Visibility="{TemplateBinding EndArrowImageVisibility}" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None" Margin="1" Source="/MindFusion.Scheduling.Silverlight;component/Resources/ArrowRight.png" /> </Grid> </local:SideBorders> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>
<Style TargetType="local:ItemPresenter" x:Key="SimpleItemVerticalStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:ItemPresenter"> <Grid DataContext="{Binding Path=., RelativeSource={RelativeSource TemplatedParent}}" Background="{Binding ItemStyle.Background}"> <local:SideBorders> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Image Grid.Row="0" Visibility="{TemplateBinding StartArrowImageVisibility}" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None" Margin="1" Source="/MindFusion.Scheduling.Silverlight;component/Resources/ArrowUp.png" /> <StackPanel Orientation="Vertical" Grid.Row="1"> <Image Source="/MindFusion.Scheduling.Silverlight;component/Resources/Recurrence.png" Visibility="{Binding RecurrenceIconVisibility}" Stretch="None" Margin="1" /> <Image Source="/MindFusion.Scheduling.Silverlight;component/Resources/RecurrenceEx.png" Visibility="{Binding RecurrenceExceptionIconVisibility}" Stretch="None" Margin="1" /> <Image Source="/MindFusion.Scheduling.Silverlight;component/Resources/Reminder.png" Visibility="{Binding ReminderIconVisibility}" Stretch="None" Margin="1" /> </StackPanel> <TextBlock Grid.Row="2" TextWrapping="Wrap" Text="{Binding Item.HeaderText, RelativeSource={RelativeSource TemplatedParent}}" DataContext="{TemplateBinding ItemStyle}" Foreground="{Binding Foreground}" TextAlignment="{Binding TextAlignment}" VerticalAlignment="{Binding VerticalAlignment}" FontFamily="{Binding FontFamily}" FontSize="{Binding FontSize}" FontStretch="{Binding FontStretch}" FontStyle="{Binding FontStyle}" FontWeight="{Binding FontWeight}" /> <Image Grid.Row="3" Visibility="{TemplateBinding EndArrowImageVisibility}" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None" Margin="1" Source="/MindFusion.Scheduling.Silverlight;component/Resources/ArrowDown.png" /> </Grid> </local:SideBorders> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>
<Style TargetType="local:SideBorders"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:SideBorders"> <Grid> <Rectangle HorizontalAlignment="Left" Width="{Binding BorderThickness.Left}" Fill="{Binding ItemStyle.LeftBorderBrush}" /> <Rectangle VerticalAlignment="Top" Height="{Binding BorderThickness.Top}" Fill="{Binding ItemStyle.TopBorderBrush}" /> <Rectangle HorizontalAlignment="Right" Width="{Binding BorderThickness.Right}" Fill="{Binding ItemStyle.RightBorderBrush}" /> <Rectangle VerticalAlignment="Bottom" Height="{Binding BorderThickness.Bottom}" Fill="{Binding ItemStyle.BottomBorderBrush}" /> <Border BorderThickness="{Binding BorderThickness}"> <ContentPresenter Margin="{Binding ItemStyle.ContentMargin}" /> </Border> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>
<Style TargetType="local:ResizeBands" x:Key="ResizeBandsVertical"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:ResizeBands"> <Grid> <Grid.Resources> <local:VisibleConverter x:Key="visibleConverter"/> </Grid.Resources> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition /> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition /> </Grid.ColumnDefinitions> <Border Grid.ColumnSpan="2" BorderThickness="1,1,1,0" IsHitTestVisible="False" Background="Transparent" BorderBrush="Transparent" Height="{Binding ItemSettings.ResizeBandSize}" /> <Border Grid.ColumnSpan="2" BorderThickness="1,1,1,0" Background="{Binding ItemStyle.FillBrush}" BorderBrush="{Binding ItemStyle.BorderBrush}" Height="{Binding ItemSettings.ResizeBandSize}" Visibility="{Binding ResizeBandsVisible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource visibleConverter}}" /> <Border Grid.Row="1" BorderThickness="1,1,0,1" Width="{Binding ItemSettings.MoveBandSize}" Background="{Binding ItemStyle.FillBrush}" BorderBrush="{Binding ItemStyle.BorderBrush}" /> <Border Grid.Row="2" Grid.ColumnSpan="2" BorderThickness="1,0,1,1" IsHitTestVisible="False" Background="Transparent" BorderBrush="Transparent" Height="{Binding ItemSettings.ResizeBandSize}" /> <Border Grid.Row="2" Grid.ColumnSpan="2" BorderThickness="1,0,1,1" Background="{Binding ItemStyle.FillBrush}" BorderBrush="{Binding ItemStyle.BorderBrush}" Height="{Binding ItemSettings.ResizeBandSize}" Visibility="{Binding ResizeBandsVisible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource visibleConverter}}" /> <ContentPresenter Grid.Column="1" Grid.Row="1" /> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>
<Style TargetType="local:ResizeBands" x:Key="ResizeBandsHorizontal"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:ResizeBands"> <Grid> <Grid.Resources> <local:VisibleConverter x:Key="visibleConverter"/> </Grid.Resources> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <Border Grid.RowSpan="2" BorderThickness="1,1,0,1" IsHitTestVisible="False" Background="Transparent" BorderBrush="Transparent" Width="{Binding ItemSettings.ResizeBandSize}" /> <Border Grid.RowSpan="2" BorderThickness="1,1,0,1" Width="{Binding ItemSettings.ResizeBandSize}" Background="{Binding ItemStyle.FillBrush}" BorderBrush="{Binding ItemStyle.BorderBrush}" Visibility="{Binding ResizeBandsVisible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource visibleConverter}}" /> <Border Grid.Column="1" BorderThickness="1,1,1,0" Background="{Binding ItemStyle.FillBrush}" BorderBrush="{Binding ItemStyle.BorderBrush}" Height="{Binding ItemSettings.MoveBandSize}" /> <Border Grid.Column="2" Grid.RowSpan="2" BorderThickness="0,1,1,1" IsHitTestVisible="False" Background="Transparent" BorderBrush="Transparent" Width="{Binding ItemSettings.ResizeBandSize}" /> <Border Grid.Column="2" Grid.RowSpan="2" BorderThickness="0,1,1,1" Width="{Binding ItemSettings.ResizeBandSize}" Background="{Binding ItemStyle.FillBrush}" BorderBrush="{Binding ItemStyle.BorderBrush}" Visibility="{Binding ResizeBandsVisible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource visibleConverter}}" /> <ContentPresenter Grid.Column="1" Grid.Row="1"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> |