Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
  [Expand]Business Model Design
  [Expand]Application Model
  [Collapse]UI Construction
    UI Element Overview
    Windows and Frames
   [Expand]Templates
    Action Containers
   [Expand]Views
   [Expand]View Items
    List Editors
    Add and Override Images
    Text Notifications
    ASP.NET Web Application Appearance
    Application Personalization
    Using a Custom Control that is not Integrated by Default
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Windows and Frames

Windows automatically generated by the eXpressApp Framework are defined by two objects: a control called Template and an abstract entity called Window. Similarly, lookup windows and embedded List Views are represented by a Template and Frame pair. A Window or Frame, in contrast to a Template, does not contain information on what controls must be located on it. Windows and Frames only include the information concerning their functions in the eXpressApp Framework applications. This topic provides detailed information about these abstract UI entities. For information on Templates, refer to the Templates topic.

Expanded Windows and Frames Overview

A Frame is defined by the Frame class; a Window, by the Window class. The Frame class is the base class of the Window. The difference between these classes is that a Window is an independent UI element, while a Frame has a parent. For instance, a main form and detail forms are defined by the Window class. A lookup editor's drop down window and embedded List Editor are defined by the Frame class.

XAF does not use Window class directly. In fact, Windows Forms and ASP.NET Web applications create the WinWindow and WebWindow class instances respectively. These are Window class descendants. You can use the Window type in the UI independent code, and cast it to the WinWindow and WebWindow types in the UI specific code.

The base functions of Windows and Frames are:

  • Both of them serve as a site for a View.
    Business applications are mainly intended to view and edit data. That's why the default eXpressApp Framework application contains only Windows with Views. A Window itself in eXpressApp Framework is not useful to you. When building applications, you primarily refer to a Window to access its View. To do this, use a Window's or Frame's Frame.View property. When implementing a custom feature, you may need to set another View to a particular Window. To do this, use one of the Frame.SetView method overloads.
  • Both of them allow you to perform custom actions when they are being created or destroyed.
    When Windows and Frames are being created, they locate all appropriate Controllers and register them in their Frame.Controllers collection. Controllers, in turn, provide events that let you execute specific actions when creating or deleting the owner Window or Frame. Controllers are not shared between different Windows/Frames. An Controller instances are created for each Window and Frame individually.

Windows (Frames) are displayed in a UI via Templates. A Template displays both the actions of the window's Controllers and a View. You can access the template via the window's Window.Template (Frame.Template) property, and customize this template. For information on template customization, refer to the Template Customization topic.

Expanded Access Windows and Frames

When a Window or a Frame is created, it finds all Controllers related to it. To access them, you can use the desired Window's or Frame's Frame.Controllers property. However, in most cases you will need to perform the opposite operation. Since you will write code within Controller classes, you will need to access the current Window or Frame that owns a particular Controller. To learn how to do this, see the following list.

  • WindowController
    Window Controllers are objects that allow executing custom code when Windows are being created and destroyed. That is, you can override their protected OnWindowChanging method, handle the Controller.Activated and Controller.Deactivated events. In these event handlers, you can access the corresponding Window using the Controller's WindowController.Window property.
  • ViewController
    View controllers are objects that allow executing custom code when Frames are being created and destroyed. That is, you can handle their Controller.Activated and Controller.Deactivated events. In these event handlers, you can access the corresponding Frame using the Controller's Controller.Frame property. Of course, you can cast the Frame to the Window class, if the currently processed Frame is a Window.
  • Controller
    If a feature cannot be implemented via a Window Controller or a View Controller, you can create a custom controller by declaring a Controller class descendant. Every time a Frame is created, XAF calls each Controller's OnFrameAssigned method. Override this method to access the Frame or Window that is being created.

Expanded See Also

How would you rate this topic?​​​​​​​