In This Article

DocumentWindow Class

Represents a document window.

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

Constructors

DocumentWindow()

Initializes an instance of the class.

public DocumentWindow()

DocumentWindow(DockSite?, string?, string?, object?, object?)

Initializes an instance of the class.

public DocumentWindow(DockSite? dockSite, string? serializationId = null, string? title = null, object? icon = null, object? content = null)
Parameter Type Description
dockSite DockSite

The DockSite with which to register this window.

serializationId string

The serialization ID of the window, used during layout serialization.

title string

The title of the window.

icon object

The object that defines the window's icon.

content object

The content of the window.

DocumentWindow(bool)

Initializes an instance of the class.

public DocumentWindow(bool isContainerForItem)
Parameter Type Description
isContainerForItem bool

Whether the window is a container for an item.

Properties

FileName

The full path to the document.

public string? FileName { get; set; }

Property Value

string

Remarks

This property is displayed on switchers.

IsReadOnly

Indicates whether the document window is currently in a read-only state.

public bool IsReadOnly { get; set; }

Property Value

bool:

The default value is false.

Remarks

This flag is purely a visual cue to the end user that the contents of the document window are read-only.

Methods

Attach(IDockTarget)

Attaches the DocumentWindow to the specified target, generally making a tabbed group.

public void Attach(IDockTarget target)
Parameter Type Description
target IDockTarget

The IDockTarget against which to attach.

Remarks

The target must be another DocumentWindow or TabbedMdiContainer.

Dock(IDockTarget, Dock)

Docks the DocumentWindow to the side of a specified target.

public void Dock(IDockTarget target, Dock side)
Parameter Type Description
target IDockTarget

The IDockTarget that is the target of the dock.

side Dock

The target's side against which to dock.

Remarks

The target must be another DocumentWindow or TabbedMdiContainer. Use the Attach(IDockTarget) method to dock into a particular target.

Float(Point?, Size?)

Floats the window to the specified optional location and size.

public override void Float(Point? location, Size? size)
Parameter Type Description
location Point?

An optional Avalonia.Point specifying the target location of the floating dock host.

When UseHostedFloatingWindows is true, the location is expressed relative to the containing control; otherwise, the value is the location in screen coordinates.

size Size?

An optional Avalonia.Size specifying the target size of the floating dock host.

Remarks

When location is not specified, it will float to a default location. When size is not specified, it will float with its current size.

OnCreateAutomationPeer()

Returns a new, type-specific Avalonia.Automation.Peers.AutomationPeer implementation for the control.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific Avalonia.Automation.Peers.AutomationPeer implementation.

OnStateChanged(DockingWindowState, DockingWindowState)

Occurs when the value of the State property has changed.

protected override void OnStateChanged(DockingWindowState oldValue, DockingWindowState newValue)
Parameter Type Description
oldValue DockingWindowState

The old value.

newValue DockingWindowState

The new value.

UpdateCanAttachResolved()

Updates the CanAttachResolved value.

protected override void UpdateCanAttachResolved()

UpdateCanCloseResolved()

Updates the CanCloseResolved value.

protected override void UpdateCanCloseResolved()

UpdateCanDockResolved()

Updates the CanDockResolved value.

protected override void UpdateCanDockResolved()

UpdateCanDragTabResolved()

Updates the CanDragTabResolved value.

protected override void UpdateCanDragTabResolved()

UpdateCanDragToLinkedDockSitesResolved()

protected override void UpdateCanDragToLinkedDockSitesResolved()

UpdateCanFloatResolved()

Updates the CanFloatResolved value.

protected override void UpdateCanFloatResolved()

Fields

FileNameProperty

Defines the FileName property.

public static readonly StyledProperty<string?> FileNameProperty

IsReadOnlyProperty

Defines the IsReadOnly property.

public static readonly StyledProperty<bool> IsReadOnlyProperty

Inherited Members

Extension Methods