WinForms and WPF Apps Programming Discussion - kaisu1986/ATF GitHub Wiki

Table of Contents

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.

Programming Overview

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.

Application's 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, and SchemaLoader.
  • 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.
What was left out from the Simple DOM Editor:
  • Palette window.
  • Resources window.
  • DOM node search, including GenericSelectionContext.
  • Help.
In what remains, Simple DOM Editor was translated into these samples' common code mainly by changing from "EventSequence" to "WinGuiCommonData" in file names, type names, class names, and so forth. For example, the WinGuiCommonData class corresponds to the EventSequence DOM adapter.

There are other minor differences as well, such as changing the extension of documents to ".gad".

WinForms Application

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.
For more information on developing a WinForms application with ATF, see WinForms Application.

WPF Application

Similarly, Wpf App shows a typical WPF application. It has these things:

  • A WpfApp.App class, defined in App.xaml, derived from the ATF class AtfApp.
  • MEF initialization if using MEF, defined in App.xaml.cs.
For a fuller description of creating an ATF application for WPF, see WPF Application.

Topics in this section

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