From 448ecc66be0cd4803bd20d202373b37c118f87d2 Mon Sep 17 00:00:00 2001 From: HendrikLynx Date: Thu, 24 Mar 2016 00:37:32 +0100 Subject: [PATCH] Button Icon resizing Added IconHeight and IconWidth parameter, with default value 32, to Fluent:Button to allow resizing of the icon. --- Fluent.Ribbon/Controls/Button.cs | 38 +++++++++++++++++++ .../Themes/Office2010/Controls/Button.xaml | 4 +- .../Themes/Office2013/Controls/Button.xaml | 4 +- .../Themes/Windows8/Controls/Button.xaml | 4 +- 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/Fluent.Ribbon/Controls/Button.cs b/Fluent.Ribbon/Controls/Button.cs index cdfb2313e..ff2790e83 100644 --- a/Fluent.Ribbon/Controls/Button.cs +++ b/Fluent.Ribbon/Controls/Button.cs @@ -115,6 +115,44 @@ private static void OnIconChanged(DependencyObject d, DependencyPropertyChangedE } #endregion + #region IconHeight + + /// + /// Gets or sets icon height + /// + public int IconHeight + { + get { return (int)this.GetValue(IconHeightProperty); } + set { this.SetValue(IconHeightProperty, value); } + } + + /// + /// Using a DependencyProperty as the backing store for IconHeight. This enables animation, styling, binding, etc... + /// + public static readonly DependencyProperty IconHeightProperty = + DependencyProperty.Register("IconHeight", typeof(int), typeof(Button), new UIPropertyMetadata(32)); + + #endregion + + #region IconWidth + + /// + /// Gets or sets icon width + /// + public int IconWidth + { + get { return (int)this.GetValue(IconWidthProperty); } + set { this.SetValue(IconWidthProperty, value); } + } + + /// + /// Using a DependencyProperty as the backing store for IconWidth. This enables animation, styling, binding, etc... + /// + public static readonly DependencyProperty IconWidthProperty = + DependencyProperty.Register("IconWidth", typeof(int), typeof(Button), new UIPropertyMetadata(32)); + + #endregion + #region LargeIcon /// diff --git a/Fluent.Ribbon/Themes/Office2010/Controls/Button.xaml b/Fluent.Ribbon/Themes/Office2010/Controls/Button.xaml index 9a843bbef..9c85e17dc 100644 --- a/Fluent.Ribbon/Themes/Office2010/Controls/Button.xaml +++ b/Fluent.Ribbon/Themes/Office2010/Controls/Button.xaml @@ -42,10 +42,10 @@ d:LayoutOverrides="Width, Height">