ATF Wpf App Sample - kaisu1986/ATF GitHub Wiki

Table of Contents

Description

WpfApp is a a basic WPF sample application. It illustrates how to compose a WPF application with ATF components using MEF. It is a starting point for an application, such as an editor, though WpfApp does not offer any editing capabilities.

The WpfApp sample shares much code with the WinFormsApp sample, so the two provide a similar set of capabilities. In fact, the two applications differ by only a few files; the bulk of the application code is in common. This demonstrates the ease of developing an ATF application and converting it from WinForms to WPF or vice versa.

For details on programming in the sample, see WinForms and WPF Apps Programming Discussion.

ATF Features Demonstrated by WpfApp

  • Use of Managed Extensibility Framework (MEF) to put applications together.
  • Use of the application shell framework, including CommandService, SettingsService, ControlHostService and WindowLayoutService.
  • Show loading a schema with SchemaLoader.

Run WpfApp

  1. Double-click the WpfApp.exe in ATF\Samples\WpfApp\bin\Release.
  2. A dialog appears with a list box for application data.

Menu and Toolbar Options

  • File: create a new or open an existing Gui App Data (.gad) file, Save, Save as, Save all, Close and Exit WpfApp.
  • Edit:
    • Preferences: set application preferences, such as auto-loading a new document.
    • Load or Save Settings: use the Load and Save Settings window to save current WpfApp application settings or load application settings from a file.
  • Window:
    • Layouts:
      • Save Layout As...: associate the current layout with a name.
      • Manage Layouts...: show a list of layouts and manage the list.
    • List of checked menu items; check to activate the corresponding control.
The toolbar offers a subset of these capabilities: File commands to save, save as, save all, create a new, or open existing Gui App Data (.gad) file.

How to Use WpfApp

WpfApp provides a schema with event, animation and other types; it also has the capability of loading a schema. WpfApp also has code to handle events and resources involving DomNode objects. However, it does not provide editing capabilities for creating or changing application data.

WpfApp Modules

Modules perform these functions:

  • App.xaml.cs: Contains App class deriving from AtfApp. It creates a TypeCatalog listing the ATF and internal classes used.
  • Editors.cs: Implements IDocumentClient to open, show, save and close documents.
  • SchemaLoader.cs: Loads the event schema, registers data extensions on the DOM types, annotates the types with display information and PropertyDescriptor objects.
  • EventContext.cs and WinGuiCommonDataContext.cs: Provide a context for data.

Topics in this section

⚠️ **GitHub.com Fallback** ⚠️