-
Notifications
You must be signed in to change notification settings - Fork 263
Parallels in WPF and WinForms Support
This section shows similarities in WinForms and WPF platforms in application support. For a practical view of similarities and differences, see Converting from WinForms to WPF.
Comparing the contents of similarly named namespaces for those that begin with Sce.Atf
and Sce.Atf.Wpf
, such as Sce.Atf.Applications
and Sce.Atf.Wpf.Applications
, reveals they have similar or identically named classes and interfaces—with similar capabilities. For example, the previously mentioned namespaces both have CommandId
, ErrorDialogService
, LayoutContexts
, and StandardEditCommands
classes. Both have IControlHostClient
, ILayoutContext
, and IViewingContext
interfaces.
In general, to get the same functionality, your WPF application would use or implement the WPF version of the class or interface.
ICommandService
is the same on both platforms. Although each has their own CommandService
class that implements ICommandService
, both inherit from Sce.Atf.Applications.CommandServiceBase
.
DOM support is largely platform agnostic, too. The main difference is that WPF has its own DomRecorder
component, because DomRecorder
has a UI.
Some features are similar in both platforms, but provided in a different way.
For example, both platforms offer window docking. A WinForms ATF application uses WindowLayoutService
to implement a dock, but WPF's docking support is in the namespace Sce.Atf.Wpf.Docking
. Both use IWindowLayoutService
.
Both platforms implement a distinct WindowLayoutServiceCommands
component, but both derive from the common Sce.Atf.Applications.WindowLayoutServiceCommandsBase
.
ATF has WinForms and WPF classes with the same name that provide the same service in a different way. Many of these are MEF components like CommandService
and ControlHostService
. Typically the WinForms classes reside in Sce.Atf.Applications
and the WPF classes in Sce.Atf.Wpf.Applications
.
Many of the sample applications show how to use these MEF components.
This section lists comparable classes with a brief description and cites any pertinent differences for users. In some cases, the differences between the classes are trivial, such as AtfScriptVariables
; in others, the implementation is quite different, as for CommandService
. Generally, they are used in the same fashion in both WinForms and WPF. For information on using ATF components, see Details on Using Selected ATF Components.
-
AtfScriptVariables
: Exposes common ATF services as script variables. -
AutoDocumentService
: Auto-loads a document at application startup. -
CommandService
: Host controls/content and documents. Both derive fromSce.Atf.Applications.CommandServiceBase
, so they both implementSce.Atf.Applications.ICommandService
andSce.Atf.Applications.ICommandClient
. -
ControlHostService
: Both implementSce.Atf.Applications.ICommandClient
andSce.Atf.Applications.IDockStateProvider
. Both also implementIControlHostService
, but this interface is different for the platforms. Both useIControlHostClient
, and it's also different on WinForms and WPF. For control information, WinForms usesControlInfo
, but WPF usesControlDef
, so theRegisterControl()
functions differ. -
ErrorDialogService
: Display error messages to user in an error dialog. Both have the same public API. -
FileDialogService
: Provide file dialogs for an application. Both have the same public API, except WPF has noMainWindow
orMainForm
properties. -
HelpAboutCommand
(WinForms) andHelpCommands
(WPF): Both display a Help About dialog, but WPF also provides support for context-sensitive help and several other help dialogs. -
OutputService
: Display text output to user. WinForms uses aRichTextBox
for output; WPF uses aOutputView
. -
TargetService
: Provides network support for targets. Both implementITargetService
, which is different for WinForms and WPF. -
ThumbnailService
: Manages the transformation of Resources into thumbnail images and file paths. -
UnhandledExceptionService
: Catch all unhandled exceptions and present the user with the option of continuing the application so work can be saved. -
WindowLayoutServiceCommands
: Provides menu options and GUIs for managing and using layouts.
ATF also contains interfaces with the same names in both WinForms and WPF.
In some cases, though the interface name is the same in WinForms and WPF, the two are quite different, and this is noted when it's the case.
-
IControlHostClient
: For control host clients. Essentially the same for both, but in WPF, the parameter isobject
rather thanControl
. -
IControlHostService
: For control host services. In WPF, the parameter for a control isobject
rather thanControl
. For control information, WinForms usesControlInfo
, but WPF usesControlDef
, so theRegisterControl()
functions differ. -
ILayoutConstraint
: Layout constraint, which modifies bounding rectangles. Almost identical interfaces. -
ILayoutContext
: For contexts that support positioning and sizing items. Very similar interfaces. -
IMenu
: Although they have the same name, these interfaces are quite different. The WinForms one is for menus, but the WPF one is for root menu models. -
IPaletteService
: Although the same name, very different. The WinForms one allows you to add and remove palette items, but the WPF one converts a palette item to an object. For examples of their use, see ATF Simple DOM Editor Sample and ATF Simple DOM Editor WPF Sample. -
IStatusService
: For service that manages a status display. Rather different interfaces. Both show status and monitor progress, but do it differently. The WinForms version has more capability. -
ITarget
: Although both interfaces deal with targets, the WinForms one deals with devices available via Deci4p. The WPF one is more generic and offers more members. -
ITargetService
: Both work with targets, but differ substantially. The WinForms version is larger and manages various targets; the WPF one deals only withITarget
s. -
IThumbnailResolver
: For thumbnail resolvers. They are both simple but theirResolve()
methods differ. -
IViewingContext
: Both are for contexts where items can be viewed, but offer very different capabilities. The WinForms version is concerned about framing objects and ensuring their visibility, but the WPF one is about getting adapters and layout constraints.
- Home
- Getting Started
- Features & Benefits
- Requirements & Dependencies
- Gallery
- Technology & Samples
- Adoption
- News
- Release Notes
- ATF Community
- Searching Documentation
- Using Documentation
- Videos
- Tutorials
- How To
- Programmer's Guide
- Reference
- Code Samples
- Documentation Files
© 2014-2015, Sony Computer Entertainment America LLC