In This Article

FloatingWindowControl Class

Represents a HostWindowControlBase that is used as the root control of a hosted floating window.

public class FloatingWindowControl : HostWindowControlBase, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance:
object AvaloniaObject Animatable StyledElement Visual Layoutable Interactive InputElement Control TemplatedControl ContentControl WindowControl HostWindowControlBase object
Implements:
IDataContextProvider ILogical IThemeVariantHost IResourceHost IResourceNode IStyleHost ISetLogicalParent ISetInheritanceParent IStyleable INamed IInputElement IDataTemplateHost ISetterValue

Properties

DockSite

The DockSite that is managing the window.

public DockSite? DockSite { get; }

Property Value

DockSite

Methods

Activate()

Attempts to bring the window to the foreground and activates it.

public override bool Activate()

Returns

bool:

true if the window was successfully activated; otherwise, false.

GetAdjustedBounds(Rect, ResizeOperation)

Returns an adjusted version of the specified bounds, which can provide support for features such as magnetism.

public override Rect GetAdjustedBounds(Rect bounds, ResizeOperation resizeOperation)
Parameter Type Description
bounds Rect

The bounds to examine.

resizeOperation ResizeOperation

The active resize operation.

Returns

Rect

OnActivated(RoutedEventArgs)

Called when the window gains focus within.

protected override void OnActivated(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

A RoutedEventArgs that contains the event data.

Remarks

This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.

OnClosing(CancelRoutedEventArgs)

Called directly after Close() is called, and can be handled to cancel window closure.

protected override void OnClosing(CancelRoutedEventArgs e)
Parameter Type Description
e CancelRoutedEventArgs

A CancelRoutedEventArgs that contains the event data.

Remarks

This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.

OnDeactivated(RoutedEventArgs)

Called when the window loses focus within.

protected override void OnDeactivated(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

A RoutedEventArgs that contains the event data.

Remarks

This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.

OnPointerEntered(PointerEventArgs)

Called before the Avalonia.Input.InputElement.PointerEntered event occurs.

protected override void OnPointerEntered(PointerEventArgs e)
Parameter Type Description
e PointerEventArgs

The event args.

OnPointerExited(PointerEventArgs)

Called before the Avalonia.Input.InputElement.PointerExited event occurs.

protected override void OnPointerExited(PointerEventArgs e)
Parameter Type Description
e PointerEventArgs

The event args.

ShouldDragMoveWithExternalLogic(PointerPressedEventArgs)

Returns whether the window should be dragged with external logic.

protected override bool ShouldDragMoveWithExternalLogic(PointerPressedEventArgs e)
Parameter Type Description
e PointerPressedEventArgs

The source Avalonia.Input.PointerPressedEventArgs, which can be used to capture the pointer.

Returns

bool:

true if the window should be dragged with external logic; otherwise, false.

Inherited Members

Extension Methods