Skip to main content

FluenceWindow

C# API / Fluence.Wpf.Controls

  • Assembly: Fluence.Wpf
  • Namespace: Fluence.Wpf.Controls
public class FluenceWindow : Window

A top-level window that recreates the Windows 11 Fluent / WinUI 3 chrome on WPF: a DWM system backdrop (Mica, Acrylic, or Tabbed), rounded corners, an extendable title bar, and custom caption buttons that integrate with the Windows 11 snap-layout flyout.

Remarks: The window collapses the native non-client frame through WindowChrome and drives every caption interaction (drag, resize, snap-layout hover, maximize/restore) from a Win32 message hook so the custom chrome stays authoritative. Theme, accent, and backdrop are applied directly to the HWND via DWM attributes and kept in sync with the shared theme managers for the lifetime of the realised window.

Base type: Window (including inherited WPF and .NET members)

C# source

Constructors​

FluenceWindow​

public FluenceWindow()

Initializes a new instance of the FluenceWindow class: loads the default style explicitly, attaches the four SystemCommands command bindings, and installs the WindowChrome that collapses the native frame.

Remarks: The theme-manager subscriptions are intentionally deferred to OnSourceInitialized (HWND realisation) so a constructed-but-never- shown window does not pin itself to the static managers' invocation lists.

Properties​

CornerStyle​

public WindowCornerPreference CornerStyle { get; set; }

Gets or sets the preferred window corner rounding policy for DWM.

DefaultIcon​

public static ImageSource? DefaultIcon { get; }

The Fluence brand icon embedded in this assembly, loaded once and shared (frozen) as the default Icon for every FluenceWindow. null only if the embedded resource cannot be loaded. Exposed so a consumer can apply the same square, no-background brand mark to its own windows.

ExtendsContentIntoTitleBar​

public bool ExtendsContentIntoTitleBar { get; set; }

Gets or sets whether the window content extends into the title bar area, replacing the system title bar with a custom one rendered by the control template.

HasShadow​

public bool HasShadow { get; set; }

Gets or sets whether the window has a drop shadow. Defaults to true.

IsClosable​

public bool IsClosable { get; set; }

Gets or sets whether the close button is enabled. When false, the button is visible but grayed out.

IsCloseButtonVisible​

public Visibility IsCloseButtonVisible { get; set; }

Gets or sets the visibility of the close button.

IsMaximizable​

public bool IsMaximizable { get; set; }

Gets or sets whether the maximize button is enabled. When false, the button is visible but grayed out.

IsMaximizeButtonVisible​

public Visibility IsMaximizeButtonVisible { get; set; }

Gets or sets the visibility of the maximize button.

IsMinimizable​

public bool IsMinimizable { get; set; }

Gets or sets whether the minimize button is enabled. When false, the button is visible but grayed out.

IsMinimizeButtonVisible​

public Visibility IsMinimizeButtonVisible { get; set; }

Gets or sets the visibility of the minimize button.

IsMoveable​

public bool IsMoveable { get; set; }

Gets or sets whether the window can be moved by title-bar dragging or the system move command.

MarginMaximized​

public Thickness MarginMaximized { get; set; }

Gets or sets extra margin applied when the window is maximized to avoid overlap with the work area.

ShowIcon​

public bool ShowIcon { get; set; }

Gets or sets whether the window icon is shown in the title bar.

ShowTitle​

public bool ShowTitle { get; set; }

Gets or sets whether the window title text is shown in the title bar.

SystemBackdropType​

public WindowBackdropType SystemBackdropType { get; set; }

Gets or sets the requested system backdrop (Mica, Acrylic, Tabbed, or none).

TitleBar​

public UIElement? TitleBar { get; set; }

Gets or sets custom content displayed in the title bar region, or null to use the default title bar.

Remarks: Assigning null clears custom title-bar content. When ExtendsContentIntoTitleBar is true, the control template falls back to the built-in icon and title presentation.

TitleBarHeight​

public double TitleBarHeight { get; set; }

Gets or sets the height of the title bar region. Standard = 48, compact = 32.

Methods​

OnActivated​

protected override void OnActivated(EventArgs e)

Documentation inherited from the Window API.

OnApplyTemplate​

public override void OnApplyTemplate()

Documentation inherited from the Window API.

OnClosed​

protected override void OnClosed(EventArgs e)

Documentation inherited from the Window API.

OnDeactivated​

protected override void OnDeactivated(EventArgs e)

Documentation inherited from the Window API.

OnDpiChanged​

protected override void OnDpiChanged(DpiScale oldDpi, DpiScale newDpi)

Documentation inherited from the Window API.

OnPropertyChanged​

protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)

Documentation inherited from the Window API.

OnSourceInitialized​

protected override void OnSourceInitialized(EventArgs e)

Documentation inherited from the Window API.

OnStateChanged​

protected override void OnStateChanged(EventArgs e)

Documentation inherited from the Window API.

SetTitleBar​

public void SetTitleBar(UIElement? titleBar)

Sets custom title-bar content, or clears it to restore the default title bar.

Parameter titleBar: The custom title-bar element, or null to clear custom content.

Dependency property identifiers​

Use these identifiers with WPF property APIs. The matching CLR properties appear above when the control exposes them.

CornerStyleProperty​

public static readonly DependencyProperty CornerStyleProperty

Identifies the CornerStyle dependency property.

ExtendsContentIntoTitleBarProperty​

public static readonly DependencyProperty ExtendsContentIntoTitleBarProperty

Identifies the ExtendsContentIntoTitleBar dependency property.

HasShadowProperty​

public static readonly DependencyProperty HasShadowProperty

Identifies the HasShadow dependency property.

IsClosableProperty​

public static readonly DependencyProperty IsClosableProperty

Identifies the IsClosable dependency property.

IsCloseButtonVisibleProperty​

public static readonly DependencyProperty IsCloseButtonVisibleProperty

Identifies the IsCloseButtonVisible dependency property.

IsMaximizableProperty​

public static readonly DependencyProperty IsMaximizableProperty

Identifies the IsMaximizable dependency property.

IsMaximizeButtonVisibleProperty​

public static readonly DependencyProperty IsMaximizeButtonVisibleProperty

Identifies the IsMaximizeButtonVisible dependency property.

IsMinimizableProperty​

public static readonly DependencyProperty IsMinimizableProperty

Identifies the IsMinimizable dependency property.

IsMinimizeButtonVisibleProperty​

public static readonly DependencyProperty IsMinimizeButtonVisibleProperty

Identifies the IsMinimizeButtonVisible dependency property.

IsMoveableProperty​

public static readonly DependencyProperty IsMoveableProperty

Identifies the IsMoveable dependency property.

MarginMaximizedProperty​

public static readonly DependencyProperty MarginMaximizedProperty

Identifies the MarginMaximized dependency property.

ShowIconProperty​

public static readonly DependencyProperty ShowIconProperty

Identifies the ShowIcon dependency property.

ShowTitleProperty​

public static readonly DependencyProperty ShowTitleProperty

Identifies the ShowTitle dependency property.

SystemBackdropTypeProperty​

public static readonly DependencyProperty SystemBackdropTypeProperty

Identifies the SystemBackdropType dependency property.

TitleBarHeightProperty​

public static readonly DependencyProperty TitleBarHeightProperty

Identifies the TitleBarHeight dependency property.

TitleBarProperty​

public static readonly DependencyProperty TitleBarProperty

Identifies the TitleBar dependency property.

Fields​

IsNotNullConverter​

public static readonly IValueConverter IsNotNullConverter

Converts a value to true when it is not null; used by caption-button visibility bindings in the control template (referenced via {x:Static}).