123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:InABox.DynamicGrid"
- xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
- xmlns:themes="clr-namespace:InABox.WPF.Themes;assembly=InABox.Wpf"
- x:Class="InABox.DynamicGrid.Generic"
- x:ClassModifier="public">
- <!-- VerticalSplitter -->
- <ControlTemplate x:Key="VerticalSplitter">
- <Grid Background="{TemplateBinding Background}" Width="4">
- <Button x:Name="PART_Left" Visibility="Collapsed" />
- <Button x:Name="PART_Right" Visibility="Collapsed" />
- <StackPanel Margin="0" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
- </StackPanel>
- </Grid>
- </ControlTemplate>
- <!-- HorizontalSplitter -->
- <ControlTemplate x:Key="HorizontalSplitter">
- <Grid Background="{TemplateBinding Background}" Height="4">
- <Button x:Name="PART_Left" Visibility="Collapsed" />
- <Button x:Name="PART_Right" Visibility="Collapsed" />
- <StackPanel Margin="0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
- <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
- </StackPanel>
- </Grid>
- </ControlTemplate>
- <!-- DynamicSplitPanel -->
- <Style TargetType="{x:Type local:DynamicSplitPanel}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type local:DynamicSplitPanel}">
- <Grid x:Name="PART_Grid">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="0" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <DockPanel Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Margin="0,0,2,0">
- <Button DockPanel.Dock="Top" x:Name="PART_DetailsOnly" BorderBrush="Gray"
- BorderThickness="0.75" Margin="0" Background="WhiteSmoke" MinHeight="25"
- MinWidth="25">
- <Polygon Points="0,0 8,5, 0,10" Stroke="Gray" Fill="Silver" />
- </Button>
- <Border DockPanel.Dock="Top" BorderBrush="Gray" BorderThickness="0.75" Margin="0,2,0,0"
- Background="WhiteSmoke">
- <Label x:Name="PART_MasterHeader"
- Content="{Binding MasterCaption, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}"
- HorizontalContentAlignment="Right">
- <Label.LayoutTransform>
- <RotateTransform Angle="270" />
- </Label.LayoutTransform>
- </Label>
- </Border>
- </DockPanel>
- <DockPanel Grid.Row="0" Grid.Column="1">
- <Button x:Name="PART_CombinedRight" BorderBrush="Gray" BorderThickness="0.75"
- Margin="2,0,0,2" Background="WhiteSmoke" DockPanel.Dock="Right" MinWidth="25"
- MinHeight="25" HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center">
- <Polygon Points="0,0 8,5, 0,10" Stroke="Gray" Fill="Silver" />
- </Button>
- <Button x:Name="PART_CombinedLeft" BorderBrush="Gray" BorderThickness="0.75"
- Margin="2,0,0,2" Background="WhiteSmoke" DockPanel.Dock="Right" MinWidth="25"
- MinHeight="25">
- <Polygon Points="8,0 0,5, 8,10" Stroke="Gray" Fill="Silver" />
- </Button>
- <ContentPresenter DockPanel.Dock="Left" MinHeight="25" Margin="0,0,0,2"
- Content="{Binding Header, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
- </DockPanel>
- <ContentPresenter Grid.Row="1" Grid.Column="1"
- Content="{Binding Master, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
- <syncfusion:SfGridSplitter Grid.Row="0" Grid.RowSpan="2" Grid.Column="2" Name="PART_Splitter"
- ResizeBehavior="PreviousAndNext" Width="4" Background="Transparent"
- Template="{StaticResource VerticalSplitter}">
- <syncfusion:SfGridSplitter.PreviewStyle>
- <Style TargetType="Control">
- <Setter Property="Background" Value="Gray" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Control">
- <Grid x:Name="Root" Opacity="0.5">
- <Rectangle Fill="{TemplateBinding Background}" />
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </syncfusion:SfGridSplitter.PreviewStyle>
- </syncfusion:SfGridSplitter>
- <ContentPresenter Grid.Row="0" Grid.Column="3" Margin="0,0,0,2"
- Content="{Binding DetailHeader, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
- <Grid x:Name="PART_DetailGrid" Grid.Row="1" Grid.Column="3">
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <ContentPresenter Grid.Row="0"
- Content="{Binding Detail, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
- <syncfusion:SfGridSplitter Grid.Row="1" Name="PART_DetailSplitter"
- ResizeBehavior="PreviousAndNext" Height="4"
- HorizontalAlignment="Stretch" Background="Transparent"
- Template="{StaticResource HorizontalSplitter}">
- <syncfusion:SfGridSplitter.PreviewStyle>
- <Style TargetType="Control">
- <Setter Property="Background" Value="Gray" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Control">
- <Grid x:Name="Root" Opacity="0.5">
- <Rectangle Fill="{TemplateBinding Background}" />
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </syncfusion:SfGridSplitter.PreviewStyle>
- </syncfusion:SfGridSplitter>
- <ContentPresenter Grid.Row="2"
- Content="{Binding SecondaryDetail, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
- </Grid>
- <DockPanel Grid.Row="0" Grid.Column="4" Grid.RowSpan="2" Margin="2,0,0,0">
- <Button DockPanel.Dock="Top" x:Name="PART_MasterOnly" BorderBrush="Gray"
- BorderThickness="0.75" Margin="0" Background="WhiteSmoke" MinHeight="25"
- MinWidth="25">
- <Polygon Points="8,0 0,5, 8,10" Stroke="Gray" Fill="Silver" />
- </Button>
- <Border DockPanel.Dock="Top" BorderBrush="Gray" BorderThickness="0.75" Margin="0,2,0,0"
- Background="WhiteSmoke">
- <Label x:Name="PART_DetailHeader"
- Content="{Binding DetailCaption, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}"
- HorizontalContentAlignment="Right">
- <Label.LayoutTransform>
- <RotateTransform Angle="270" />
- </Label.LayoutTransform>
- </Label>
- </Border>
- </DockPanel>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="syncfusion:GridFilterControl">
- <Setter Property="SortOptionVisibility" Value="Collapsed" />
- </Style>
- <!-- VerticalColumnHeader -->
- <Style x:Key="ActionColumnHeader" TargetType="{x:Type syncfusion:GridHeaderCellControl}">
- <Setter Property="Background" Value="LightSkyBlue" />
- <Setter Property="Foreground" Value="Black" />
- <Setter Property="BorderBrush" Value="Black" />
- <Setter Property="BorderThickness" Value="0.5,0.5,0.5,0.5" />
- <Setter Property="HorizontalContentAlignment" Value="Left" />
- <Setter Property="Padding" Value="5,3" />
- <Setter Property="FontFamily" Value="Segoe UI" />
- <Setter Property="FontSize" Value="14" />
- <Setter Property="FontWeight" Value="Normal" />
- <Setter Property="IsTabStop" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type syncfusion:GridHeaderCellControl}">
- <Grid>
- <Grid.LayoutTransform>
- <RotateTransform Angle="90" />
- </Grid.LayoutTransform>
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="HiddenColumnsResizingStates">
- <VisualState x:Name="PreviousColumnHidden">
- <Storyboard>
- <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
- Storyboard.TargetProperty="BorderThickness"
- Storyboard.TargetName="PART_HeaderCellBorder">
- <EasingThicknessKeyFrame KeyTime="0" Value="3,0,1,1" />
- </ThicknessAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="HiddenState">
- <Storyboard>
- <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
- Storyboard.TargetProperty="BorderThickness"
- Storyboard.TargetName="PART_HeaderCellBorder">
- <EasingThicknessKeyFrame KeyTime="0" Value="3,0,3,1" />
- </ThicknessAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="NormalState" />
- <VisualState x:Name="LastColumnHidden">
- <Storyboard>
- <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
- Storyboard.TargetProperty="BorderThickness"
- Storyboard.TargetName="PART_HeaderCellBorder">
- <EasingThicknessKeyFrame KeyTime="0" Value="0,0,3,1" />
- </ThicknessAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- <VisualStateGroup x:Name="CommonStates">
- <VisualState x:Name="MouseOver" />
- <VisualState x:Name="Normal" />
- </VisualStateGroup>
- <VisualStateGroup x:Name="BorderStates">
- <VisualState x:Name="NormalCell" />
- <VisualState x:Name="FooterColumnCell">
- <Storyboard BeginTime="0">
- <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
- Storyboard.TargetProperty="BorderThickness"
- Storyboard.TargetName="PART_FooterCellBorder">
- <EasingThicknessKeyFrame KeyTime="0" Value="1,0,1,1" />
- </ThicknessAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="BeforeFooterColumnCell">
- <Storyboard BeginTime="0">
- <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
- Storyboard.TargetProperty="BorderThickness"
- Storyboard.TargetName="PART_FooterCellBorder">
- <EasingThicknessKeyFrame KeyTime="0" Value="0,0,0,1" />
- </ThicknessAnimationUsingKeyFrames>
- <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
- Storyboard.TargetProperty="BorderThickness"
- Storyboard.TargetName="PART_HeaderCellBorder">
- <EasingThicknessKeyFrame KeyTime="0" Value="0,0,0,1" />
- </ThicknessAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- <Border x:Name="PART_FooterCellBorder" BorderBrush="{TemplateBinding BorderBrush}"
- Background="{TemplateBinding Background}" />
- <Border x:Name="PART_HeaderCellBorder" BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
- <Grid Margin="{TemplateBinding Padding}" SnapsToDevicePixels="True">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}"
- Content="{TemplateBinding Content}"
- ContentStringFormat="{TemplateBinding ContentStringFormat}"
- Focusable="False"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="Center" />
- <Grid x:Name="PART_SortButtonPresenter" Grid.Column="1" SnapsToDevicePixels="True">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*">
- <ColumnDefinition.MinWidth>
- <Binding Mode="OneWay" Path="SortDirection"
- RelativeSource="{RelativeSource TemplatedParent}">
- <Binding.Converter>
- <syncfusion:SortDirectionToWidthConverter />
- </Binding.Converter>
- </Binding>
- </ColumnDefinition.MinWidth>
- </ColumnDefinition>
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Path
- Data="F1M753.644,-13.0589L753.736,-12.9639 753.557,-12.7816 732.137,8.63641 732.137,29.7119 756.445,5.40851 764.094,-2.24384 764.275,-2.42352 771.834,5.1286 796.137,29.4372 796.137,8.36163 774.722,-13.0589 764.181,-23.5967 753.644,-13.0589z"
- Fill="Gray" HorizontalAlignment="Center" Height="8.138" Stretch="Fill"
- SnapsToDevicePixels="True" VerticalAlignment="Center" Width="8.938">
- <Path.RenderTransform>
- <TransformGroup>
- <RotateTransform Angle="90" />
- <ScaleTransform ScaleY="1" ScaleX="1" />
- </TransformGroup>
- </Path.RenderTransform>
- <!-- <Path.Visibility> -->
- <!-- <Binding ConverterParameter="Ascending" Path="SortDirection" RelativeSource="{RelativeSource TemplatedParent}"> -->
- <!-- <Binding.Converter> -->
- <!-- <syncfusion:SortDirectionToVisibilityConverter/> -->
- <!-- </Binding.Converter> -->
- <!-- </Binding> -->
- <!-- </Path.Visibility> -->
- </Path>
- <Path
- Data="F1M181.297,177.841L181.205,177.746 181.385,177.563 202.804,156.146 202.804,135.07 178.497,159.373 170.847,167.026 170.666,167.205 163.107,159.653 138.804,135.345 138.804,156.42 160.219,177.841 170.76,188.379 181.297,177.841z"
- Fill="Gray" HorizontalAlignment="Center" Height="8.138" Stretch="Fill"
- SnapsToDevicePixels="True" VerticalAlignment="Center" Width="8.938">
- <Path.RenderTransform>
- <TransformGroup>
- <RotateTransform Angle="90" />
- <ScaleTransform ScaleY="1" ScaleX="1" />
- </TransformGroup>
- </Path.RenderTransform>
- <!-- <Path.Visibility> -->
- <!-- <Binding ConverterParameter="Decending" Path="SortDirection" RelativeSource="{RelativeSource TemplatedParent}"> -->
- <!-- <Binding.Converter> -->
- <!-- <syncfusion:SortDirectionToVisibilityConverter/> -->
- <!-- </Binding.Converter> -->
- <!-- </Binding> -->
- <!-- </Path.Visibility> -->
- </Path>
- <TextBlock Grid.Column="1" Foreground="{TemplateBinding Foreground}" FontSize="10"
- Margin="0,-4,0,0" SnapsToDevicePixels="True"
- Text="{TemplateBinding SortNumber}"
- Visibility="{TemplateBinding SortNumberVisibility}"
- VerticalAlignment="Center" />
- </Grid>
- <syncfusion:FilterToggleButton x:Name="PART_FilterToggleButton" Grid.Column="2"
- HorizontalAlignment="Stretch" SnapsToDevicePixels="True"
- Visibility="{TemplateBinding FilterIconVisiblity}"
- VerticalAlignment="Stretch" />
- <Border x:Name="PART_FilterPopUpPresenter" />
- </Grid>
- </Border>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style BasedOn="{StaticResource {x:Type TabItem}}" TargetType="{x:Type local:DynamicTabItem}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type local:DynamicTabItem}">
- <Border Name="Panel" BorderBrush="Gray" PreviewMouseRightButtonUp="Panel_OnPreviewMouseRightButtonUp">
- <DockPanel>
- <Button x:Name="CloseButton" DockPanel.Dock="Right" Content="x" BorderThickness="0"
- Padding="5,0,5,0" Background="Transparent" VerticalContentAlignment="Center"
- HorizontalContentAlignment="Center"
- IsEnabled="True" Margin="2"
- Command="{TemplateBinding CloseTabCommand}" />
- <ContentPresenter
- x:Name="ContentSite"
- DockPanel.Dock="Left"
- VerticalAlignment="Center"
- HorizontalAlignment="Center"
- ContentSource="Header"
- Margin="10,3.5" />
- </DockPanel>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Setter TargetName="Panel" Property="Background"
- Value="{Binding Path=(themes:ThemeManager.SelectedTabItemBackgroundBrush)}" />
- <Setter TargetName="Panel" Property="TextBlock.Foreground"
- Value="{Binding Path=(themes:ThemeManager.SelectedTabItemForegroundBrush)}" />
- </Trigger>
- <Trigger Property="IsSelected" Value="False">
- <Setter TargetName="Panel" Property="Background"
- Value="{Binding Path=(themes:ThemeManager.WorkspaceBackgroundBrush)}" />
- <Setter TargetName="Panel" Property="TextBlock.Foreground"
- Value="{Binding Path=(themes:ThemeManager.WorkspaceForegroundBrush)}" />
- </Trigger>
- <Trigger Property="CanClose" Value="True">
- <Setter TargetName="CloseButton" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger Property="CanClose" Value="False">
- <Setter TargetName="CloseButton" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="TabStripPlacement" Value="{x:Static Dock.Bottom}">
- <Setter TargetName="Panel" Property="CornerRadius" Value="0,0,5,5" />
- <Setter TargetName="Panel" Property="Margin" Value="0,-0.75,2,2" />
- <Setter TargetName="Panel" Property="BorderThickness" Value="0.75,0,0.75,0.75" />
- </Trigger>
- <Trigger Property="TabStripPlacement" Value="{x:Static Dock.Top}">
- <Setter TargetName="Panel" Property="CornerRadius" Value="5,5,0,0" />
- <Setter TargetName="Panel" Property="Margin" Value="0,2,2,0.75" />
- <Setter TargetName="Panel" Property="BorderThickness" Value="0.75,0.75,0.75,0" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- ~1~ This template explains how to render a tab item with a close button. @1@ -->
- <!-- <DataTemplate x:Key="ClosableTabItemHeader"> -->
- <!-- <DockPanel MinWidth="120"> -->
- <!-- <Button DockPanel.Dock="Right" Command="ApplicationCommands.Delete" CommandParameter="{Binding}" Content="X" Cursor="Hand" Focusable="False" FontSize="10" FontWeight="Bold" Height="16" Width="16" /> -->
- <!-- <TextBlock Padding="0,0,10,0" Text="{Binding DisplayName}" VerticalAlignment="Center" /> -->
- <!-- </DockPanel> -->
- <!-- </DataTemplate> -->
- <!-- ~1~ This template explains how to render a tab item with a new button. @1@ -->
- <!-- <DataTemplate x:Key="NewTabItemHeader"> -->
- <!-- <Button Command="{Binding NewTabCommand, RelativeSource={RelativeSource AncestorType={x:Type local:DynamicTabControl}}}" Content="+" Cursor="Hand" Focusable="False" FontWeight="Bold" -->
- <!-- Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"/> -->
- <!-- </DataTemplate> -->
- <Style BasedOn="{StaticResource {x:Type TabControl}}" TargetType="{x:Type local:DynamicTabControl}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type local:DynamicTabControl}">
- <Grid Background="Transparent">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <DockPanel x:Name="Panel"
- Background="{Binding Path=(themes:ThemeManager.WorkspaceBackgroundBrush)}">
- <Button x:Name="AddButton" DockPanel.Dock="Right" Content="+"
- BorderThickness="0" Padding="5,0,5,0" Background="Transparent"
- Command="{TemplateBinding CreateTabCommand}" />
- <TabPanel IsItemsHost="true" Background="Transparent" />
- </DockPanel>
- <Border
- x:Name="Content"
- Grid.Row="1"
- BorderBrush="Gray"
- Background="{Binding Path=(themes:ThemeManager.WorkspaceBackgroundBrush)}"
- BorderThickness="0.75">
- <ContentPresenter ContentSource="SelectedContent" />
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="CanCreateTab" Value="True">
- <Setter TargetName="AddButton" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger Property="CanCreateTab" Value="False">
- <Setter TargetName="AddButton" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="TabStripPlacement" Value="{x:Static Dock.Top}">
- <Setter TargetName="Panel" Property="Grid.Row" Value="0" />
- <Setter TargetName="Content" Property="BorderThickness" Value="0,0.75,0,0" />
- <Setter TargetName="Content" Property="Padding" Value="0,2,0,0" />
- </Trigger>
- <Trigger Property="TabStripPlacement" Value="{x:Static Dock.Bottom}">
- <Setter TargetName="Panel" Property="Grid.Row" Value="2" />
- <Setter TargetName="Content" Property="BorderThickness" Value="0,0,0,0.75" />
- <Setter TargetName="Content" Property="Padding" Value="0,0,0,3" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|