Back to Devexpress

XafApplication.MainWindow Property

expressappframework-devexpress-dot-expressapp-dot-xafapplication-b59c38a5.md

latest3.1 KB
Original Source

XafApplication.MainWindow Property

Provides access to the application’s main Window.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
[Browsable(false)]
public virtual Window MainWindow { get; }
vb
<Browsable(False)>
Public Overridable ReadOnly Property MainWindow As Window

Property Value

TypeDescription
Window

A Window object that represents the current application’s main Window.

|

Remarks

A main Window is the Window which is first displayed when starting the application (except the logon Window). This Window contains the base features of the application. To determine whether a Window is main use the Window.IsMain property.

You can customize the main Window. For this purpose, access it via the MainWindow property.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MainWindow property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-win-custom-button-in-lookup-property-editor/CS/WinSolution.Module.Win/MyLookupPropertyEditor.cs#L36

csharp
svp.CreateAllControllers = true;
ShowViewSource svs = new ShowViewSource(Helper.Application.MainWindow, null);
Helper.Application.ShowViewStrategy.ShowView(svp, svs);

xaf-win-custom-button-in-lookup-property-editor/VB/WinSolution.Module.Win/MyLookupPropertyEditor.vb#L43

vb
svp.CreateAllControllers = True
Dim svs As ShowViewSource = New ShowViewSource(Helper.Application.MainWindow, Nothing)
Helper.Application.ShowViewStrategy.ShowView(svp, svs)

See Also

XafApplication Class

XafApplication Members

DevExpress.ExpressApp Namespace