|
| 1 | +<Window x:Class="TabControlAlignment.MainWindow" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 5 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 6 | + xmlns:local="clr-namespace:TabControlAlignment" |
| 7 | + xmlns:syncfusion="http://schemas.syncfusion.com/wpf" |
| 8 | + WindowStartupLocation="CenterScreen" |
| 9 | + mc:Ignorable="d" |
| 10 | + Title="MainWindow" Height="450" Width="800"> |
| 11 | + <Window.Resources> |
| 12 | + <Style x:Key="NewtabControlExtStyle" TargetType="syncfusion:TabControlExt"> |
| 13 | + <Setter Property="BorderThickness" Value="1"/> |
| 14 | + <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/> |
| 15 | + <Style.Triggers> |
| 16 | + <MultiDataTrigger> |
| 17 | + <Setter Property="Template"> |
| 18 | + <Setter.Value> |
| 19 | + <ControlTemplate TargetType="{x:Type syncfusion:TabControlExt}"> |
| 20 | + <Grid x:Name="TabControlGrid" Background="{TemplateBinding Background}" ClipToBounds="False" SnapsToDevicePixels="True" KeyboardNavigation.TabNavigation="Local"> |
| 21 | + <Grid.ColumnDefinitions> |
| 22 | + <ColumnDefinition x:Name="ColumnDefinition0"/> |
| 23 | + <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/> |
| 24 | + </Grid.ColumnDefinitions> |
| 25 | + <Grid.RowDefinitions> |
| 26 | + <RowDefinition x:Name="RowDefinition0" Height="Auto"/> |
| 27 | + <RowDefinition x:Name="RowDefinition1" Height="*"/> |
| 28 | + </Grid.RowDefinitions> |
| 29 | + <syncfusion:HeaderPanel x:Name="HeaderPanel" Background="{TemplateBinding TabPanelBackground}" Grid.Column="0" Focusable="False" HorizontalAlignment="Stretch" Grid.Row="0" VerticalAlignment="Stretch" Panel.ZIndex="1"> |
| 30 | + <syncfusion:TabPanelAdv x:Name="PART_TabPanel" DockPanel.Dock="Right" Focusable="False" HorizontalAlignment="Center" Style="{TemplateBinding TabPanelStyle}" VerticalAlignment="Stretch"> |
| 31 | + <syncfusion:TabScrollViewer x:Name="PART_ScrollViewer" Focusable="False" HorizontalScrollBarVisibility="Hidden" Margin="{Binding Margin, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ContentPresenter}}}" PanningMode="HorizontalFirst" VerticalScrollBarVisibility="Hidden"> |
| 32 | + <syncfusion:TabLayoutPanel x:Name="PART_TabLayoutPanel" AllowDrop="True" ClipToBounds="True" HorizontalAlignment="Left" IsItemsHost="True" Margin="0,2,2,-1" KeyboardNavigation.TabIndex="1" VerticalAlignment="Top"/> |
| 33 | + </syncfusion:TabScrollViewer> |
| 34 | + </syncfusion:TabPanelAdv> |
| 35 | + </syncfusion:HeaderPanel> |
| 36 | + <syncfusion:Border3D x:Name="ContentPanel" AllowDrop="True" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="0" CornerRadius="2" KeyboardNavigation.DirectionalNavigation="Contained" Margin="0,1,0,0" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local"> |
| 37 | + <Border x:Name="PART_ContentPanelBorder" BorderBrush="#FF69A1BF" BorderThickness="0" CornerRadius="2"> |
| 38 | + <Border x:Name="PART_ContentPanelInnerBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2" Margin="3"> |
| 39 | + <ContentPresenter x:Name="PART_SelectedContentHost" AllowDrop="True" ContentTemplate="{TemplateBinding SelectedContentTemplate}" Content="{TemplateBinding SelectedContent}" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> |
| 40 | + </Border> |
| 41 | + </Border> |
| 42 | + </syncfusion:Border3D> |
| 43 | + </Grid> |
| 44 | + </ControlTemplate> |
| 45 | + </Setter.Value> |
| 46 | + </Setter> |
| 47 | + </MultiDataTrigger> |
| 48 | + </Style.Triggers> |
| 49 | + </Style> |
| 50 | + </Window.Resources> |
| 51 | + |
| 52 | + <Grid> |
| 53 | + <syncfusion:TabControlExt Grid.Column="0" x:Name="MyTabCtrl" |
| 54 | + syncfusion:SkinStorage.VisualStyle="Metro" |
| 55 | + AllowDragDrop="False" |
| 56 | + EnableLabelEdit="False" |
| 57 | + TabScrollStyle="Normal" |
| 58 | + ShowTabItemContextMenu="False" |
| 59 | + CloseButtonType="Hide" |
| 60 | + TabStripPlacement="Top" |
| 61 | + HorizontalAlignment="Center" |
| 62 | + ShowTabListContextMenu="False" |
| 63 | + TabItemSelectedBackground="Red" |
| 64 | + TabItemHoverBackground ="ForestGreen" |
| 65 | + TabItemHoverForeground ="Black" |
| 66 | + TabItemHoverBorderBrush="DarkGreen" |
| 67 | + TabItemSelectedBorderBrush="Black" |
| 68 | + TabItemSelectedForeground="Yellow" |
| 69 | + BorderThickness="0" Width="750" Style="{DynamicResource NewtabControlExtStyle}"> |
| 70 | + <syncfusion:TabControlExt.Resources> |
| 71 | + <Style TargetType="{x:Type syncfusion:HeaderPanel}"> |
| 72 | + <Setter Property="HorizontalAlignment" Value="Center" /> |
| 73 | + </Style> |
| 74 | + </syncfusion:TabControlExt.Resources> |
| 75 | + |
| 76 | + <syncfusion:TabItemExt Header="Properties" Margin="0" HorizontalAlignment="Center"> |
| 77 | + <TextBlock Text="Properties tab Description" /> |
| 78 | + </syncfusion:TabItemExt> |
| 79 | + <syncfusion:TabItemExt Header="Solution" Margin="0" HorizontalAlignment="Center"> |
| 80 | + <TextBlock Text="Solution tab Description" /> |
| 81 | + </syncfusion:TabItemExt> |
| 82 | + <syncfusion:TabItemExt Header="Output" Margin="0" HorizontalAlignment="Center"> |
| 83 | + <TextBlock Text="Output tab Description" /> |
| 84 | + </syncfusion:TabItemExt> |
| 85 | + |
| 86 | + </syncfusion:TabControlExt> |
| 87 | + </Grid> |
| 88 | +</Window> |
0 commit comments