diff --git a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/HamburgerMenuSample.xaml b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/HamburgerMenuSample.xaml index 4d1e0a4b35..d46d493db5 100644 --- a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/HamburgerMenuSample.xaml +++ b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/HamburgerMenuSample.xaml @@ -21,7 +21,7 @@ diff --git a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/TabControlExamples.xaml b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/TabControlExamples.xaml index 502207aa8e..048682b057 100644 --- a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/TabControlExamples.xaml +++ b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleViews/TabControlExamples.xaml @@ -121,8 +121,8 @@ + Controls:HeaderedControlHelper.HeaderFontFamily="Segoe Script" + Controls:HeaderedControlHelper.HeaderFontSize="18"> @@ -294,41 +294,41 @@ Style="{DynamicResource DescriptionHeaderStyle}" /> - - - - - - - @@ -342,7 +342,7 @@ - + - + - + - + - - + diff --git a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleWindows/CleanWindowDemo.xaml b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleWindows/CleanWindowDemo.xaml index 30c29f2a80..0368f9af09 100644 --- a/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleWindows/CleanWindowDemo.xaml +++ b/src/MahApps.Metro.Samples/MahApps.Metro.Demo/ExampleWindows/CleanWindowDemo.xaml @@ -121,7 +121,7 @@ + /// Gets the value of the Foreground for the header. + /// [Category(AppName.MahApps)] [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] public static Brush GetHeaderForeground(UIElement element) @@ -18,14 +25,26 @@ public static Brush GetHeaderForeground(UIElement element) return (Brush)element.GetValue(HeaderForegroundProperty); } + /// + /// Sets the value of the Foreground for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] public static void SetHeaderForeground(UIElement element, Brush value) { element.SetValue(HeaderForegroundProperty, value); } - public static readonly DependencyProperty HeaderBackgroundProperty = - DependencyProperty.RegisterAttached("HeaderBackground", typeof(Brush), typeof(HeaderedControlHelper), new UIPropertyMetadata(Panel.BackgroundProperty.DefaultMetadata.DefaultValue)); + public static readonly DependencyProperty HeaderBackgroundProperty + = DependencyProperty.RegisterAttached( + "HeaderBackground", + typeof(Brush), + typeof(HeaderedControlHelper), + new UIPropertyMetadata(Panel.BackgroundProperty.DefaultMetadata.DefaultValue)); + /// + /// Gets the value of the Background for the header. + /// [Category(AppName.MahApps)] [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] public static Brush GetHeaderBackground(UIElement element) @@ -33,9 +52,167 @@ public static Brush GetHeaderBackground(UIElement element) return (Brush)element.GetValue(HeaderBackgroundProperty); } + /// + /// Sets the value of the Background for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] public static void SetHeaderBackground(UIElement element, Brush value) { element.SetValue(HeaderBackgroundProperty, value); } + + public static readonly DependencyProperty HeaderFontFamilyProperty + = DependencyProperty.RegisterAttached( + "HeaderFontFamily", + typeof(FontFamily), + typeof(HeaderedControlHelper), + new FrameworkPropertyMetadata(SystemFonts.MessageFontFamily, FrameworkPropertyMetadataOptions.Inherits)); + + /// + /// Gets the value of the FontFamily for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] + [AttachedPropertyBrowsableForType(typeof(TabControl))] + [AttachedPropertyBrowsableForType(typeof(Flyout))] + public static FontFamily GetHeaderFontFamily(UIElement element) + { + return (FontFamily)element.GetValue(HeaderFontFamilyProperty); + } + + /// + /// Sets the value of the FontFamily for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] + [AttachedPropertyBrowsableForType(typeof(TabControl))] + [AttachedPropertyBrowsableForType(typeof(Flyout))] + public static void SetHeaderFontFamily(UIElement element, FontFamily value) + { + element.SetValue(HeaderFontFamilyProperty, value); + } + + public static readonly DependencyProperty HeaderFontSizeProperty + = DependencyProperty.RegisterAttached( + "HeaderFontSize", + typeof(double), + typeof(HeaderedControlHelper), + new FrameworkPropertyMetadata(SystemFonts.MessageFontSize, FrameworkPropertyMetadataOptions.Inherits)); + + /// + /// Gets the value of the FontSize for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] + [AttachedPropertyBrowsableForType(typeof(TabControl))] + [AttachedPropertyBrowsableForType(typeof(Flyout))] + public static double GetHeaderFontSize(UIElement element) + { + return (double)element.GetValue(HeaderFontSizeProperty); + } + + /// + /// Sets the value of the FontSize for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] + [AttachedPropertyBrowsableForType(typeof(TabControl))] + [AttachedPropertyBrowsableForType(typeof(Flyout))] + public static void SetHeaderFontSize(UIElement element, double value) + { + element.SetValue(HeaderFontSizeProperty, value); + } + + public static readonly DependencyProperty HeaderFontStretchProperty + = DependencyProperty.RegisterAttached( + "HeaderFontStretch", + typeof(FontStretch), + typeof(HeaderedControlHelper), + new FrameworkPropertyMetadata(TextElement.FontStretchProperty.DefaultMetadata.DefaultValue, FrameworkPropertyMetadataOptions.Inherits)); + + /// + /// Gets the value of the FontStretch for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] + [AttachedPropertyBrowsableForType(typeof(TabControl))] + [AttachedPropertyBrowsableForType(typeof(Flyout))] + public static FontStretch GetHeaderFontStretch(UIElement element) + { + return (FontStretch)element.GetValue(HeaderFontStretchProperty); + } + + /// + /// Sets the value of the FontStretch for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] + [AttachedPropertyBrowsableForType(typeof(TabControl))] + [AttachedPropertyBrowsableForType(typeof(Flyout))] + public static void SetHeaderFontStretch(UIElement element, FontStretch value) + { + element.SetValue(HeaderFontStretchProperty, value); + } + + public static readonly DependencyProperty HeaderFontWeightProperty + = DependencyProperty.RegisterAttached( + "HeaderFontWeight", + typeof(FontWeight), + typeof(HeaderedControlHelper), + new FrameworkPropertyMetadata(SystemFonts.MessageFontWeight, FrameworkPropertyMetadataOptions.Inherits)); + + /// + /// Gets the value of the FontWeight for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] + [AttachedPropertyBrowsableForType(typeof(TabControl))] + [AttachedPropertyBrowsableForType(typeof(Flyout))] + public static FontWeight GetHeaderFontWeight(UIElement element) + { + return (FontWeight)element.GetValue(HeaderFontWeightProperty); + } + + /// + /// Sets the value of the FontWeight for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] + [AttachedPropertyBrowsableForType(typeof(TabControl))] + [AttachedPropertyBrowsableForType(typeof(Flyout))] + public static void SetHeaderFontWeight(UIElement element, FontWeight value) + { + element.SetValue(HeaderFontWeightProperty, value); + } + + public static readonly DependencyProperty HeaderMarginProperty + = DependencyProperty.RegisterAttached( + "HeaderMargin", + typeof(Thickness), + typeof(HeaderedControlHelper), + new UIPropertyMetadata(new Thickness())); + + /// + /// Gets or sets the outer margin for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] + [AttachedPropertyBrowsableForType(typeof(Flyout))] + public static Thickness GetHeaderMargin(UIElement element) + { + return (Thickness)element.GetValue(HeaderMarginProperty); + } + + /// + /// Sets or sets the outer margin for the header. + /// + [Category(AppName.MahApps)] + [AttachedPropertyBrowsableForType(typeof(HeaderedContentControl))] + [AttachedPropertyBrowsableForType(typeof(Flyout))] + public static void SetHeaderMargin(UIElement element, Thickness value) + { + element.SetValue(HeaderMarginProperty, value); + } } } \ No newline at end of file diff --git a/src/MahApps.Metro/Styles/Clean/CleanGroupBox.xaml b/src/MahApps.Metro/Styles/Clean/CleanGroupBox.xaml index 32bbe175b6..9d98522ac6 100644 --- a/src/MahApps.Metro/Styles/Clean/CleanGroupBox.xaml +++ b/src/MahApps.Metro/Styles/Clean/CleanGroupBox.xaml @@ -5,7 +5,7 @@ diff --git a/src/MahApps.Metro/Themes/MetroHeader.xaml b/src/MahApps.Metro/Themes/MetroHeader.xaml index c02c4bbedb..e5d2a04422 100644 --- a/src/MahApps.Metro/Themes/MetroHeader.xaml +++ b/src/MahApps.Metro/Themes/MetroHeader.xaml @@ -3,10 +3,10 @@ xmlns:Controls="clr-namespace:MahApps.Metro.Controls">