Class RibbonWindow
Represents a RibbonWindow control.
Inheritance
Namespace: Syncfusion.Windows.Tools.Controls
Assembly: Syncfusion.Tools.Wpf.dll
Syntax
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
[SkinType]
public class RibbonWindow : Window
Remarks
RibbonWindow class represents main Ribbon UI element - Window control.
Examples
This example shows how to create a RibbonWindow in XAML.
<ribbon:RibbonWindow x:Class="RibbonSample.Window1" x:Name="RibbonWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
xmlns:shared="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.WPF"
xmlns:sample="clr-namespace:RibbonSample"
Title="Ribbon" Width="800" Height="600"/>
This example shows how to create a RibbonWindow in C#.
using System;
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace CSharp
{
public partial class CodeOnlyWindow : RibbonWindow
{
public CodeOnlyWindow()
{
this.Title = "Main Window in Code Only";
this.Width = 300;
this.Height = 300;
}
}
}
Constructors
RibbonWindow()
Initializes a new instance of the RibbonWindow class.
Declaration
public RibbonWindow()
Fields
AutoPersistProperty
Identifies the AutoPersist dependency property.
Declaration
public static readonly DependencyProperty AutoPersistProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
BackStageColorProperty
Identifies the BackStageColor dependency property.
Declaration
public static readonly DependencyProperty BackStageColorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the BackStageColor dependency property.
BackStageCornerImageVisibilityProperty
Identifies the BackStageCornerImageVisibility dependency property.
Declaration
public static readonly DependencyProperty BackStageCornerImageVisibilityProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the BackStageCornerImageVisibility dependency property.
BackStageProperty
Identifies the BackStage dependency property.
Declaration
public static readonly DependencyProperty BackStageProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the BackStage dependency property.
HeaderItemsProperty
Declaration
public static readonly DependencyProperty HeaderItemsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
HeaderItemsSourceProperty
Declaration
public static readonly DependencyProperty HeaderItemsSourceProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
HeaderItemTemplateProperty
Declaration
public static readonly DependencyProperty HeaderItemTemplateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
HeaderItemTemplateSelectorProperty
Declaration
public static readonly DependencyProperty HeaderItemTemplateSelectorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsGlassActiveProperty
Defines whether Glass effects are active. This is a dependency property.
Declaration
public static readonly DependencyProperty IsGlassActiveProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MaximizedModeProperty
Gets or Sets appearance style of maximized RibbonWindow. This property have to be used only with OS Version minor then 6(Vista OS). This is a dependency property.
Declaration
public static readonly DependencyProperty MaximizedModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
MinimumResizeValueProperty
Identifies the MinimumResizeValue dependency property.
Declaration
public static readonly DependencyProperty MinimumResizeValueProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the MinimumResizeValue dependency property.
Office2010IconProperty
Gets or Sets the Office 2010 window Icon. It is a dependency property.
Declaration
public static readonly DependencyProperty Office2010IconProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
RibbonStatusBarStyleProperty
Identifies the RibbonStatusBarStyle dependency property.
Declaration
public static readonly DependencyProperty RibbonStatusBarStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the RibbonStatusBarStyle dependency property.
ScaleXProperty
Identifies the ScaleX dependency property.
Declaration
public static readonly DependencyProperty ScaleXProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the ScaleX dependency property.
ScaleYProperty
Identifies the ScaleY dependency property.
Declaration
public static readonly DependencyProperty ScaleYProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the ScaleY dependency property.
ShowHelpButtonProperty
Identifies the ShowHelpButton dependency property.
Declaration
public static readonly DependencyProperty ShowHelpButtonProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the ShowHelpButton dependency property.
StatusBarProperty
Gets or sets the StatusBar control of the window. This is a dependency property.
Declaration
public static readonly DependencyProperty StatusBarProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
TitleBarPatternImageProperty
Identifies the TitleBarPatternImage dependency property.
Declaration
public static readonly DependencyProperty TitleBarPatternImageProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the TitleBarPatternImage dependency property.
TitleTextAlignmentProperty
Defines alignment of the Title Text.
Declaration
public static readonly DependencyProperty TitleTextAlignmentProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
WindowTitleVisualStyle
Used to store Last applied VisualStyle for Custom Color implementation.
Declaration
public string WindowTitleVisualStyle
Field Value
Type |
---|
System.String |
Properties
AutoPersist
Gets or sets a value indicating whether [save original state].
Declaration
public bool AutoPersist { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
BackStage
Gets or sets the back stage.
Declaration
public Backstage BackStage { get; set; }
Property Value
Type | Description |
---|---|
Backstage | The back stage. |
BackStageColor
Gets or sets the Backstage color
Declaration
public Brush BackStageColor { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
BackStageCornerImageVisibility
Gets or sets Backstage corner image visibility.
Declaration
public Visibility BackStageCornerImageVisibility { get; set; }
Property Value
Type |
---|
System.Windows.Visibility |
HeaderItems
Gets or sets the collection of header items displayed at right side of the title bar in the RibbonWindow
Declaration
public ObservableCollection<object> HeaderItems { get; set; }
Property Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<System.Object> |
Examples
<syncfusion:RibbonWindow
xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="ApplicationMenu.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:listCollection="clr-namespace:System.Collections;assembly=mscorlib"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ApplicationMenu"
mc:Ignorable="d" syncfusion:SkinStorage.VisualStyle="Metro"
Title="Window2" Height="450" Width="800">
<syncfusion:RibbonWindow.HeaderItems>
<TextBox Text="text"/>
</syncfusion:RibbonWindow.HeaderItems>
</syncfusion:RibbonWindow>
HeaderItemsSource
Gets or sets the collection of objects that provide information to generate and initialize header items to be displayed at right side of the title bar in the RibbonWindow
Declaration
public IEnumerable HeaderItemsSource { get; set; }
Property Value
Type |
---|
System.Collections.IEnumerable |
Remarks
Objects stored in the HeaderItemsSource populate the HeaderItems collection. To visualize these objects, use the HeaderItemTemplate property. The HeaderItemsSource property supports the MVVM architectural pattern.
Examples
<syncfusion:RibbonWindow
xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="ApplicationMenu.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:listCollection="clr-namespace:System.Collections;assembly=mscorlib"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ApplicationMenu"
mc:Ignorable="d" syncfusion:SkinStorage.VisualStyle="Metro"
Title="Window2" Height="450" Width="800">
<syncfusion:RibbonWindow.HeaderItemsSource>
<listCollection:ArrayList>
<sys:String>code_1</sys:String>
<sys:String>code_2</sys:String>
</listCollection:ArrayList>
</syncfusion:RibbonWindow.HeaderItemsSource>
</syncfusion:RibbonWindow>
HeaderItemTemplate
Gets or sets the data template applied to the header items when HeaderItemsSource is set in RibbonWindow
Declaration
public DataTemplate HeaderItemTemplate { get; set; }
Property Value
Type |
---|
System.Windows.DataTemplate |
Examples
<syncfusion:RibbonWindow xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="ApplicationMenu.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:listCollection="clr-namespace:System.Collections;assembly=mscorlib"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ApplicationMenu"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d" syncfusion:SkinStorage.VisualStyle="Metro"
Title="Window2" Height="450" Width="800">
<syncfusion:RibbonWindow.HeaderItemTemplate>
<DataTemplate>
<Grid>
<Border Margin = "1" Background="Blue">
<TextBlock Foreground = "Yellow" Text="{Binding}" />
</Border>
</Grid>
</DataTemplate>
</syncfusion:RibbonWindow.HeaderItemTemplate>
<syncfusion:RibbonWindow.HeaderItemsSource>
<listCollection:ArrayList>
<sys:String>code_1</sys:String>
<sys:String>code_2</sys:String>
</listCollection:ArrayList>
</syncfusion:RibbonWindow.HeaderItemsSource>
</syncfusion:RibbonWindow>
HeaderItemTemplateSelector
Gets or sets the object that chooses the current RibbonWindow header item template based on custom logic.
Declaration
public DataTemplateSelector HeaderItemTemplateSelector { get; set; }
Property Value
Type |
---|
System.Windows.Controls.DataTemplateSelector |
Examples
<syncfusion:RibbonWindow xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="ApplicationMenu.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:listCollection="clr-namespace:System.Collections;assembly=mscorlib"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ApplicationMenu"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d" syncfusion:SkinStorage.VisualStyle="Metro"
Title="Window2" Height="450" Width="800">
<syncfusion:RibbonWindow.Resources>
<DataTemplate x:Key="BlueBorderTemplate" >
<Border Margin="1" Background="Blue">
<TextBlock Margin="5" Foreground="Yellow" Text="{Binding}" />
</Border>
</DataTemplate>
<DataTemplate x:Key="OrangeBorderTemplate">
<Border Margin="1" Background="Orange">
<TextBlock Margin="5" Foreground="Green" Text="{Binding}" />
</Border>
</DataTemplate>
</syncfusion:RibbonWindow.Resources>
<syncfusion:RibbonWindow.HeaderItemTemplateSelector>
<local:SampleTemplateSelector/>
</syncfusion:RibbonWindow.HeaderItemTemplateSelector>
<syncfusion:RibbonWindow.HeaderItemsSource>
<listCollection:ArrayList>
<sys:String>code_1</sys:String>
<sys:String>code_2</sys:String>
</listCollection:ArrayList>
</syncfusion:RibbonWindow.HeaderItemsSource>
</syncfusion:RibbonWindow>
public class SampleTemplateSelector : DataTemplateSelector
{
public DataTemplate BlueBorderTemplate { get; set; }
public DataTemplate OrangeBorderTemplate { get; set; }
public override DataTemplate SelectTemplate(object item, DependencyObject container)
{
if (item.ToString() == "code_1")
{
return (container as FrameworkElement).TryFindResource("BlueBorderTemplate") as DataTemplate;
}
if (item.ToString() == "code_2")
{
return (container as FrameworkElement).TryFindResource("OrangeBorderTemplate") as DataTemplate;
}
return base.SelectTemplate(item, container);
}
}
IsGlassActive
Gets or sets a value indicating whether this instance is glass active.
Declaration
public bool IsGlassActive { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
MaximizedMode
Gets or sets the maximized mode.
Declaration
public MaximizedMode MaximizedMode { get; set; }
Property Value
Type | Description |
---|---|
MaximizedMode | The maximized mode. |
MinimumResizeValue
Gets or sets the minimum resize value.
Declaration
public double MinimumResizeValue { get; set; }
Property Value
Type |
---|
System.Double |
Office2010Icon
Gets or sets a window's icon.
Declaration
public ImageSource Office2010Icon { get; set; }
Property Value
Type |
---|
System.Windows.Media.ImageSource |
RibbonStatusBarStyle
Gets or sets the ribbon status bar style.
Declaration
public Style RibbonStatusBarStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Style | The ribbon status bar style. |
ScaleX
Gets or sets the value for x-xoordinates of ribbon window
Declaration
public double ScaleX { get; set; }
Property Value
Type |
---|
System.Double |
ScaleY
Gets or sets the value for y-xoordinates of ribbon window
Declaration
public double ScaleY { get; set; }
Property Value
Type |
---|
System.Double |
ShowHelpButton
Gets or sets value checks show help button.
Declaration
public bool ShowHelpButton { get; set; }
Property Value
Type |
---|
System.Boolean |
StatusBar
Gets or sets the RibbonStatusBar control of the RibbonWindow.
Declaration
public RibbonStatusBar StatusBar { get; set; }
Property Value
Type |
---|
RibbonStatusBar |
Remarks
Type: RibbonStatusBar Instance of RibbonStatusBar control used in window.
Examples
This example shows how to create a RibbonStatusBar in XAML.
<ribbon:RibbonWindow x:Class="RibbonSample.Window1" x:Name="RibbonWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
xmlns:shared="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.WPF"
xmlns:sample="clr-namespace:RibbonSample"
Title="Ribbon" Width="800" Height="600">
<ribbon:RibbonWindow.StatusBar>
<ribbon:RibbonStatusBar x:Name="status"/>
</ribbon:RibbonWindow.StatusBar>
This example shows how to create a TitleBar in C#.
using System;
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace CSharp
{
public partial class CodeOnlyWindow : RibbonWindow
{
public CodeOnlyWindow()
{
RibbonStatusBar status = new RibbonStatusBar();
this.StatusBar = status;
}
}
}
See Also
TitleBar
Gets the titlebar control of the RibbonWindow.
Declaration
public TitleBar TitleBar { get; }
Property Value
Type |
---|
TitleBar |
Remarks
Type: TitleBar Instance of TitleBar control used in window.
Examples
This example shows how to use a TitleBar in C#.
using System;
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace CSharp
{
public partial class CodeOnlyWindow : RibbonWindow
{
public CodeOnlyWindow()
{
TitleBar title = this.TitleBar;
}
}
}
See Also
TitleBarPatternImage
Gets or sets the Title pattern image
Declaration
public ImageSource TitleBarPatternImage { get; set; }
Property Value
Type |
---|
System.Windows.Media.ImageSource |
TitleTextAlignment
Gets or Sets the alignment of the Title Text
Declaration
public HorizontalAlignment TitleTextAlignment { get; set; }
Property Value
Type |
---|
System.Windows.HorizontalAlignment |
Methods
ArrangeOverride(Size)
Override this method to arrange and size a window and its child elements.
Declaration
protected override Size ArrangeOverride(Size arrangeBounds)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | arrangeBounds | A System.Windows.Size that reflects the final size that the window should use to arrange itself and its children. |
Returns
Type | Description |
---|---|
System.Windows.Size | A System.Windows.Size that reflects the actual size that was used. |
MeasureOverride(Size)
Measures the size in layout required for child elements and determines a size for a panel.
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | availableSize | The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available. |
Returns
Type | Description |
---|---|
System.Windows.Size | The size that this element determines it needs during layout, based on its calculations of child element sizes. |
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate.
Declaration
public override void OnApplyTemplate()
OnClosed(EventArgs)
Raises the Closed event.
Declaration
protected override void OnClosed(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The EventArgs that contains the event data. |
OnClosing(CancelEventArgs)
Raises the Closing event.
Declaration
protected override void OnClosing(CancelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.CancelEventArgs | e | A CancelEventArgs that contains the event data. |
OnIsGlassActiveChanged(DependencyPropertyChangedEventArgs)
Raises IsGlassActiveChanged event.
Declaration
protected virtual void OnIsGlassActiveChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnIsMinimalSizeReachedChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises IsMinimalSizeReachedChanged event.
Declaration
protected virtual void OnIsMinimalSizeReachedChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
OnMaximizedModeChanged(DependencyPropertyChangedEventArgs)
Raises the MaximizedModeChanged event.
Declaration
protected virtual void OnMaximizedModeChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | The System.Windows.DependencyPropertyChangedEventArgs instance containing the event data. |
OnMouseUp(MouseButtonEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.MouseUp�routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data reports that the mouse button was released. |
OnPreviewMouseLeftButtonDown(MouseButtonEventArgs)
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.
Declaration
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was pressed. |
OnPreviewMouseMove(MouseEventArgs)
Invoked when an unhandled System.Windows.Input.Mouse.PreviewMouseMove�attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnPreviewMouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e | The System.Windows.Input.MouseEventArgs that contains the event data. |
OnPropertyChanged(DependencyPropertyChangedEventArgs)
Invoked whenever the effective value of any dependency property on this System.Windows.FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Overrides System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs).
Declaration
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | The event data that describes the property that changed, as well as old and new values. |
OnSourceInitialized(EventArgs)
Raises the System.Windows.Window.SourceInitialized event.
Declaration
protected override void OnSourceInitialized(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
OnStateChanged(EventArgs)
Raises the System.Windows.Window.StateChanged event.
Declaration
protected override void OnStateChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
Events
IsGlassActiveChanged
Event that is raised when IsGlassActive property is changed.
Declaration
public event PropertyChangedCallback IsGlassActiveChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |