diff --git a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/MahApps.Metro.Demo.Shared/ExampleViews/TabControlExamples.xaml b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/MahApps.Metro.Demo.Shared/ExampleViews/TabControlExamples.xaml index 9e8a53d8cd..68ee66b9e3 100644 --- a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/MahApps.Metro.Demo.Shared/ExampleViews/TabControlExamples.xaml +++ b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/MahApps.Metro.Demo.Shared/ExampleViews/TabControlExamples.xaml @@ -54,11 +54,11 @@ HorizontalAlignment="Left" VerticalAlignment="Center" ItemsSource="{Binding Source={StaticResource TabStripPlacementEnumValues}}" - SelectedItem="{x:Static Dock.Top}" /> + SelectedItem="{x:Static Dock.Right}" /> + TabStripPlacement="{Binding ElementName=TabStripPlacementComboBox, Path=SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Controls:TabControlHelper.UnderlinePosition="Right"> @@ -110,7 +110,7 @@ + TabStripPlacement="{Binding ElementName=AnimatedTabControlTabStripPlacementComboBox, Path=SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Controls:TabControlHelper.UnderlinePosition="Left"> @@ -154,7 +154,7 @@ + TabStripPlacement="{Binding ElementName=AnimatedSingleRowTabControlTabStripPlacementComboBox, Path=SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Controls:TabControlHelper.UnderlinePosition="Top"> @@ -202,7 +202,7 @@ + TabStripPlacement="{Binding ElementName=MetroAnimatedTabControlTabStripPlacementComboBox, Path=SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Controls:TabControlHelper.UnderlinePosition="Bottom"> @@ -241,7 +241,7 @@ + TabStripPlacement="{Binding ElementName=MetroAnimatedSingleRowTabControlTabStripPlacementComboBox, Path=SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Controls:TabControlHelper.UnderlinePosition="Right"> diff --git a/src/MahApps.Metro/MahApps.Metro.Shared/Controls/Helper/TabControlHelper.cs b/src/MahApps.Metro/MahApps.Metro.Shared/Controls/Helper/TabControlHelper.cs index 48fc303b51..6e89bd0818 100644 --- a/src/MahApps.Metro/MahApps.Metro.Shared/Controls/Helper/TabControlHelper.cs +++ b/src/MahApps.Metro/MahApps.Metro.Shared/Controls/Helper/TabControlHelper.cs @@ -303,5 +303,30 @@ public static void SetTransition(DependencyObject obj, TransitionType value) { obj.SetValue(TransitionProperty, value); } + + + + /// + /// Defines the position of the Underline + /// + + public static readonly DependencyProperty UnderlinePositionProperty = + DependencyProperty.RegisterAttached("UnderlinePosition", + typeof(Dock), + typeof(TabControlHelper), + new PropertyMetadata(Dock.Bottom) + ); + + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(TabControl))] + public static Dock GetUnderlinePosition(UIElement element) + { + return (Dock)element.GetValue(UnderlinePositionProperty); + } + + public static void SetUnderlinePosition(UIElement element, Dock value) + { + element.SetValue(UnderlinePositionProperty, value); + } } } diff --git a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.AnimatedSingleRowTabControl.xaml b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.AnimatedSingleRowTabControl.xaml index 30bfa9314e..e04169f590 100644 --- a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.AnimatedSingleRowTabControl.xaml +++ b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.AnimatedSingleRowTabControl.xaml @@ -236,7 +236,6 @@ - @@ -244,8 +243,98 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -297,7 +386,6 @@ - @@ -305,9 +393,98 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.AnimatedTabControl.xaml b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.AnimatedTabControl.xaml index e1741bdf3b..800b6ee0e3 100644 --- a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.AnimatedTabControl.xaml +++ b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.AnimatedTabControl.xaml @@ -69,7 +69,6 @@ - @@ -81,7 +80,6 @@ - @@ -93,11 +91,189 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TabControl.xaml b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TabControl.xaml index 733e6336ec..504f39aab2 100644 --- a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TabControl.xaml +++ b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TabControl.xaml @@ -11,6 +11,7 @@ + @@ -65,7 +66,6 @@ - @@ -77,7 +77,6 @@ - @@ -89,8 +88,9 @@ - + + @@ -154,8 +154,8 @@ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" UseLayoutRounding="False" /> - - - @@ -185,9 +182,6 @@ - - - @@ -196,9 +190,6 @@ - - - @@ -207,9 +198,6 @@ - - - @@ -223,6 +211,30 @@ + + + + + @@ -276,6 +288,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/MahApps.Metro/MahApps.Metro/Themes/MetroTabControl.xaml b/src/MahApps.Metro/MahApps.Metro/Themes/MetroTabControl.xaml index 685de74df6..ae56c8a299 100644 --- a/src/MahApps.Metro/MahApps.Metro/Themes/MetroTabControl.xaml +++ b/src/MahApps.Metro/MahApps.Metro/Themes/MetroTabControl.xaml @@ -59,7 +59,6 @@ - @@ -70,7 +69,6 @@ - @@ -81,7 +79,6 @@ - diff --git a/src/MahApps.Metro/MahApps.Metro/Themes/MetroTabItem.xaml b/src/MahApps.Metro/MahApps.Metro/Themes/MetroTabItem.xaml index 88b34baa3f..c19f53cc62 100644 --- a/src/MahApps.Metro/MahApps.Metro/Themes/MetroTabItem.xaml +++ b/src/MahApps.Metro/MahApps.Metro/Themes/MetroTabItem.xaml @@ -115,9 +115,6 @@ - - - @@ -126,9 +123,6 @@ - - - @@ -137,9 +131,6 @@ - - - @@ -148,9 +139,6 @@ - - - @@ -242,6 +230,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +