From 0c535415fd0562b6d8d2d1c9092206f02ec6356c Mon Sep 17 00:00:00 2001 From: Bastian Schmidt Date: Sun, 22 Nov 2015 11:11:20 +0100 Subject: [PATCH] Fixes #192 by making Background and BorderBrush of Button and RibbonGroupBox styleable --- Fluent/Controls/Button.cs | 19 +++++++ Fluent/Themes/Office2010/Controls/Button.xaml | 28 ++++++---- .../Office2010/Controls/RibbonGroupBox.xaml | 51 ++++++++++-------- Fluent/Themes/Office2013/Controls/Button.xaml | 17 ++++-- .../Office2013/Controls/RibbonGroupBox.xaml | 52 +++++++++++-------- Fluent/Themes/Windows8/Controls/Button.xaml | 18 ++++--- .../Windows8/Controls/RibbonGroupBox.xaml | 51 +++++++++++------- 7 files changed, 153 insertions(+), 83 deletions(-) diff --git a/Fluent/Controls/Button.cs b/Fluent/Controls/Button.cs index ae4d9dab9..9957f4b56 100644 --- a/Fluent/Controls/Button.cs +++ b/Fluent/Controls/Button.cs @@ -164,6 +164,25 @@ public bool IsDefinitive #endregion + #region CornerRadius + + /// + /// Gets or sets the CornerRadius for the element + /// + public CornerRadius CornerRadius + { + get { return (CornerRadius)this.GetValue(CornerRadiusProperty); } + set { this.SetValue(CornerRadiusProperty, value); } + } + + /// + /// Using a DependencyProperty as the backing store for CornerRadius. This enables animation, styling, binding, etc... + /// + public static readonly DependencyProperty CornerRadiusProperty = + DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(Button), new PropertyMetadata(default(CornerRadius))); + + #endregion CornerRadius + #endregion #region Constructors diff --git a/Fluent/Themes/Office2010/Controls/Button.xaml b/Fluent/Themes/Office2010/Controls/Button.xaml index c9defe757..d7391b65c 100644 --- a/Fluent/Themes/Office2010/Controls/Button.xaml +++ b/Fluent/Themes/Office2010/Controls/Button.xaml @@ -8,19 +8,19 @@ + CornerRadius="{TemplateBinding CornerRadius}" + BorderThickness="{TemplateBinding BorderThickness}" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}"> - + SnapsToDevicePixels="True" /> + -