In This Article

RibbonWindow Class

Represents a Window that has a custom title bar and border made for use with a ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow.Ribbon control.

[TemplatePart(Name = "PART_ApplicationIcon", Type = typeof(UIElement))]
[TemplatePart(Name = "PART_TitleBar", Type = typeof(Panel))]
[TemplatePart(Name = "PART_TitleBarText", Type = typeof(RibbonWindowTitleBarText))]
public class RibbonWindow : Window
Inheritance:
object Visual UIElement FrameworkElement Control ContentControl Window object

Remarks

For detailed documentation on this control's features and how to use them, please see the RibbonWindow documentation topic.

Constructors

RibbonWindow()

Initializes a new instances of the RibbonWindow class.

public RibbonWindow()

Properties

ApplicationName

Gets or sets the name of the application.

[Localizability(LocalizationCategory.Title)]
public string ApplicationName { get; set; }

Property Value

string:

The name of the application.

Remarks

This property, along with the DocumentName property, is use to construct the window's title.

DocumentName

Gets or sets the name of the current document, if any.

[Localizability(LocalizationCategory.Title)]
public string DocumentName { get; set; }

Property Value

string:

The name of the current document, if any.

Remarks

This property, along with the ApplicationName property, is use to construct the window's title.

HasRibbon

Gets whether a ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow.Ribbon control is displayed in the window.

public bool HasRibbon { get; }

Property Value

bool:

true if a ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow.Ribbon control is displayed in the window; otherwise, false.

IsMaximizeButtonVisible

Gets or sets whether the maximize button is visible.

public bool IsMaximizeButtonVisible { get; set; }

Property Value

bool:

true if the maximize button is visible; otherwise, false. The default value is true.

IsMinimizeButtonVisible

Gets or sets whether the minimize button is visible.

public bool IsMinimizeButtonVisible { get; set; }

Property Value

bool:

true if the minimize button is visible; otherwise, false. The default value is true.

IsRibbonBackstageOpen

Gets whether an attached ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow.Ribbon control has its backstage open.

public bool IsRibbonBackstageOpen { get; }

Property Value

bool:

true if an attached ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow.Ribbon control has its backstage open; otherwise, false.

IsRibbonVisibleWithBackstage

Gets or sets whether to keep the ribbon visible when the Backstage is displayed.

public bool IsRibbonVisibleWithBackstage { get; set; }

Property Value

bool:

true if the ribbon should remain visible when the Backstage is displayed; otherwise, false. The default value is false.

IsTitleBarVisible

Gets or sets whether the title bar is visible, to be used when maximizing the window and hiding any contained ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow.Ribbon.

public bool IsTitleBarVisible { get; set; }

Property Value

bool:

true if the title bar is visible; otherwise, false. The default value is true.

Remarks

Normally, setting the WindowStyle property to None would hide a title bar. However, RibbonWindow is often forced to be in None style to achieve its custom UI. Therefore, set this property to false in cases where you maximize the RibbonWindow, hide any child ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow.Ribbon and want to achieve an effect similar to normal windows when their style is None. This sort of functionality is useful when trying to mimic a "full-screen" mode temporarily.

TitleBarHeaderTemplate

Gets or sets the DataTemplate for the center title bar area where title bar text is typically displayed.

public DataTemplate TitleBarHeaderTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate for the center title bar area where title bar text is typically displayed.

TitleBarLeftContentTemplate

Gets or sets the DataTemplate that can inject additional controls in the left side of the title bar, next to the icon.

public DataTemplate TitleBarLeftContentTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate that can inject additional controls in the left side of the title bar, next to the icon.

TitleBarViewModel

Gets or sets the RibbonWindowTitleBarViewModel for the title bar.

public RibbonWindowTitleBarViewModel TitleBarViewModel { get; }

Property Value

RibbonWindowTitleBarViewModel:

The RibbonWindowTitleBarViewModel for the title bar.

Methods

OnActivated(EventArgs)

Raises the Activated event.

protected override void OnActivated(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnApplyTemplate()

Invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

OnDeactivated(EventArgs)

Raises the Deactivated event.

protected override void OnDeactivated(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnStateChanged(EventArgs)

Occurs when the state of the window changes.

protected override void OnStateChanged(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnTemplateChanged(ControlTemplate, ControlTemplate)

Occurs when the Template property is changed.

protected override void OnTemplateChanged(ControlTemplate oldTemplate, ControlTemplate newTemplate)
Parameter Type Description
oldTemplate ControlTemplate

The old template.

newTemplate ControlTemplate

The new template.

SetSize(double, double)

Sets the size of the RibbonWindow using the specified width and height.

public bool SetSize(double width, double height)
Parameter Type Description
width double

The new width.

height double

The new height.

Returns

bool:

true if the resize operation was successful; otherwise false.

Fields

ApplicationNameProperty

Identifies the ApplicationName dependency property. This field is read-only.

public static readonly DependencyProperty ApplicationNameProperty

DocumentNameProperty

Identifies the DocumentName dependency property. This field is read-only.

public static readonly DependencyProperty DocumentNameProperty

HasRibbonProperty

Identifies the HasRibbon dependency property. This field is read-only.

public static readonly DependencyProperty HasRibbonProperty

IsMaximizeButtonVisibleProperty

Identifies the IsMaximizeButtonVisible dependency property. This field is read-only.

public static readonly DependencyProperty IsMaximizeButtonVisibleProperty

IsMinimizeButtonVisibleProperty

Identifies the IsMinimizeButtonVisible dependency property. This field is read-only.

public static readonly DependencyProperty IsMinimizeButtonVisibleProperty

IsRibbonBackstageOpenProperty

Identifies the IsRibbonBackstageOpen dependency property. This field is read-only.

public static readonly DependencyProperty IsRibbonBackstageOpenProperty

IsRibbonVisibleWithBackstageProperty

Identifies the IsRibbonVisibleWithBackstage dependency property. This field is read-only.

public static readonly DependencyProperty IsRibbonVisibleWithBackstageProperty

IsTitleBarVisibleProperty

Identifies the IsTitleBarVisible dependency property. This field is read-only.

public static readonly DependencyProperty IsTitleBarVisibleProperty

TitleBarHeaderTemplateProperty

Identifies the TitleBarHeaderTemplate dependency property. This field is read-only.

public static readonly DependencyProperty TitleBarHeaderTemplateProperty

TitleBarLeftContentTemplateProperty

Identifies the TitleBarLeftContentTemplate dependency property. This field is read-only.

public static readonly DependencyProperty TitleBarLeftContentTemplateProperty

TitleBarViewModelProperty

Identifies the TitleBarViewModel dependency property. This field is read-only.

public static readonly DependencyProperty TitleBarViewModelProperty