Class TitleBar
Custom navigation buttons for the window.
[TemplatePart(Name = "PART_MainGrid", Type = typeof(Grid))]
[TemplatePart(Name = "PART_Icon", Type = typeof(Image))]
[TemplatePart(Name = "PART_HelpButton", Type = typeof(TitleBarButton))]
[TemplatePart(Name = "PART_MinimizeButton", Type = typeof(TitleBarButton))]
[TemplatePart(Name = "PART_MaximizeButton", Type = typeof(TitleBarButton))]
[TemplatePart(Name = "PART_RestoreButton", Type = typeof(TitleBarButton))]
[TemplatePart(Name = "PART_CloseButton", Type = typeof(TitleBarButton))]
public class TitleBar : Control, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IThemeControl- Inheritance
- 
      
      
      
      
      
      
      
      TitleBar
- Implements
- Inherited Members
Constructors
TitleBar()
public TitleBar()Fields
ApplicationThemeProperty
Identifies the ApplicationTheme dependency property.
public static readonly DependencyProperty ApplicationThemePropertyField Value
ButtonsBackgroundProperty
Identifies the ButtonsBackground dependency property.
public static readonly DependencyProperty ButtonsBackgroundPropertyField Value
ButtonsForegroundProperty
Identifies the ButtonsForeground dependency property.
public static readonly DependencyProperty ButtonsForegroundPropertyField Value
CanMaximizeProperty
Identifies the CanMaximize dependency property.
public static readonly DependencyProperty CanMaximizePropertyField Value
CloseClickedEvent
Identifies the CloseClicked routed event.
public static readonly RoutedEvent CloseClickedEventField Value
CloseWindowByDoubleClickOnIconProperty
Identifies the CloseWindowByDoubleClickOnIcon dependency property.
public static readonly DependencyProperty CloseWindowByDoubleClickOnIconPropertyField Value
ForceShutdownProperty
Identifies the ForceShutdown dependency property.
public static readonly DependencyProperty ForceShutdownPropertyField Value
HeaderProperty
Property for Header.
public static readonly DependencyProperty HeaderPropertyField Value
HelpClickedEvent
Identifies the HelpClicked routed event.
public static readonly RoutedEvent HelpClickedEventField Value
IconProperty
Identifies the Icon dependency property.
public static readonly DependencyProperty IconPropertyField Value
IsMaximizedProperty
Identifies the IsMaximized dependency property.
public static readonly DependencyProperty IsMaximizedPropertyField Value
MaximizeClickedEvent
Identifies the MaximizeClicked routed event.
public static readonly RoutedEvent MaximizeClickedEventField Value
MinimizeClickedEvent
Identifies the MinimizeClicked routed event.
public static readonly RoutedEvent MinimizeClickedEventField Value
ShowCloseProperty
Identifies the ShowClose dependency property.
public static readonly DependencyProperty ShowClosePropertyField Value
ShowHelpProperty
Identifies the ShowHelp dependency property.
public static readonly DependencyProperty ShowHelpPropertyField Value
ShowMaximizeProperty
Identifies the ShowMaximize dependency property.
public static readonly DependencyProperty ShowMaximizePropertyField Value
ShowMinimizeProperty
Identifies the ShowMinimize dependency property.
public static readonly DependencyProperty ShowMinimizePropertyField Value
TemplateButtonCommandProperty
Identifies the TemplateButtonCommand dependency property.
public static readonly DependencyProperty TemplateButtonCommandPropertyField Value
TitleProperty
Identifies the Title dependency property.
public static readonly DependencyProperty TitlePropertyField Value
TrailingContentProperty
Property for TrailingContent.
public static readonly DependencyProperty TrailingContentPropertyField Value
Properties
ApplicationTheme
Gets the theme that is currently set.
public ApplicationTheme ApplicationTheme { get; set; }Property Value
ButtonsBackground
Gets or sets the background of the navigation buttons when hovered.
[Bindable(true)]
public Brush ButtonsBackground { get; set; }Property Value
ButtonsForeground
Gets or sets the foreground of the navigation buttons.
[Bindable(true)]
public Brush ButtonsForeground { get; set; }Property Value
CanMaximize
Gets or sets a value indicating whether the maximize functionality is enabled. If disabled the MaximizeActionOverride action won't be called
public bool CanMaximize { get; set; }Property Value
CloseWindowByDoubleClickOnIcon
Gets or sets a value indicating whether the window can be closed by double clicking on the icon
public bool CloseWindowByDoubleClickOnIcon { get; set; }Property Value
ForceShutdown
Gets or sets a value indicating whether the controls affect main application window.
public bool ForceShutdown { get; set; }Property Value
Header
Gets or sets the content displayed in the left side of the TitleBar.
public object? Header { get; set; }Property Value
Icon
Gets or sets the titlebar icon.
public IconElement? Icon { get; set; }Property Value
IsMaximized
Gets a value indicating whether the current window is maximized.
public bool IsMaximized { get; }Property Value
MaximizeActionOverride
Gets or sets the Action that should be executed when the Maximize button is clicked."/>
public Action<TitleBar, Window>? MaximizeActionOverride { get; set; }Property Value
MinimizeActionOverride
Gets or sets what Action should be executed when the Minimize button is clicked.
public Action<TitleBar, Window>? MinimizeActionOverride { get; set; }Property Value
ShowClose
Gets or sets a value indicating whether to show the close button.
public bool ShowClose { get; set; }Property Value
ShowHelp
Gets or sets a value indicating whether to show the help button
public bool ShowHelp { get; set; }Property Value
ShowMaximize
Gets or sets a value indicating whether to show the maximize button.
public bool ShowMaximize { get; set; }Property Value
ShowMinimize
Gets or sets a value indicating whether to show the minimize button.
public bool ShowMinimize { get; set; }Property Value
TemplateButtonCommand
Gets the command triggered when clicking the titlebar button.
public IRelayCommand TemplateButtonCommand { get; }Property Value
Title
Gets or sets title displayed on the left.
public string? Title { get; set; }Property Value
TrailingContent
Gets or sets the content displayed in right side of the TitleBar.
public object? TrailingContent { get; set; }Property Value
Methods
OnApplyTemplate()
Invoked whenever application code or an internal process, such as a rebuilding layout pass, calls the ApplyTemplate method.
public override void OnApplyTemplate()OnInitialized(EventArgs)
Raises the Initialized event. This method is invoked whenever IsInitialized is set to true internally.
protected override void OnInitialized(EventArgs e)Parameters
- eEventArgs
- The RoutedEventArgs that contains the event data. 
OnLoaded(object, RoutedEventArgs)
protected virtual void OnLoaded(object sender, RoutedEventArgs e)Parameters
- senderobject
- eRoutedEventArgs
OnThemeChanged(ApplicationTheme, Color)
This virtual method is triggered when the app's theme changes.
protected virtual void OnThemeChanged(ApplicationTheme currentApplicationTheme, Color systemAccent)Parameters
- currentApplicationThemeApplicationTheme
- systemAccentColor
Events
CloseClicked
Event triggered after clicking close button.
public event TypedEventHandler<TitleBar, RoutedEventArgs> CloseClickedEvent Type
HelpClicked
Event triggered after clicking help button
public event TypedEventHandler<TitleBar, RoutedEventArgs> HelpClickedEvent Type
MaximizeClicked
Event triggered after clicking maximize or restore button.
public event TypedEventHandler<TitleBar, RoutedEventArgs> MaximizeClickedEvent Type
MinimizeClicked
Event triggered after clicking minimize button.
public event TypedEventHandler<TitleBar, RoutedEventArgs> MinimizeClicked