Window Class

Definition

public ref class Window : Microsoft::Maui::Controls::NavigableElement, Microsoft::Maui::IMenuBarElement, Microsoft::Maui::IToolbarElement, Microsoft::Maui::IVisualTreeElement, Microsoft::Maui::IWindow
public ref class Window : Microsoft::Maui::Controls::NavigableElement, Microsoft::Maui::IMenuBarElement, Microsoft::Maui::IToolbarElement, Microsoft::Maui::IWindow
[Microsoft.Maui.Controls.ContentProperty("Page")]
public class Window : Microsoft.Maui.Controls.NavigableElement, Microsoft.Maui.IMenuBarElement, Microsoft.Maui.IToolbarElement, Microsoft.Maui.IVisualTreeElement, Microsoft.Maui.IWindow
[Microsoft.Maui.Controls.ContentProperty("Page")]
public class Window : Microsoft.Maui.Controls.NavigableElement, Microsoft.Maui.IMenuBarElement, Microsoft.Maui.IToolbarElement, Microsoft.Maui.IWindow
[<Microsoft.Maui.Controls.ContentProperty("Page")>]
type Window = class
    inherit NavigableElement
    interface IWindow
    interface ITitledElement
    interface IElement
    interface IVisualTreeElement
    interface IToolbarElement
    interface IMenuBarElement
[<Microsoft.Maui.Controls.ContentProperty("Page")>]
type Window = class
    inherit NavigableElement
    interface IWindow
    interface ITitledElement
    interface IElement
    interface IToolbarElement
    interface IMenuBarElement
Public Class Window
Inherits NavigableElement
Implements IMenuBarElement, IToolbarElement, IVisualTreeElement, IWindow
Public Class Window
Inherits NavigableElement
Implements IMenuBarElement, IToolbarElement, IWindow
Inheritance
Attributes
Implements

Constructors

Window()
Window(Page)

Fields

ControlsWindowMapper
FlowDirectionProperty

Bindable property for FlowDirection.

HeightProperty

Bindable property for Height.

MaximumHeightProperty

Bindable property for MaximumHeight.

MaximumWidthProperty

Bindable property for MaximumWidth.

MinimumHeightProperty

Bindable property for MinimumHeight.

MinimumWidthProperty

Bindable property for MinimumWidth.

PageProperty

Bindable property for Page.

TitleProperty

Bindable property for Title.

WidthProperty

Bindable property for Width.

XProperty

Bindable property for X.

YProperty

Bindable property for Y.

Properties

AutomationId

Gets or sets a value that allows the automation framework to find and interact with this element.

(Inherited from Element)
BindingContext

Gets or sets an object that contains the properties that will be targeted by the bound properties that belong to this BindableObject. This is a bindable property.

(Inherited from BindableObject)
class (Inherited from NavigableElement)
ClassId

Gets or sets a value used to identify a collection of semantically similar elements.

(Inherited from Element)
Dispatcher

Gets the dispatcher that was available when this bindable object was created, otherwise tries to find the nearest available dispatcher (probably the window's/app's).

(Inherited from BindableObject)
DisplayDensity
EffectControlProvider

For internal use by .NET MAUI.

(Inherited from Element)
Effects

Gets or sets the styles and properties that will be applied to the element during runtime.

(Inherited from Element)
FlowDirection
Handler

Gets or sets the associated handler for this element.

(Inherited from Element)
Height
Id

Gets a value that can be used to uniquely identify an element throughout the run of your application.

(Inherited from Element)
LogicalChildren
Obsolete.

For internal use by the Microsoft.Maui.Controls platform.

(Inherited from Element)
MaximumHeight
MaximumWidth
MinimumHeight
MinimumWidth
Navigation (Inherited from NavigableElement)
NavigationProxy (Inherited from NavigableElement)
Overlays
Page
Parent

Gets or sets the parent Element of this element.

(Inherited from Element)
RealParent

For internal use by .NET MAUI.

(Inherited from Element)
Style (Inherited from NavigableElement)
StyleClass (Inherited from NavigableElement)
StyleId

Gets or sets a user defined value to uniquely identify the element.

(Inherited from Element)
Title
VisualDiagnosticsOverlay
Width
X
Y

Methods

AddLogicalChild(Element)

Adds an Element to the logical children.

(Inherited from Element)
AddOverlay(IWindowOverlay)

Adds a Window Overlay to the current Window.

