Table of Contents

Class TitleBar

Namespace
Tudormobile.Wpf.Controls
Assembly
Tudormobile.WpfControls.dll

Provides a title bar, complete with window state and drag/move management.

This control adds a title bar with optional Icon, Minimize/Maximize buttons, a close button, and 'content'. The control is implemented as a ContentControl. The content area is located between the Icon and the window state control box. WindowStateControl for additional information. behavior to their containing Window to manage window state (normal, minimize, maximize).

Set the CanMinimize/CanMaximize properties to enable minimize/maximize window states. (Default is TRUE). Set the ShowMinMax property to show/hide the minimize/maximize buttons. (Default is TRUE). Set the Icon property to display an Icon on the left side of the Title bar. (Default is Icon property of the host window) Set the Content property to display content in the Content area (Default is Title property of the host window).

public class TitleBar : ContentControl, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild
Inheritance
TitleBar
Implements
Inherited Members

Remarks

This control is only suitable for use in a Transparent window with custom chrome (or no chrome).

Properties

CanMaximize

True if user can maximize.

public bool CanMaximize { get; set; }

Property Value

bool

CanMinimize

True if user can minimize (minimze button enabled).

public bool CanMinimize { get; set; }

Property Value

bool

Icon

Icon to display.

public ImageSource? Icon { get; set; }

Property Value

ImageSource

ShowMinMax

True if min/max buttons are present.

public bool ShowMinMax { get; set; }

Property Value

bool

Methods

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

OnMouseLeftButtonDown(MouseButtonEventArgs)

Invoked when an unhandled MouseLeftButtonDown routed event is raised on this element. Implement this method to add class handling for this event.

protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)

Parameters

e MouseButtonEventArgs

The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was pressed.

OnMouseRightButtonUp(MouseButtonEventArgs)

Invoked when an unhandled MouseRightButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)

Parameters

e MouseButtonEventArgs

The MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was released.