WinForms and WPF Apps Programming Discussion - kaisu1986/ATF GitHub Wiki
These two applications are very simplified versions of the ATF Simple DOM Editor Sample, whose coding is described in detail in Simple DOM Editor Programming Discussion. These samples are adapted somewhat along the lines of the application developed starting with the Simple DOM Editor, described in Creating an Application from an ATF Sample.
The main point of these samples is to show how to develop both WinForms and WPF samples using ATF. The same ATF techniques are used as in Simple DOM Editor, so these two samples don't illustrate anything additional about ATF, per se.
This page discusses what the common code for the two samples has in common with and how it differs from the ATF Simple DOM Editor Sample's code. The page also mentions the two samples' individual code, which is much smaller than their common code.
The bulk of the code in both ATF Win Forms App Sample and ATF Wpf App Sample is in common in the WinGuiCommon
folder in the applications' source. Their common code provides nearly all the functionality of the samples, and demonstrates that ATF works well in both WinForms and WPF. This common code was taken from the ATF Simple DOM Editor Sample.
What was kept from the Simple DOM Editor:
- Data model definition, in both the XML Schema,
Schema
class, andSchemaLoader
. - Main editor window with
ListView
control. - Document class and client.
- DOM adapters for event, resource, and event sequence types.
- Contexts for events and event sequences.
- Editor for main
ListView
.
- Palette window.
- Resources window.
- DOM node search, including
GenericSelectionContext
. - Help.
WinGuiCommonData
class corresponds to the EventSequence
DOM adapter.
There are other minor differences as well, such as changing the extension of documents to ".gad".
The Win Forms App illustrates a typical WinForms application. It does the following:
- Initialization, such as calling appropriate
Application
class methods. - Setting up MEF
TypeCatalog
, if using MEF. - Creating a
MainForm
and running it.
Similarly, Wpf App shows a typical WPF application. It has these things:
- A
WpfApp.App
class, defined inApp.xaml
, derived from the ATF classAtfApp
. - MEF initialization if using MEF, defined in
App.xaml.cs
.