diff --git a/Fluent.Ribbon.Showcase/Fluent.Ribbon.Showcase.NET 4.5.csproj b/Fluent.Ribbon.Showcase/Fluent.Ribbon.Showcase.NET 4.5.csproj index 168e8dc44..42adbe6fc 100644 --- a/Fluent.Ribbon.Showcase/Fluent.Ribbon.Showcase.NET 4.5.csproj +++ b/Fluent.Ribbon.Showcase/Fluent.Ribbon.Showcase.NET 4.5.csproj @@ -1,253 +1,261 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2C2A076B-E626-4A07-9D6E-4AEE3FEC41B6} - WinExe - Properties - FluentTest - Fluent.Ribbon.Showcase - v4.5 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - Icons\App.ico - ..\build\obj\NET 4.5 - true - 4.0.20408.0 - $(BaseIntermediateOutputPath)\$(Configuration)\ - - - true - full - false - ..\build\bin\NET 4.5\Debug\ - DEBUG;TRACE - prompt - 4 - false - AllRules.ruleset - false - - - pdbonly - true - ..\build\bin\NET 4.5\Release\ - TRACE - prompt - 4 - AllRules.ruleset - false - false - - - app.manifest - - - - ..\packages\MahApps.Metro.1.0.0.0\lib\net45\MahApps.Metro.dll - - - - - - ..\packages\MahApps.Metro.1.0.0.0\lib\net45\System.Windows.Interactivity.dll - - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - Properties\GlobalAssemblyInfo.cs - - - - - MahMetroWindow.xaml - - - - RegularWindow.xaml - - - RibbonWindowWithoutVisibileRibbon.xaml - - - TestContent.xaml - - - - - - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - TestWindow.xaml - Code - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - {4C92FCF4-3561-499F-BC5B-F2F089863047} - Fluent.Ribbon.NET 4.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {2C2A076B-E626-4A07-9D6E-4AEE3FEC41B6} + WinExe + Properties + FluentTest + Fluent.Ribbon.Showcase + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + Icons\App.ico + ..\build\obj\NET 4.5 + true + 4.0.20408.0 + $(BaseIntermediateOutputPath)\$(Configuration)\ + e12a77ec + + + true + full + false + ..\build\bin\NET 4.5\Debug\ + DEBUG;TRACE + prompt + 4 + false + AllRules.ruleset + false + + + pdbonly + true + ..\build\bin\NET 4.5\Release\ + TRACE + prompt + 4 + AllRules.ruleset + false + false + + + app.manifest + + + + ..\packages\MahApps.Metro.1.0.0.0\lib\net45\MahApps.Metro.dll + + + + + + ..\packages\MahApps.Metro.1.0.0.0\lib\net45\System.Windows.Interactivity.dll + + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + Properties\GlobalAssemblyInfo.cs + + + + + MahMetroWindow.xaml + + + + RegularWindow.xaml + + + RibbonWindowWithoutVisibileRibbon.xaml + + + TestContent.xaml + + + + + + + + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + TestWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + {4C92FCF4-3561-499F-BC5B-F2F089863047} + Fluent.Ribbon.NET 4.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/Fluent.Ribbon.Showcase/TestContent.xaml b/Fluent.Ribbon.Showcase/TestContent.xaml index ce10c9cf9..27a8ad5ba 100644 --- a/Fluent.Ribbon.Showcase/TestContent.xaml +++ b/Fluent.Ribbon.Showcase/TestContent.xaml @@ -228,6 +228,26 @@ + + + + + + + + + + + + CONTENT + + + + + + + diff --git a/Fluent.Ribbon.Showcase/packages.config b/Fluent.Ribbon.Showcase/packages.config index 709aba4f6..75752d84b 100644 --- a/Fluent.Ribbon.Showcase/packages.config +++ b/Fluent.Ribbon.Showcase/packages.config @@ -1,4 +1,5 @@ - - - + + + + \ No newline at end of file diff --git a/Fluent.Ribbon/Controls/Backstage.cs b/Fluent.Ribbon/Controls/Backstage.cs index bf33eea59..fc39da264 100644 --- a/Fluent.Ribbon/Controls/Backstage.cs +++ b/Fluent.Ribbon/Controls/Backstage.cs @@ -1,707 +1,710 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Windows; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Interop; -using System.Windows.Markup; -using System.Windows.Media; - -namespace Fluent -{ - using System.Threading; - using System.Threading.Tasks; - using System.Windows.Controls; - using System.Windows.Threading; - using Fluent.Extensions; - using Fluent.Internal; - - /// - /// Represents backstage button - /// - [ContentProperty("Content")] - public class Backstage : RibbonControl - { - private static readonly object syncIsOpen = new object(); - - #region Events - - /// - /// Occurs when IsOpen has been changed - /// - public event DependencyPropertyChangedEventHandler IsOpenChanged; - - #endregion - - #region Fields - - // Adorner for backstage - BackstageAdorner adorner; - - #endregion - - #region Properties - - #region IsOpen - - /// - /// Gets or sets whether backstage is shown - /// - public bool IsOpen - { - get { return (bool)this.GetValue(IsOpenProperty); } - set { this.SetValue(IsOpenProperty, value); } - } - - /// - /// Using a DependencyProperty as the backing store for IsOpen. - /// This enables animation, styling, binding, etc... - /// - public static readonly DependencyProperty IsOpenProperty = - DependencyProperty.Register("IsOpen", typeof(bool), - typeof(Backstage), new UIPropertyMetadata(false, OnIsOpenChanged)); - - /// - /// Gets or sets the duration for the hide animation - /// - public Duration HideAnimationDuration - { - get { return (Duration)this.GetValue(HideAnimationDurationProperty); } - set { this.SetValue(HideAnimationDurationProperty, value); } - } - - /// - /// Using a DependencyProperty as the backing store for HideAnimationDuration. - /// This enables animation, styling, binding, etc... - /// - public static readonly DependencyProperty HideAnimationDurationProperty = DependencyProperty.Register("HideAnimationDuration", typeof(Duration), typeof(Backstage), new PropertyMetadata(null)); - - /// - /// Gets or sets whether context tabs on the titlebar should be hidden when backstage is open - /// - public bool HideContextTabsOnOpen - { - get { return (bool)this.GetValue(HideContextTabsOnOpenProperty); } - set { this.SetValue(HideContextTabsOnOpenProperty, value); } - } - - /// - /// Using a DependencyProperty as the backing store for HideContextTabsOnOpen. - /// This enables animation, styling, binding, etc... - /// - public static readonly DependencyProperty HideContextTabsOnOpenProperty = DependencyProperty.Register("HideContextTabsOnOpen", typeof(bool), typeof(Backstage), new PropertyMetadata(false)); - - /// - /// Gets or sets whether to close the backstage when Esc is pressed - /// - public bool CloseOnEsc - { - get { return (bool)this.GetValue(CloseOnEscProperty); } - set { this.SetValue(CloseOnEscProperty, value); } - } - - /// - /// Using a DependencyProperty as the backing store for CloseOnEsc. - /// This enables animation, styling, binding, etc... - /// - public static readonly DependencyProperty CloseOnEscProperty = DependencyProperty.Register("CloseOnEsc", typeof(bool), typeof(Backstage), new PropertyMetadata(true)); - - private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var backstage = (Backstage)d; - - lock (syncIsOpen) - { - if ((bool)e.NewValue) - { - backstage.Show(); - } - else - { - if (backstage.HideAnimationDuration.HasTimeSpan) - { - var timespan = backstage.HideAnimationDuration.TimeSpan; - - Task.Factory.StartNew(() => - { - Thread.Sleep(timespan); - - backstage.Dispatcher.RunInDispatcher(backstage.Hide); - }); - } - else - { - backstage.Hide(); - } - } - - // Invoke the event - if (backstage.IsOpenChanged != null) - { - backstage.IsOpenChanged(backstage, e); - } - } - } - - #endregion - - #region Content - - /// - /// Gets or sets content of the backstage - /// - public UIElement Content - { - get { return (UIElement)this.GetValue(ContentProperty); } - set { this.SetValue(ContentProperty, value); } - } - - /// - /// Using a DependencyProperty as the backing store for Content. - /// This enables animation, styling, binding, etc... - /// - public static readonly DependencyProperty ContentProperty = - DependencyProperty.Register("Content", typeof(UIElement), typeof(Backstage), - new UIPropertyMetadata(null, OnContentChanged)); - - static void OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var backstage = (Backstage)d; - if (e.OldValue != null) - { - backstage.RemoveLogicalChild(e.OldValue); - } - - if (e.NewValue != null) - { - backstage.AddLogicalChild(e.NewValue); - } - } - - #endregion - - #region LogicalChildren - - /// - /// Gets an enumerator for logical child elements of this element. - /// - protected override IEnumerator LogicalChildren - { - get - { - if (this.Content != null) - { - yield return this.Content; - } - } - } - - #endregion - - #endregion - - #region Initialization - - /// - /// Static constructor - /// - [SuppressMessage("Microsoft.Performance", "CA1810")] - static Backstage() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(Backstage), new FrameworkPropertyMetadata(typeof(Backstage))); - // Disable QAT for this control - CanAddToQuickAccessToolBarProperty.OverrideMetadata(typeof(Backstage), new FrameworkPropertyMetadata(false)); - - KeyboardNavigation.TabNavigationProperty.OverrideMetadata(typeof(Backstage), new FrameworkPropertyMetadata(KeyboardNavigationMode.Cycle)); - } - - /// - /// Default constructor - /// - public Backstage() - { - this.Loaded += this.OnBackstageLoaded; - this.Unloaded += this.OnBackstageUnloaded; - } - - private void OnPopupDismiss(object sender, DismissPopupEventArgs e) - { - this.IsOpen = false; - } - - #endregion - - #region Methods - - // Handles click event - private void Click() - { - this.IsOpen = !this.IsOpen; - } - - #region Show / Hide - - // We have to collapse WindowsFormsHost while Backstate is open - private readonly Dictionary collapsedElements = new Dictionary(); - - // Saved window sizes - private double savedWindowMinWidth = double.NaN; - private double savedWindowMinHeight = double.NaN; - private double savedWindowWidth = double.NaN; - private double savedWindowHeight = double.NaN; - - // Opens backstage on an Adorner layer - private void Show() - { - // don't open the backstage while in design mode - if (DesignerProperties.GetIsInDesignMode(this)) - { - return; - } - - if (this.IsLoaded == false) - { - this.Loaded += this.OnDelayedShow; - return; - } - - if (this.Content == null) - { - return; - } - - this.CreateAndAttachBackstageAdorner(); - - this.ShowAdorner(); - - var ribbon = this.FindRibbon(); - if (ribbon != null) - { - ribbon.TabControl.IsDropDownOpen = false; - ribbon.TabControl.HighlightSelectedItem = false; - ribbon.TabControl.RequestBackstageClose += this.OnTabControlRequestBackstageClose; - - // Disable QAT & title bar - if (ribbon.QuickAccessToolBar != null) - { - ribbon.QuickAccessToolBar.IsEnabled = false; - } - - if (ribbon.TitleBar != null) - { - ribbon.TitleBar.IsEnabled = false; - ribbon.TitleBar.HideContextTabs = this.HideContextTabsOnOpen; - } - } - - var window = Window.GetWindow(this); - - this.SaveWindowSize(window); - this.SaveWindowMinSize(window); - - if (window != null) - { - window.KeyDown += this.HandleWindowKeyDown; - - - if (this.savedWindowMinWidth < 500) - { - window.MinWidth = 500; - } - - if (this.savedWindowMinHeight < 400) - { - window.MinHeight = 400; - } - - window.SizeChanged += this.OnWindowSizeChanged; - - // We have to collapse WindowsFormsHost while Backstage is open - this.CollapseWindowsFormsHosts(window); - } - - var content = this.Content as IInputElement; - if (content != null) - { - content.Focus(); - } - } - - private void ShowAdorner() - { - if (this.adorner == null) - { - return; - } - - this.adorner.Visibility = Visibility.Visible; - } - - private void HideAdorner() - { - if (this.adorner == null) - { - return; - } - - this.adorner.Visibility = Visibility.Collapsed; - } - - private void CreateAndAttachBackstageAdorner() - { - if (this.adorner != null) - { - return; - } - - FrameworkElement topLevelElement = null; - - if (DesignerProperties.GetIsInDesignMode(this)) - { - // TODO: in design mode it is required to use design time adorner - topLevelElement = (FrameworkElement)VisualTreeHelper.GetParent(this); - } - else - { - var mainWindow = Window.GetWindow(this); - if (mainWindow == null) - { - return; - } - - var content = mainWindow.Content; - - var fe = content as FrameworkElement; // Content may be an arbitrary .NET object when set using a databinding and using data templates. - - if (fe != null) - { - topLevelElement = fe; - } - else - { - // If Content is not a FrameworkElement we try to find the ContentPresenter - // containing the template to display the content. - var contentPresenter = UIHelper.FindVisualChild(mainWindow); - - if (contentPresenter != null && contentPresenter.Content == content) - { - // set the root element of the template as the top level element. - topLevelElement = (FrameworkElement)VisualTreeHelper.GetChild(contentPresenter, 0); - } - } - } - - if (topLevelElement == null) - { - return; - } - - this.adorner = new BackstageAdorner(topLevelElement, this); - - var layer = AdornerLayer.GetAdornerLayer(this); - layer.Add(this.adorner); - - layer.CommandBindings.Add(new CommandBinding(RibbonCommands.OpenBackstage, - (sender, args) => - { - this.IsOpen = !this.IsOpen; - })); - } - - - private void DestroyAdorner() - { - if (this.adorner == null) - { - return; - } - - var layer = AdornerLayer.GetAdornerLayer(this); - layer.Remove(this.adorner); - - this.adorner.Clear(); - this.adorner = null; - } - - private void OnDelayedShow(object sender, EventArgs args) - { - this.Loaded -= this.OnDelayedShow; - - // Delaying show so everthing can load properly. - // If we don't run this in the background setting IsOpen=true on application start we don't have access to the Bastage from the BackstageTabControl. - this.RunInDispatcherAsync(this.Show, DispatcherPriority.Background); - } - - // Hide backstage - private void Hide() - { - this.Loaded -= this.OnDelayedShow; - - if (this.Content == null) - { - return; - } - - if (!this.IsLoaded - || this.adorner == null) - { - return; - } - - this.HideAdorner(); - - var ribbon = this.FindRibbon(); - if (ribbon != null) - { - ribbon.TabControl.HighlightSelectedItem = true; - ribbon.TabControl.RequestBackstageClose -= this.OnTabControlRequestBackstageClose; - - // Restore enable under QAT & title bar - if (ribbon.QuickAccessToolBar != null) - { - ribbon.QuickAccessToolBar.IsEnabled = true; - ribbon.QuickAccessToolBar.Refresh(); - } - - if (ribbon.TitleBar != null) - { - ribbon.TitleBar.IsEnabled = true; - ribbon.TitleBar.HideContextTabs = false; - } - } - - var window = Window.GetWindow(this); - if (window != null) - { - window.PreviewKeyDown -= this.HandleWindowKeyDown; - window.SizeChanged -= this.OnWindowSizeChanged; - - if (double.IsNaN(this.savedWindowMinWidth) == false - && double.IsNaN(this.savedWindowMinHeight) == false) - { - window.MinWidth = this.savedWindowMinWidth; - window.MinHeight = this.savedWindowMinHeight; - } - - if (double.IsNaN(this.savedWindowWidth) == false - && double.IsNaN(this.savedWindowHeight) == false) - { - window.Width = this.savedWindowWidth; - window.Height = this.savedWindowHeight; - } - } - - // Uncollapse elements - foreach (var element in this.collapsedElements) - { - element.Key.Visibility = element.Value; - } - - this.collapsedElements.Clear(); - } - - // Finds underlying ribbon control - private Ribbon FindRibbon() - { - DependencyObject item = this; - - while (item != null - && !(item is Ribbon)) - { - item = VisualTreeHelper.GetParent(item); - } - - return (Ribbon)item; - } - - private void SaveWindowMinSize(Window window) - { - if (window == null) - { - this.savedWindowMinWidth = double.NaN; - this.savedWindowMinHeight = double.NaN; - return; - } - - this.savedWindowMinWidth = window.MinWidth; - this.savedWindowMinHeight = window.MinHeight; - } - - private void SaveWindowSize(Window window) - { - if (window == null) - { - this.savedWindowWidth = double.NaN; - this.savedWindowHeight = double.NaN; - return; - } - - this.savedWindowWidth = window.ActualWidth; - this.savedWindowHeight = window.ActualHeight; - } - - private void OnWindowSizeChanged(object sender, SizeChangedEventArgs e) - { - this.SaveWindowSize(Window.GetWindow(this)); - } - - private void OnTabControlRequestBackstageClose(object sender, EventArgs e) - { - this.IsOpen = false; - } - - // We have to collapse WindowsFormsHost while Backstage is open - private void CollapseWindowsFormsHosts(DependencyObject parent) - { - if (parent == null) - { - return; - } - - var frameworkElement = parent as FrameworkElement; - - // Do not hide contents in the backstage area - if (parent is BackstageAdorner) return; - - if (frameworkElement != null) - { - if ((parent is HwndHost) && - frameworkElement.Visibility != Visibility.Collapsed) - { - this.collapsedElements.Add(frameworkElement, frameworkElement.Visibility); - frameworkElement.Visibility = Visibility.Collapsed; - return; - } - } - - // Traverse visual tree - for (var i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++) - { - this.CollapseWindowsFormsHosts(VisualTreeHelper.GetChild(parent, i)); - } - } - - /// - /// Invoked when an unhandled  attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. - /// - /// The that contains the event data. - protected override void OnKeyDown(KeyEventArgs e) - { - if (e.Handled) - { - return; - } - - switch (e.Key) - { - case Key.Enter: - case Key.Space: - if (this.IsFocused) - { - this.IsOpen = !this.IsOpen; - e.Handled = true; - } - break; - } - - base.OnKeyDown(e); - } - - // Handles backstage Esc key keydown - private void HandleWindowKeyDown(object sender, KeyEventArgs e) - { - if (this.CloseOnEsc && e.Key == Key.Escape) - { - // only handle ESC when the backstage is open - e.Handled = this.IsOpen; - - this.IsOpen = false; - } - } - - private void OnBackstageLoaded(object sender, RoutedEventArgs e) - { - this.AddHandler(PopupService.DismissPopupEvent, (DismissPopupEventHandler)this.OnPopupDismiss); - } - - private void OnBackstageUnloaded(object sender, RoutedEventArgs e) - { - this.RemoveHandler(PopupService.DismissPopupEvent, (DismissPopupEventHandler)this.OnPopupDismiss); - } - - #endregion - - #endregion - - #region Overrides - - /// - /// Invoked when an unhandled System.Windows.UIElement.PreviewMouseLeftButtonDown routed event reaches an element - /// in its route that is derived from this class. Implement this method to add class handling for this event. - /// - /// The System.Windows.Input.MouseButtonEventArgs that contains the event data. - /// The event data reports that the left mouse button was pressed. - protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) - { - this.Click(); - } - - /// - /// Handles key tip pressed - /// - public override void OnKeyTipPressed() - { - this.IsOpen = true; - base.OnKeyTipPressed(); - } - - /// - /// Handles back navigation with KeyTips - /// - public override void OnKeyTipBack() - { - this.IsOpen = false; - base.OnKeyTipBack(); - } - - /// - /// When overridden in a derived class, is invoked whenever application code or internal processes call . - /// - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - if (this.IsOpen) - { - this.Hide(); - } - - this.DestroyAdorner(); - - if (this.IsOpen) - { - this.Show(); - } - } - - #endregion - - #region Quick Access Toolbar - - /// - /// Gets control which represents shortcut item. - /// This item MUST be syncronized with the original - /// and send command to original one control. - /// - /// Control which represents shortcut item - public override FrameworkElement CreateQuickAccessItem() - { - throw new NotImplementedException(); - } - - #endregion - } +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; +using System.Windows; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Interop; +using System.Windows.Markup; +using System.Windows.Media; + +namespace Fluent +{ + using System.Threading; + using System.Threading.Tasks; + using System.Windows.Controls; + using System.Windows.Threading; + using Fluent.Extensions; + using Fluent.Internal; + + /// + /// Represents backstage button + /// + [ContentProperty( "Content" )] + public class Backstage : RibbonControl + { + private static readonly object syncIsOpen = new object(); + + #region Events + + /// + /// Occurs when IsOpen has been changed + /// + public event DependencyPropertyChangedEventHandler IsOpenChanged; + + #endregion + + #region Fields + + // Adorner for backstage + BackstageAdorner adorner; + + #endregion + + #region Properties + + #region IsOpen + + /// + /// Gets or sets whether backstage is shown + /// + public bool IsOpen + { + get { return (bool)this.GetValue( IsOpenProperty ); } + set { this.SetValue( IsOpenProperty, value ); } + } + + /// + /// Using a DependencyProperty as the backing store for IsOpen. + /// This enables animation, styling, binding, etc... + /// + public static readonly DependencyProperty IsOpenProperty = + DependencyProperty.Register( "IsOpen", typeof( bool ), + typeof( Backstage ), new UIPropertyMetadata( false, OnIsOpenChanged ) ); + + /// + /// Gets or sets the duration for the hide animation + /// + public Duration HideAnimationDuration + { + get { return (Duration)this.GetValue( HideAnimationDurationProperty ); } + set { this.SetValue( HideAnimationDurationProperty, value ); } + } + + /// + /// Using a DependencyProperty as the backing store for HideAnimationDuration. + /// This enables animation, styling, binding, etc... + /// + public static readonly DependencyProperty HideAnimationDurationProperty = DependencyProperty.Register( "HideAnimationDuration", typeof( Duration ), typeof( Backstage ), new PropertyMetadata( null ) ); + + /// + /// Gets or sets whether context tabs on the titlebar should be hidden when backstage is open + /// + public bool HideContextTabsOnOpen + { + get { return (bool)this.GetValue( HideContextTabsOnOpenProperty ); } + set { this.SetValue( HideContextTabsOnOpenProperty, value ); } + } + + /// + /// Using a DependencyProperty as the backing store for HideContextTabsOnOpen. + /// This enables animation, styling, binding, etc... + /// + public static readonly DependencyProperty HideContextTabsOnOpenProperty = DependencyProperty.Register( "HideContextTabsOnOpen", typeof( bool ), typeof( Backstage ), new PropertyMetadata( false ) ); + + /// + /// Gets or sets whether to close the backstage when Esc is pressed + /// + public bool CloseOnEsc + { + get { return (bool)this.GetValue( CloseOnEscProperty ); } + set { this.SetValue( CloseOnEscProperty, value ); } + } + + /// + /// Using a DependencyProperty as the backing store for CloseOnEsc. + /// This enables animation, styling, binding, etc... + /// + public static readonly DependencyProperty CloseOnEscProperty = DependencyProperty.Register( "CloseOnEsc", typeof( bool ), typeof( Backstage ), new PropertyMetadata( true ) ); + + private static void OnIsOpenChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) + { + var backstage = (Backstage)d; + + lock( syncIsOpen ) + { + if( (bool)e.NewValue ) + { + backstage.Show(); + } + else + { + if( backstage.HideAnimationDuration.HasTimeSpan ) + { + var timespan = backstage.HideAnimationDuration.TimeSpan; + + Task.Factory.StartNew( () => + { + Thread.Sleep( timespan ); + + backstage.Dispatcher.RunInDispatcher( backstage.Hide ); + } ); + } + else + { + backstage.Hide(); + } + } + + // Invoke the event + if( backstage.IsOpenChanged != null ) + { + backstage.IsOpenChanged( backstage, e ); + } + } + } + + #endregion + + #region Content + + /// + /// Gets or sets content of the backstage + /// + public UIElement Content + { + get { return (UIElement)this.GetValue( ContentProperty ); } + set { this.SetValue( ContentProperty, value ); } + } + + /// + /// Using a DependencyProperty as the backing store for Content. + /// This enables animation, styling, binding, etc... + /// + public static readonly DependencyProperty ContentProperty = + DependencyProperty.Register( "Content", typeof( UIElement ), typeof( Backstage ), + new UIPropertyMetadata( null, OnContentChanged ) ); + + static void OnContentChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) + { + var backstage = (Backstage)d; + if( e.OldValue != null ) + { + backstage.RemoveLogicalChild( e.OldValue ); + } + + if( e.NewValue != null ) + { + backstage.AddLogicalChild( e.NewValue ); + } + } + + #endregion + + #region LogicalChildren + + /// + /// Gets an enumerator for logical child elements of this element. + /// + protected override IEnumerator LogicalChildren + { + get + { + if( this.Content != null ) + { + yield return this.Content; + } + } + } + + #endregion + + #endregion + + #region Initialization + + /// + /// Static constructor + /// + [SuppressMessage( "Microsoft.Performance", "CA1810" )] + static Backstage() + { + DefaultStyleKeyProperty.OverrideMetadata( typeof( Backstage ), new FrameworkPropertyMetadata( typeof( Backstage ) ) ); + // Disable QAT for this control + CanAddToQuickAccessToolBarProperty.OverrideMetadata( typeof( Backstage ), new FrameworkPropertyMetadata( false ) ); + + KeyboardNavigation.TabNavigationProperty.OverrideMetadata( typeof( Backstage ), new FrameworkPropertyMetadata( KeyboardNavigationMode.Cycle ) ); + } + + /// + /// Default constructor + /// + public Backstage() + { + this.Loaded += this.OnBackstageLoaded; + this.Unloaded += this.OnBackstageUnloaded; + } + + private void OnPopupDismiss( object sender, DismissPopupEventArgs e ) + { + this.IsOpen = false; + } + + #endregion + + #region Methods + + // Handles click event + private void Click() + { + this.IsOpen = !this.IsOpen; + } + + #region Show / Hide + + // We have to collapse WindowsFormsHost while Backstate is open + private readonly Dictionary collapsedElements = new Dictionary(); + + // Saved window sizes + private double savedWindowMinWidth = double.NaN; + private double savedWindowMinHeight = double.NaN; + private double savedWindowWidth = double.NaN; + private double savedWindowHeight = double.NaN; + + // Opens backstage on an Adorner layer + protected virtual bool Show() + { + // don't open the backstage while in design mode + if( DesignerProperties.GetIsInDesignMode( this ) ) + { + return false; + } + + if( this.IsLoaded == false ) + { + this.Loaded += this.OnDelayedShow; + return false; + } + + if( this.Content == null ) + { + return false; + } + + this.CreateAndAttachBackstageAdorner(); + + this.ShowAdorner(); + + var ribbon = this.FindRibbon(); + if( ribbon != null ) + { + ribbon.TabControl.IsDropDownOpen = false; + ribbon.TabControl.HighlightSelectedItem = false; + ribbon.TabControl.RequestBackstageClose += this.OnTabControlRequestBackstageClose; + + // Disable QAT & title bar + if( ribbon.QuickAccessToolBar != null ) + { + ribbon.QuickAccessToolBar.IsEnabled = false; + } + + if( ribbon.TitleBar != null ) + { + ribbon.TitleBar.IsEnabled = false; + ribbon.TitleBar.HideContextTabs = this.HideContextTabsOnOpen; + } + } + + var window = Window.GetWindow( this ); + + this.SaveWindowSize( window ); + this.SaveWindowMinSize( window ); + + if( window != null ) + { + window.KeyDown += this.HandleWindowKeyDown; + + + if( this.savedWindowMinWidth < 500 ) + { + window.MinWidth = 500; + } + + if( this.savedWindowMinHeight < 400 ) + { + window.MinHeight = 400; + } + + window.SizeChanged += this.OnWindowSizeChanged; + + // We have to collapse WindowsFormsHost while Backstage is open + this.CollapseWindowsFormsHosts( window ); + } + + var content = this.Content as IInputElement; + if( content != null ) + { + content.Focus(); + } + + return true; + } + + private void ShowAdorner() + { + if( this.adorner == null ) + { + return; + } + + this.adorner.Visibility = Visibility.Visible; + } + + private void HideAdorner() + { + if( this.adorner == null ) + { + return; + } + + this.adorner.Visibility = Visibility.Collapsed; + } + + private void CreateAndAttachBackstageAdorner() + { + if( this.adorner != null ) + { + return; + } + + FrameworkElement topLevelElement = null; + + if( DesignerProperties.GetIsInDesignMode( this ) ) + { + // TODO: in design mode it is required to use design time adorner + topLevelElement = (FrameworkElement)VisualTreeHelper.GetParent( this ); + } + else + { + var mainWindow = Window.GetWindow( this ); + if( mainWindow == null ) + { + return; + } + + var content = mainWindow.Content; + + var fe = content as FrameworkElement; // Content may be an arbitrary .NET object when set using a databinding and using data templates. + + if( fe != null ) + { + topLevelElement = fe; + } + else + { + // If Content is not a FrameworkElement we try to find the ContentPresenter + // containing the template to display the content. + var contentPresenter = UIHelper.FindVisualChild( mainWindow ); + + if( contentPresenter != null && contentPresenter.Content == content ) + { + // set the root element of the template as the top level element. + topLevelElement = (FrameworkElement)VisualTreeHelper.GetChild( contentPresenter, 0 ); + } + } + } + + if( topLevelElement == null ) + { + return; + } + + this.adorner = new BackstageAdorner( topLevelElement, this ); + + var layer = AdornerLayer.GetAdornerLayer( this ); + layer.Add( this.adorner ); + + layer.CommandBindings.Add( new CommandBinding( RibbonCommands.OpenBackstage, + ( sender, args ) => + { + var target = ( (BackstageAdorner)args.Source ).Backstage; + target.IsOpen = !target.IsOpen; + } ) ); + } + + + private void DestroyAdorner() + { + if( this.adorner == null ) + { + return; + } + + var layer = AdornerLayer.GetAdornerLayer( this ); + layer.Remove( this.adorner ); + + this.adorner.Clear(); + this.adorner = null; + } + + private void OnDelayedShow( object sender, EventArgs args ) + { + this.Loaded -= this.OnDelayedShow; + + // Delaying show so everthing can load properly. + // If we don't run this in the background setting IsOpen=true on application start we don't have access to the Bastage from the BackstageTabControl. + this.RunInDispatcherAsync( new Action( () => this.Show() ), DispatcherPriority.Background ); + } + + // Hide backstage + private void Hide() + { + this.Loaded -= this.OnDelayedShow; + + if( this.Content == null ) + { + return; + } + + if( !this.IsLoaded + || this.adorner == null ) + { + return; + } + + this.HideAdorner(); + + var ribbon = this.FindRibbon(); + if( ribbon != null ) + { + ribbon.TabControl.HighlightSelectedItem = true; + ribbon.TabControl.RequestBackstageClose -= this.OnTabControlRequestBackstageClose; + + // Restore enable under QAT & title bar + if( ribbon.QuickAccessToolBar != null ) + { + ribbon.QuickAccessToolBar.IsEnabled = true; + ribbon.QuickAccessToolBar.Refresh(); + } + + if( ribbon.TitleBar != null ) + { + ribbon.TitleBar.IsEnabled = true; + ribbon.TitleBar.HideContextTabs = false; + } + } + + var window = Window.GetWindow( this ); + if( window != null ) + { + window.PreviewKeyDown -= this.HandleWindowKeyDown; + window.SizeChanged -= this.OnWindowSizeChanged; + + if( double.IsNaN( this.savedWindowMinWidth ) == false + && double.IsNaN( this.savedWindowMinHeight ) == false ) + { + window.MinWidth = this.savedWindowMinWidth; + window.MinHeight = this.savedWindowMinHeight; + } + + if( double.IsNaN( this.savedWindowWidth ) == false + && double.IsNaN( this.savedWindowHeight ) == false ) + { + window.Width = this.savedWindowWidth; + window.Height = this.savedWindowHeight; + } + } + + // Uncollapse elements + foreach( var element in this.collapsedElements ) + { + element.Key.Visibility = element.Value; + } + + this.collapsedElements.Clear(); + } + + // Finds underlying ribbon control + private Ribbon FindRibbon() + { + DependencyObject item = this; + + while( item != null + && !( item is Ribbon ) ) + { + item = VisualTreeHelper.GetParent( item ); + } + + return (Ribbon)item; + } + + private void SaveWindowMinSize( Window window ) + { + if( window == null ) + { + this.savedWindowMinWidth = double.NaN; + this.savedWindowMinHeight = double.NaN; + return; + } + + this.savedWindowMinWidth = window.MinWidth; + this.savedWindowMinHeight = window.MinHeight; + } + + private void SaveWindowSize( Window window ) + { + if( window == null ) + { + this.savedWindowWidth = double.NaN; + this.savedWindowHeight = double.NaN; + return; + } + + this.savedWindowWidth = window.ActualWidth; + this.savedWindowHeight = window.ActualHeight; + } + + private void OnWindowSizeChanged( object sender, SizeChangedEventArgs e ) + { + this.SaveWindowSize( Window.GetWindow( this ) ); + } + + private void OnTabControlRequestBackstageClose( object sender, EventArgs e ) + { + this.IsOpen = false; + } + + // We have to collapse WindowsFormsHost while Backstage is open + private void CollapseWindowsFormsHosts( DependencyObject parent ) + { + if( parent == null ) + { + return; + } + + var frameworkElement = parent as FrameworkElement; + + // Do not hide contents in the backstage area + if( parent is BackstageAdorner ) return; + + if( frameworkElement != null ) + { + if( ( parent is HwndHost ) && + frameworkElement.Visibility != Visibility.Collapsed ) + { + this.collapsedElements.Add( frameworkElement, frameworkElement.Visibility ); + frameworkElement.Visibility = Visibility.Collapsed; + return; + } + } + + // Traverse visual tree + for( var i = 0; i < VisualTreeHelper.GetChildrenCount( parent ); i++ ) + { + this.CollapseWindowsFormsHosts( VisualTreeHelper.GetChild( parent, i ) ); + } + } + + /// + /// Invoked when an unhandled  attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event. + /// + /// The that contains the event data. + protected override void OnKeyDown( KeyEventArgs e ) + { + if( e.Handled ) + { + return; + } + + switch( e.Key ) + { + case Key.Enter: + case Key.Space: + if( this.IsFocused ) + { + this.IsOpen = !this.IsOpen; + e.Handled = true; + } + break; + } + + base.OnKeyDown( e ); + } + + // Handles backstage Esc key keydown + private void HandleWindowKeyDown( object sender, KeyEventArgs e ) + { + if( this.CloseOnEsc && e.Key == Key.Escape ) + { + // only handle ESC when the backstage is open + e.Handled = this.IsOpen; + + this.IsOpen = false; + } + } + + private void OnBackstageLoaded( object sender, RoutedEventArgs e ) + { + this.AddHandler( PopupService.DismissPopupEvent, (DismissPopupEventHandler)this.OnPopupDismiss ); + } + + private void OnBackstageUnloaded( object sender, RoutedEventArgs e ) + { + this.RemoveHandler( PopupService.DismissPopupEvent, (DismissPopupEventHandler)this.OnPopupDismiss ); + } + + #endregion + + #endregion + + #region Overrides + + /// + /// Invoked when an unhandled System.Windows.UIElement.PreviewMouseLeftButtonDown routed event reaches an element + /// in its route that is derived from this class. Implement this method to add class handling for this event. + /// + /// The System.Windows.Input.MouseButtonEventArgs that contains the event data. + /// The event data reports that the left mouse button was pressed. + protected override void OnMouseLeftButtonDown( MouseButtonEventArgs e ) + { + this.Click(); + } + + /// + /// Handles key tip pressed + /// + public override void OnKeyTipPressed() + { + this.IsOpen = true; + base.OnKeyTipPressed(); + } + + /// + /// Handles back navigation with KeyTips + /// + public override void OnKeyTipBack() + { + this.IsOpen = false; + base.OnKeyTipBack(); + } + + /// + /// When overridden in a derived class, is invoked whenever application code or internal processes call . + /// + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + if( this.IsOpen ) + { + this.Hide(); + } + + this.DestroyAdorner(); + + if( this.IsOpen ) + { + this.Show(); + } + } + + #endregion + + #region Quick Access Toolbar + + /// + /// Gets control which represents shortcut item. + /// This item MUST be syncronized with the original + /// and send command to original one control. + /// + /// Control which represents shortcut item + public override FrameworkElement CreateQuickAccessItem() + { + throw new NotImplementedException(); + } + + #endregion + } } \ No newline at end of file diff --git a/Fluent.Ribbon/Controls/BackstageAdorner.cs b/Fluent.Ribbon/Controls/BackstageAdorner.cs index 0feef5814..fd6a6759f 100644 --- a/Fluent.Ribbon/Controls/BackstageAdorner.cs +++ b/Fluent.Ribbon/Controls/BackstageAdorner.cs @@ -12,10 +12,10 @@ namespace Fluent internal class BackstageAdorner : Adorner { // Backstage - private readonly Backstage backstage; + public readonly Backstage Backstage; // Content of Backstage - private readonly UIElement backstageContent; + public readonly UIElement BackstageContent; // Collection of visual children private readonly VisualCollection visualChildren; @@ -30,12 +30,12 @@ public BackstageAdorner(FrameworkElement adornedElement, Backstage backstage) { KeyboardNavigation.SetTabNavigation(this, KeyboardNavigationMode.Cycle); - this.backstage = backstage; - this.backstageContent = this.backstage.Content; + this.Backstage = backstage; + this.BackstageContent = this.Backstage.Content; this.visualChildren = new VisualCollection(this) { - this.backstageContent + this.BackstageContent }; // TODO: fix it! (below ugly workaround) in measureoverride we cannot get RenderSize, we must use DesiredSize @@ -79,7 +79,7 @@ public void Clear() /// The actual size used protected override Size ArrangeOverride(Size finalSize) { - this.backstageContent.Arrange(new Rect(0, 0, finalSize.Width, Math.Max(0, finalSize.Height))); + this.BackstageContent.Arrange(new Rect(0, 0, finalSize.Width, Math.Max(0, finalSize.Height))); return finalSize; } @@ -93,7 +93,7 @@ protected override Size ArrangeOverride(Size finalSize) protected override Size MeasureOverride(Size constraint) { // TODO: fix it! (below ugly workaround) in measureoverride we cannot get RenderSize, we must use DesiredSize - this.backstageContent.Measure(new Size(this.AdornedElement.RenderSize.Width, Math.Max(0, this.AdornedElement.RenderSize.Height))); + this.BackstageContent.Measure(new Size(this.AdornedElement.RenderSize.Width, Math.Max(0, this.AdornedElement.RenderSize.Height))); return this.AdornedElement.RenderSize; } diff --git a/Fluent.Ribbon/Controls/Frontstage.cs b/Fluent.Ribbon/Controls/Frontstage.cs new file mode 100644 index 000000000..864d6d492 --- /dev/null +++ b/Fluent.Ribbon/Controls/Frontstage.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using Fluent; + +namespace Fluent +{ + public class Frontstage : Backstage + { + #region Shown + public bool Shown + { + get { return (bool)GetValue( ShownProperty ); } + set { SetValue( ShownProperty, value ); } + } + + public static readonly DependencyProperty ShownProperty = + DependencyProperty.Register( "Shown", typeof( bool ), typeof( Frontstage ), new PropertyMetadata( false ) ); + #endregion + + protected override bool Show() + { + if( this.Shown ) return false; + return this.Shown = base.Show(); + } + } +} diff --git a/Fluent.Ribbon/Controls/FrontstageTabControl.cs b/Fluent.Ribbon/Controls/FrontstageTabControl.cs new file mode 100644 index 000000000..f73235e3a --- /dev/null +++ b/Fluent.Ribbon/Controls/FrontstageTabControl.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; + +namespace Fluent +{ + public class FrontstageTabControl : BackstageTabControl + { + #region LeftContent + public object LeftContent + { + get { return (object)GetValue( LeftContentProperty ); } + set { SetValue( LeftContentProperty, value ); } + } + + public static readonly DependencyProperty LeftContentProperty = + DependencyProperty.Register( "LeftContent", typeof( object ), typeof( FrontstageTabControl ) ); + #endregion + + #region RightContent + public object RightContent + { + get { return (object)GetValue( RightContentProperty ); } + set { SetValue( RightContentProperty, value ); } + } + + public static readonly DependencyProperty RightContentProperty = + DependencyProperty.Register( "RightContent", typeof( object ), typeof( FrontstageTabControl ) ); + + #endregion + + public FrontstageTabControl() + { + this.Loaded += FrontStage_Loaded; + } + + void FrontStage_Loaded( object sender, RoutedEventArgs e ) + { + var template = Application.Current. + FindResource( "FrontstageControlTemplate" ) as ControlTemplate; + + if( template != null ) + this.Template = template; + } + } +} diff --git a/Fluent.Ribbon/Fluent.Ribbon.NET 4.5.csproj b/Fluent.Ribbon/Fluent.Ribbon.NET 4.5.csproj index c941e47b5..fd4d2b380 100644 --- a/Fluent.Ribbon/Fluent.Ribbon.NET 4.5.csproj +++ b/Fluent.Ribbon/Fluent.Ribbon.NET 4.5.csproj @@ -1,774 +1,784 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4C92FCF4-3561-499F-BC5B-F2F089863047} - Library - Properties - Fluent - Fluent - v4.5 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - true - Properties\FluentStrongName.snk - true - 4.0.20621.0 - ..\build\obj\NET 4.5 - $(BaseIntermediateOutputPath)\$(Configuration)\ - - - true - full - false - ..\build\bin\NET 4.5\Debug\ - TRACE;DEBUG;CODE_ANALYSIS;NET45 - prompt - 4 - - - false - - - MinimumRecommendedRules.ruleset - false - - - pdbonly - true - ..\build\bin\NET 4.5\Release\ - TRACE;CODE_ANALYSIS;NET45 - prompt - 4 - bin\NET 4.5\Release\Fluent.XML - true - - - MinimumRecommendedRules.ruleset - true - false - - - - ..\packages\ControlzEx.2.0.0-dev9\lib\net45\ControlzEx.dll - True - - - - - - - ..\packages\ControlzEx.2.0.0-dev9\lib\net45\System.Windows.Interactivity.dll - True - - - - - - - - Properties\GlobalAssemblyInfo.cs - - - - - - - - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {4C92FCF4-3561-499F-BC5B-F2F089863047} + Library + Properties + Fluent + Fluent + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + true + Properties\FluentStrongName.snk + true + 4.0.20621.0 + ..\build\obj\NET 4.5 + $(BaseIntermediateOutputPath)\$(Configuration)\ + 2eafe537 + + + true + full + false + ..\build\bin\NET 4.5\Debug\ + TRACE;DEBUG;CODE_ANALYSIS;NET45 + prompt + 4 + + + false + + + MinimumRecommendedRules.ruleset + false + + + pdbonly + true + ..\build\bin\NET 4.5\Release\ + TRACE;CODE_ANALYSIS;NET45 + prompt + 4 + bin\NET 4.5\Release\Fluent.XML + true + + + MinimumRecommendedRules.ruleset + true + false + + + + ..\packages\ControlzEx.2.0.0-dev9\lib\net45\ControlzEx.dll + True + + + + + + + ..\packages\ControlzEx.2.0.0-dev9\lib\net45\System.Windows.Interactivity.dll + True + + + + + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + + + + Code + + + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SET tmpError=0 "$(ProjectDir)Themes\XamlCombine.exe" Office2010\Generic.txt Office2010\Generic.xaml SET tmpError=%25tmpError%25 + %25ERRORLEVEL%25 @@ -776,6 +786,12 @@ SET tmpError=%25tmpError%25 + %25ERRORLEVEL%25 SET tmpError=%25tmpError%25 + %25ERRORLEVEL%25 "$(ProjectDir)Themes\XamlCombine.exe" Windows8\Generic.txt Windows8\Generic.xaml SET /a tmpError=%25tmpError%25 + %25ERRORLEVEL%25 -SET ERRORLEVEL=%25tmpError%25 - +SET ERRORLEVEL=%25tmpError%25 + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/Fluent.Ribbon/Themes/Office2013/Controls/FrontstageTabControl.xaml b/Fluent.Ribbon/Themes/Office2013/Controls/FrontstageTabControl.xaml new file mode 100644 index 000000000..f8ec9070f --- /dev/null +++ b/Fluent.Ribbon/Themes/Office2013/Controls/FrontstageTabControl.xaml @@ -0,0 +1,104 @@ + + + + + + --> + \ No newline at end of file diff --git a/Fluent.Ribbon/Themes/Office2013/Generic.txt b/Fluent.Ribbon/Themes/Office2013/Generic.txt index 300159c34..a7be3468a 100644 --- a/Fluent.Ribbon/Themes/Office2013/Generic.txt +++ b/Fluent.Ribbon/Themes/Office2013/Generic.txt @@ -5,6 +5,7 @@ Generic\Controls\EmptyFocusStyle.xaml Office2010\Controls\ApplicationMenuItem.xaml Office2013\Controls\ApplicationMenu.xaml Office2013\Controls\Backstage.xaml +Office2013\Controls\FrontstageTabControl.xaml Office2013\Controls\RibbonTabItem.xaml Office2013\Controls\RibbonTabControl.xaml Office2013\Controls\RibbonGroupBox.xaml diff --git a/Fluent.Ribbon/packages.config b/Fluent.Ribbon/packages.config index 588c62d0f..6173b5bd4 100644 --- a/Fluent.Ribbon/packages.config +++ b/Fluent.Ribbon/packages.config @@ -1,4 +1,5 @@ - - - + + + + \ No newline at end of file