![]() ![]() The Window-derived class can then be consumed by creating a MyWindow object in the CreateWindow override in your App class. In addition, you can also create your own Window-derived object: namespace MyMauiApp While the Window class has a default constructor and a constructor that accepts a Page argument, which represents the root page of the app, you can also call the base CreateWindow method to return the. Window window = base.CreateWindow(activationState) Protected override Window CreateWindow(IActivationState activationState) However, you can also override the CreateWindow method in your App class to create a Window object: namespace MyMauiApp NET MAUI creates a Window object when you set the MainPage property to a Page object in your App class. This property can be accessed from any page, layout, or view, to manipulate Window objects. The VisualElement class has a Window property that exposes the parent Window object. PopCanceled, which is raised when a modal pop is cancelled.ModalPushing, with ModalPushingEventArgs, which is raised when a view is modally pushed.ModalPushed, with ModalPushedEventArgs, which is raised after a view has been pushed modally.ModalPopping, with ModalPoppingEventArgs, which is raised when a view is modally popped.ModalPopped, with ModalPoppedEventArgs, which is raised when a view has been popped modally.The Window class also defines the following modal navigation events: DisplayDensit圜hanged, with an accompanying DisplayDensit圜hangedEventArgs object, which is raised on Android and Windows when the effective dots per inch (DPI) for the window has changed.įor more information about the lifecycle events, and their associated overrides, see App lifecycle.When the window is resumed the state is provided via the IActivationState argument to the CreateWindow method. This event can be used to persist any string state to the State property of the BackgroundingEventArgs object, which the OS will preserve until it's time to resume the window. Backgrounding, with an accompanying BackgroundingEventArgs object, which is raised on iOS and Mac Catalyst when the window is closed or enters a background state. ![]() SizeChanged, which is raised on desktop platforms when the window changes size.Destroying, which is raised when the window is destroyed.Stopped, which is raised when the window is stopped.Deactivated, which is raised when the window is deactivated.Activated, which is raised when the window is activated.Resumed, which is raised when the window is resumed from a sleeping state.Created, which is raised when the window is created.The Window class defines the following events: These properties, with the exception of the Overlays property, are backed by BindableProperty objects, which means that they can be targets of data bindings, and styled. Y, of type double, specifies the Y coordinate of the window on Windows.X, of type double, specifies the X coordinate of the window on Windows.Width, of type double, specifies the width of the window on Windows.Title, of type string, represents the title of the window.This property is the content property of the Window class, and therefore does not need to be explicitly set. Page, of type Page, indicates the page being displayed by the window.Overlays, of type IReadOnl圜ollection, represents the collection of window overlays.Valid values are between 0 and double.PositiveInfinity. MinimumWidth, of type double, represents the minimum width of the window on desktop platforms.MinimumHeight, of type double, represents the minimum height of the window on desktop platforms.MaximumWidth, of type double, represents the maximum width of the window on desktop platforms.MaximumHeight, of type double, represents the maximum height of the window on desktop platforms.Height, of type double, specifies the height of the window on Windows.FlowDirection, of type FlowDirection, defines the direction in which the UI element of the window are laid out.NET Multi-platform App UI (.NET MAUI) Window class provides the ability to create, configure, show, and manage multiple windows. ![]()
0 Comments
Leave a Reply. |