ApplyBindings()

Applies all the current bindings to BindingContext.

(Inherited from BindableObject)
ClearLogicalChildren()

Removes all child Elements.

(Inherited from Element)
ClearValue(BindableProperty)

Clears any value that is previously set for a bindable property.

(Inherited from BindableObject)
ClearValue(BindablePropertyKey)

Clears any value that is previously set for a bindable property, identified by its key.

(Inherited from BindableObject)
CoerceValue(BindableProperty)

Coerces the value of the specified bindable property. This is done by invoking BindableProperty.CoerceValueDelegate of the specified bindable property.

(Inherited from BindableObject)
CoerceValue(BindablePropertyKey)

Coerces the value of the specified bindable property. This is done by invoking BindableProperty.CoerceValueDelegate of the specified bindable property.

(Inherited from BindableObject)
EffectIsAttached(String)

For internal use by .NET MAUI.

(Inherited from Element)
FindByName(String)

Returns the element that has the specified name.

(Inherited from Element)
GetValue(BindableProperty)

Returns the value that is contained in the given bindable property.

(Inherited from BindableObject)
InsertLogicalChild(Int32, Element)

Inserts an Element to the logical children at the specified index.

(Inherited from Element)
IsSet(BindableProperty)

Determines whether or not a bindable property exists and has a value set.

(Inherited from BindableObject)
OnActivated()
OnBackgrounding(IPersistedState)
OnBindingContextChanged()

Invoked whenever the binding context of the element changes. Implement this method to add class handling for this event.

(Inherited from Element)
OnChildAdded(Element)

Raises the ChildAdded event. Implement this method to add class handling for this event.

(Inherited from Element)
OnChildRemoved(Element, Int32)

Raises the ChildRemoved event. Implement this method to add class handling for this event

(Inherited from Element)
OnCreated()
OnDeactivated()
OnDestroying()
OnDisplayDensityChanged(Single)
OnHandlerChanged()

When overridden in a derived class, should raise the HandlerChanged event.

(Inherited from Element)
OnHandlerChanging(HandlerChangingEventArgs)

When overridden in a derived class, should raise the HandlerChanging event.

(Inherited from Element)
OnParentChanged()

When overridden in a derived class, should raise the ParentChanged event.

(Inherited from Element)
OnParentChanging(ParentChangingEventArgs)

When overridden in a derived class, should raise the ParentChanging event.

(Inherited from Element)
OnParentSet() (Inherited from NavigableElement)
OnPropertyChanged(String)
OnPropertyChanging(String)

Raises the PropertyChanging event.

(Inherited from BindableObject)
OnResumed()
OnStopped()
RemoveBinding(BindableProperty)

Removes a previously set binding from a bindable property.

(Inherited from BindableObject)
RemoveDynamicResource(BindableProperty)

Removes a previously set dynamic resource.

(Inherited from Element)
RemoveLogicalChild(Element)

Removes the first occurrence of a specific Element from the logical children.

(Inherited from Element)
RemoveOverlay(IWindowOverlay)

Removes a Window Overlay to the current Window.

SetBinding(BindableProperty, BindingBase)

Assigns a binding to a bindable property.

(Inherited from BindableObject)
SetDynamicResource(BindableProperty, String)

Sets the BindableProperty property of this element to be updated via the DynamicResource with the provided key.

(Inherited from Element)
SetValue(BindableProperty, Object)

Sets the value of the specified bindable property.

(Inherited from BindableObject)
SetValue(BindablePropertyKey, Object)

Sets the value of the specified bindable property.

(Inherited from BindableObject)
SetValueCore(BindableProperty, Object, SetValueFlags)

For internal use by the Microsoft.Maui.Controls platform.

(Inherited from BindableObject)
SetValueFromRenderer(BindableProperty, Object)

For internal use by .NET MAUI.

(Inherited from Element)
SetValueFromRenderer(BindablePropertyKey, Object)

For internal use by .NET MAUI.

(Inherited from Element)
UnapplyBindings()

Removes all current bindings from the current context.

(Inherited from BindableObject)

Events

Activated
Backgrounding
BindingContextChanged

Occurs when the value of the BindingContext property changes.

(Inherited from BindableObject)
ChildAdded

Raised whenever a child element is added to the element.

(Inherited from Element)
ChildRemoved

Raised whenever a child element is removed from the element.

(Inherited from Element)
Created
Deactivated
DescendantAdded

Raised whenever a child element is added to the element's subtree.

(Inherited from Element)
DescendantRemoved

Raised whenever a child element is removed from the elements subtree.

(Inherited from Element)
Destroying
DisplayDensityChanged
HandlerChanged

Raised whenever the element's handler has changed.

(Inherited from Element)
HandlerChanging

Raised whenever the element's handler starts to change.

(Inherited from Element)
ModalPopped
ModalPopping
ModalPushed
ModalPushing
ParentChanged

Raised whenever the element's parent has changed.

(Inherited from Element)
ParentChanging

Raised whenever the element's starts to change.

(Inherited from Element)
PopCanceled
PropertyChanged

Occurs when a property value changes.

(Inherited from BindableObject)
PropertyChanging

Occurs when a property value is changing.

(Inherited from BindableObject)
Resumed
SizeChanged
Stopped

Explicit Interface Implementations

IContextFlyoutElement.ContextFlyout

Gets the ContextFlyout for the view. Menu flyouts, menu flyout subitems, and menu flyout separators can be added to the context flyout.

(Inherited from Element)
IDynamicResourceHandler.SetDynamicResource(BindableProperty, String) (Inherited from BindableObject)
IEffectControlProvider.RegisterEffect(Effect) (Inherited from Element)
IElement.Parent

Gets the Parent of the Element.

(Inherited from Element)
IElementController.Descendants()

For internal use by .NET MAUI.

(Inherited from Element)
IElementController.LogicalChildren

For internal use by .NET MAUI.

(Inherited from Element)
IElementController.SetValueFromRenderer(BindableProperty, Object)

For internal use by .NET MAUI.

(Inherited from Element)
IMenuBarElement.MenuBar
INameScope.RegisterName(String, Object)

For internal use by .NET MAUI.

(Inherited from Element)
INameScope.UnregisterName(String)

For internal use by .NET MAUI.

(Inherited from Element)
ITitledElement.Title
IToolbarElement.Toolbar
IToolTipElement.ToolTip

Represents a small rectangular pop-up window that displays a brief description of a view's purpose when the user rests the pointer on the view.

(Inherited from Element)
IVisualTreeElement.GetVisualChildren()
IVisualTreeElement.GetVisualChildren()

Gets a readonly list of the element's visual children.

(Inherited from Element)
IVisualTreeElement.GetVisualParent()

Gets the element's visual parent.

(Inherited from Element)
IWindow.Activated()
IWindow.BackButtonClicked()
IWindow.Backgrounding(IPersistedState)
IWindow.Content
IWindow.Created()
IWindow.Deactivated()
IWindow.Destroying()
IWindow.DisplayDensityChanged(Single)
IWindow.FlowDirection
IWindow.FrameChanged(Rect)
IWindow.Height
IWindow.MaximumHeight
IWindow.MaximumWidth
IWindow.MinimumHeight
IWindow.MinimumWidth
IWindow.RequestDisplayDensity()
IWindow.Resumed()
IWindow.Stopped()
IWindow.Width
IWindow.X
IWindow.Y

Extension Methods

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)
SetAppTheme<T>(BindableObject, BindableProperty, T, T)
SetAppThemeColor(BindableObject, BindableProperty, Color, Color)
SetBinding(BindableObject, BindableProperty, String, BindingMode, IValueConverter, String)

Creates and applies a binding to a property.

FindByName<T>(Element, String)
ToHandler(IElement, IMauiContext)
ToPlatform(IElement, IMauiContext)
GetVisualElementWindow(IVisualTreeElement)

Gets the Window containing the Visual Tree Element, if the element is contained within one.

GetVisualTreeDescendants(IVisualTreeElement)

Gets the entire hierarchy of descendants as a list of children for a given Visual Tree Element.

GetVisualTreeElements(IVisualTreeElement, Point)

Gets list of a Visual Tree Element's children based off of a given Point.

GetVisualTreeElements(IVisualTreeElement, Rect)

Gets list of a Visual Tree Elements children based off of a rectangle.

GetVisualTreeElements(IVisualTreeElement, Double, Double)

Gets list of a Visual Tree Elements children based off of a given x, y point.

GetVisualTreeElements(IVisualTreeElement, Double, Double, Double, Double)

Gets list of a Visual Tree Elements children based off of a rectangle defined by its coordinates which are specified in platform units, not pixels.

CaptureAsync(IWindow)

Applies to