Skip to main content

TitleBar

Description​

TitleBar is a Fluence ContentControl designed for use in a FluenceWindow title-bar region. It renders title metadata, optional back and pane-toggle buttons, header slots, and centered custom content. It does not perform navigation or toggle a navigation pane by itself; connect its command properties or request events to your application behavior.

Use it in a FluenceWindow when the window needs title metadata or application navigation controls.

TitleBar in light mode TitleBar in dark mode

Example usage​

Initialize theme resources before creating the window. If startup code creates the window in OnStartup, remove StartupUri from App.xaml; see C# basic usage.

Set ExtendsContentIntoTitleBar on the containing window and assign a TitleBar to its TitleBar content property. The window's default title-bar height is 48 device-independent units. TitleBar.IsCompact selects the 32-unit compact layout.

<fluence:FluenceWindow x:Class="MyApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:fluence="http://schemas.fluencewpf.com"
Title="My app"
ExtendsContentIntoTitleBar="True">
<fluence:FluenceWindow.TitleBar>
<fluence:TitleBar Title="My app"
Subtitle="Workspace"
IsBackButtonVisible="True"
IsPaneToggleButtonVisible="True"
BackRequested="TitleBar_BackRequested"
PaneToggleRequested="TitleBar_PaneToggleRequested" />
</fluence:FluenceWindow.TitleBar>
<fluence:NavigationView x:Name="AppNavigation">
<fluence:NavigationView.Content>
<Frame x:Name="MainFrame" />
</fluence:NavigationView.Content>
</fluence:NavigationView>
</fluence:FluenceWindow>

The XAML declares MainFrame inside AppNavigation, so the handlers can use the named controls directly. If a request event is used, implement the corresponding application action there. Alternatively, assign BackCommand or PaneToggleCommand and optional command parameters. A command that cannot execute disables its button; the request event is raised after a command executes successfully, or after a click when no command is assigned.

State and behavior​

Property or eventDefaultPurpose
Title, SubtitleEmpty stringText displayed in the title bar.
IconnullObject displayed as the title icon.
IsBackButtonVisiblefalseShows the back button when true.
IsPaneToggleButtonVisiblefalseShows the pane-toggle button when true.
IsCompactfalseUses a 32-unit title bar instead of the standard 48-unit layout.
LeftHeader, RightHeadernullContent slots to the left and right of the central title-bar area.
CustomContentnullContent displayed in the centered slot.
BackCommand, PaneToggleCommandnullCommands invoked by their respective buttons.
BackRequested, PaneToggleRequestedNot applicableEvents for handling button requests in code.

Interactive custom content placed in the extended chrome must set WindowChrome.IsHitTestVisibleInChrome="True" so WPF can route pointer input to it. The gallery title bar demonstrates this on its search control. Keep the title bar's content within the available space beside the caption controls.

Reference​