alexa
menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    Show / Hide Table of Contents

    Class NativeFloatWindow

    Represents a native floating window with customized behavior and appearance.

    Inheritance
    System.Object
    NativeFloatWindow
    Namespace: Syncfusion.Windows.Tools.Controls
    Assembly: Syncfusion.Tools.Wpf.dll
    Syntax
    [SkinType(SkinVisualStyle = Skin.Office2007Blue, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2007BlueStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2007Black, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2007BlackStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2007Silver, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2007SilverStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2010Blue, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2010BlueStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2010Black, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2010BlackStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2010Silver, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2010SilverStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2003, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2003Style.xaml")]
    [SkinType(SkinVisualStyle = Skin.Blend, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/BlendStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.SyncOrange, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/SyncOrangeStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.ShinyRed, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/ShinyRedStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.ShinyBlue, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/ShinyBlueStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Default, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF;component/Framework/DockingManager/Themes/vista.aero.xaml")]
    [SkinType(SkinVisualStyle = Skin.VS2010, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/VS2010Style.xaml")]
    [SkinType(SkinVisualStyle = Skin.Metro, Type = typeof(DockingManager), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/MetroStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Transparent, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/TransparentStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2013, Type = typeof(FloatWindowBorder), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Framework/DockingManager/Themes/Office2013Style.xaml")]
    public class NativeFloatWindow : Window

    Constructors

    NativeFloatWindow()

    Intialize a new instance of NativeFloatWindow

    Declaration
    public NativeFloatWindow()

    Fields

    CloseCommand

    Command that is responsible for closing the NativeFloatWindow to the NativeFloatWindow.

    Declaration
    public static RoutedUICommand CloseCommand
    Field Value
    Type
    System.Windows.Input.RoutedUICommand

    DockingManagerProperty

    Identifies DockingManager dependency property of the FloatWindow.

    Declaration
    public static readonly DependencyProperty DockingManagerProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    HeaderProperty

    Identifies the Header dependency property of the FloatWindow.

    Declaration
    public static readonly DependencyProperty HeaderProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    IsDraggingProperty

    Identifies IsDragging dependency property of the FloatWindow.

    Declaration
    public static readonly DependencyProperty IsDraggingProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    IsOpenProperty

    Identifies IsOpen dependency property of the FloatWindow.

    Declaration
    public static readonly DependencyProperty IsOpenProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    MaximizeButtonEnabledProperty

    Idenfities the MaximizeButtonEnabled dependecny property of the floatwindow

    Declaration
    public static readonly DependencyProperty MaximizeButtonEnabledProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    MaximizeCommand

    Command that is responsible for maximizing the NativeFloatWindow to the NativeFloatWindow.

    Declaration
    public static RoutedUICommand MaximizeCommand
    Field Value
    Type
    System.Windows.Input.RoutedUICommand

    MinimizeCommand

    Command that is responsible for minimizing the NativeFloatWindow to the NativeFloatWindow.

    Declaration
    public static RoutedUICommand MinimizeCommand
    Field Value
    Type
    System.Windows.Input.RoutedUICommand

    PrimaryElementProperty

    Identifies PrimaryElement dependency property of the FloatWindow.

    Declaration
    public static readonly DependencyProperty PrimaryElementProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    RestoreCommand

    Command that is responsible for restoring the NativeFloatWindow to the NativeFloatWindow.

    Declaration
    public static RoutedUICommand RestoreCommand
    Field Value
    Type
    System.Windows.Input.RoutedUICommand

    Properties

    DockingManager

    Gets or sets the docking manager.

    Declaration
    public DockingManager DockingManager { get; set; }
    Property Value
    Type Description
    DockingManager

    The docking manager.

    Header

    Gets or sets the Header property

    Declaration
    public string Header { get; set; }
    Property Value
    Type
    System.String

    HitTestDisabled

    Gets or sets the HitTestDisabled property

    Declaration
    public bool HitTestDisabled { get; set; }
    Property Value
    Type
    System.Boolean

    IsDragging

    Gets or sets a value indicating whether IsDragging of the FloatWindow.

    Declaration
    public bool IsDragging { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is dragging; otherwise, false.

    IsMultiHostsContainer

    Gets or sets a value indicating whether this instance is multi hosts container.

    Declaration
    public bool IsMultiHostsContainer { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is multi hosts container; otherwise, false.

    IsOpen

    Gets or sets the IsOpen dependency property

    Declaration
    public bool IsOpen { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if this instance get open; otherwise, false.

    MaximizeButtonEnabled

    Gets or sets the MaximizeButtonEnabled property

    Declaration
    public bool MaximizeButtonEnabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if this instance get open; otherwise, false.

    PrimaryElement

    Gets or sets PrimaryElement of the FloatWindow.This is a dependency property.

    Declaration
    public FrameworkElement PrimaryElement { get; set; }
    Property Value
    Type
    System.Windows.FrameworkElement

    SystemMenu

    Gets or sets the systemmenu.

    Declaration
    public ContextMenu SystemMenu { get; set; }
    Property Value
    Type
    System.Windows.Controls.ContextMenu

    Methods

    DefWindowProc(IntPtr, Int32, IntPtr, IntPtr)

    Declaration
    public static IntPtr DefWindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam)
    Parameters
    Type Name Description
    System.IntPtr hWnd
    System.Int32 msg
    System.IntPtr wParam
    System.IntPtr lParam
    Returns
    Type
    System.IntPtr

    GetVisibleHostsCount(DockedElementsContainer)

    Invoke when determining the count of the VisibleHostsCount

    Declaration
    public int GetVisibleHostsCount(DockedElementsContainer container)
    Parameters
    Type Name Description
    DockedElementsContainer container

    The container

    Returns
    Type Description
    System.Int32

    Returns the count of the visible host count =

    OnActivated(EventArgs)

    Handles the System.Windows.Window.OnActivated(System.EventArgs) event to manage focus behavior when the window becomes active.

    Declaration
    protected override void OnActivated(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    An System.EventArgs that contains the event data.

    Remarks

    Brings the window into view and attempts to set focus to the PrimaryElement. If PrimaryElement is not focusable, it searches for the first focusable descendant and moves focus to it.

    OnApplyTemplate()

    Called when an internal process or application calls ApplyTemplate, which is used to build the current template's visual tree.

    Declaration
    public override void OnApplyTemplate()

    OnContentChanged(Object, Object)

    Handles changes to the window's content and wraps specific content types in a container for docking behavior.

    Declaration
    protected override void OnContentChanged(object oldContent, object newContent)
    Parameters
    Type Name Description
    System.Object oldContent

    The previous content of the window.

    System.Object newContent

    The new content being set.

    Remarks

    If the new content is a DockedElementTabbedHost, it is wrapped inside a DockedElementsContainer. This ensures proper docking behavior and visual structure. If the host already has a parent container, it is removed from that container before being added to the new one.

    OnCreateAutomationPeer()

    Creates an automation peer for the NativeFloatWindow to support UI Automation.

    Declaration
    protected override AutomationPeer OnCreateAutomationPeer()
    Returns
    Type Description
    System.Windows.Automation.Peers.AutomationPeer

    A custom NativeFloatWindowAutomationPeer if PrimaryElement is available; otherwise, the base implementation.

    Remarks

    This method enhances accessibility by providing a specialized automation peer that includes header information retrieved from the DockingManager. If PrimaryElement is null, the default automation peer is used.

    OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)

    Handles the System.Windows.UIElement.GotKeyboardFocus event to update the internal data context based on the focused element.

    Declaration
    protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.KeyboardFocusChangedEventArgs e

    A System.Windows.Input.KeyboardFocusChangedEventArgs that contains the event data.

    Remarks

    If the original source of the focus event is a DockedElementTabbedHost, this method checks whether the PrimaryElement is among its tab children. If so, it sets the InternalDataContext to the host. If PrimaryElement is not a System.Windows.FrameworkElement, it still assigns the host as the internal context.

    OnInitialized(EventArgs)

    Initializes the window and sets up command bindings for standard window operations.

    Declaration
    protected override void OnInitialized(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    An System.EventArgs that contains the event data.

    Remarks

    This method binds the CloseCommand, MaximizeCommand, MinimizeCommand, and RestoreCommand to their respective execution handlers. These bindings enable the window to respond to standard window control commands.

    OnIsKeyboardFocusedChanged(DependencyPropertyChangedEventArgs)

    Called when the System.Windows.UIElement.IsKeyboardFocused property changes.

    Declaration
    protected override void OnIsKeyboardFocusedChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    A System.Windows.DependencyPropertyChangedEventArgs that contains the event data.

    Remarks

    This override currently delegates to the base implementation. You can extend it to handle custom logic when the keyboard focus state of the window changes.

    OnKeyDown(KeyEventArgs)

    Invoke KeyDown on the DockingManager, since the native float window is logically a child of the DockingManager.

    Declaration
    protected override void OnKeyDown(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.KeyEventArgs e

    The System.Windows.Input.KeyEventArgs that contains the event data.

    OnKeyUp(KeyEventArgs)

    Invoke KeyUp on the DockingManager, since the native float window is logically a child of the DockingManager.

    Declaration
    protected override void OnKeyUp(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.KeyEventArgs e

    The System.Windows.Input.KeyEventArgs that contains the event data.

    OnPreviewKeyDown(KeyEventArgs)

    Invoke PreviewKeyDown on the DockingManager first, since the native float window is logically a child of the DockingManager.

    Declaration
    protected override void OnPreviewKeyDown(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.KeyEventArgs e

    The System.Windows.Input.KeyEventArgs that contains the event data.

    OnPreviewKeyUp(KeyEventArgs)

    Invoke the PreviewKeyUp on the DockingManager first, since the native float window is logically a child of the DockingManager.

    Declaration
    protected override void OnPreviewKeyUp(KeyEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.KeyEventArgs e

    The System.Windows.Input.KeyEventArgs that contains the event data.

    OnSourceInitialized(EventArgs)

    Called when the window's underlying Win32 source is initialized.

    Declaration
    protected override void OnSourceInitialized(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    An System.EventArgs that contains the event data.

    Remarks

    This method obtains the window handle using System.Windows.Interop.WindowInteropHelper and attaches a custom Windows message hook via System.Windows.Interop.HwndSource.AddHook(System.Windows.Interop.HwndSourceHook). This allows the window to intercept and process native Windows messages through the WndProc method.

    OnStylusSystemGesture(StylusSystemGestureEventArgs)

    Handles stylus system gestures by capturing the gesture type and passing the event to the base implementation.

    Declaration
    protected override void OnStylusSystemGesture(StylusSystemGestureEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.StylusSystemGestureEventArgs e

    Provides data for the System.Windows.Input.StylusSystemGestureEventArgs event.

    OnTouchDown(TouchEventArgs)

    Invoked when TouchDown on NativeFloatWindow.

    Declaration
    protected override void OnTouchDown(TouchEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.TouchEventArgs e

    OnTouchUp(TouchEventArgs)

    Invoked when TouchUp on NativeFloatWindow.

    Declaration
    protected override void OnTouchUp(TouchEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.TouchEventArgs e

    SetNewPrimaryElement(FrameworkElement)

    Invoke when set a new primary element

    Declaration
    public void SetNewPrimaryElement(FrameworkElement element)
    Parameters
    Type Name Description
    System.Windows.FrameworkElement element

    The Primary element

    UpdateDataContext()

    Invoke when data context updated.

    Declaration
    public void UpdateDataContext()

    UpdateIsMultiHostProperty()

    Invoke when IsMultiHostProperty updated

    Declaration
    public void UpdateIsMultiHostProperty()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved