ATF Wpf App Sample - kaisu1986/ATF GitHub Wiki
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.
- Use of Managed Extensibility Framework (MEF) to put applications together.
- Use of the application shell framework, including
CommandService
,SettingsService
,ControlHostService
andWindowLayoutService
. - Show loading a schema with
SchemaLoader
.
- Double-click the
WpfApp.exe
inATF\Samples\WpfApp\bin\Release
. - A dialog appears with a list box for application data.

- 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.
- Layouts:
.gad
) file.
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.
Modules perform these functions:
-
App.xaml.cs
: ContainsApp
class deriving fromAtfApp
. It creates aTypeCatalog
listing the ATF and internal classes used. -
Editors.cs
: ImplementsIDocumentClient
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 andPropertyDescriptor
objects. -
EventContext.cs
andWinGuiCommonDataContext.cs
: Provide a context for data.