Table of Contents

Interface IWpfApp

Namespace
Tudormobile.Wpf
Assembly
Tudormobile.WpfApp.dll

Defines an interface to manage a Wpf Application.

public interface IWpfApp

Remarks

The IWpfApp interface includes mechanisms to configure a Wpf application, manage the application lifecycle, application level events, application services, and serves as a dependency injection container for a Wpf application.

Properties

CommandLine

Represents the command line and its arguments.

ICommandLine CommandLine { get; }

Property Value

ICommandLine

DialogService

Returns an instance of a dialog service.

IDialogService DialogService { get; }

Property Value

IDialogService

Windows

Collection of application windows managed by the host.

ObservableCollection<Window> Windows { get; }

Property Value

ObservableCollection<Window>

Methods

CreateView(Type, Type?)

Creates a view, view model, and sets the data context of the view to the view model.

FrameworkElement CreateView(Type viewType, Type? viewModelType = null)

Parameters

viewType Type

Type of view.

viewModelType Type

Type of view model.

Returns

FrameworkElement

A framework element of type TView.

Remarks

The view model type is inferred by convention or registration.

CreateView<TView>()

Creates a view, view model, and sets the data context of the view to the view model.

FrameworkElement CreateView<TView>() where TView : FrameworkElement

Returns

FrameworkElement

A framework element of type TView.

Type Parameters

TView

Type of view.

Remarks

The view model type is inferred by convention or registration.

CreateView<TView, TViewModel>()

Creates a view, view model, and sets the data context of the view to the view model.

FrameworkElement CreateView<TView, TViewModel>() where TView : FrameworkElement where TViewModel : class

Returns

FrameworkElement

A framework element of type TView.

Type Parameters

TView

Type of view.

TViewModel

Type of view model.

CreateWindow<TView, TViewModel>()

Creates a new application window to be managed by the host.

Window CreateWindow<TView, TViewModel>() where TView : Window where TViewModel : class

Returns

Window

A reference to the created window.

Type Parameters

TView

The application window type.

TViewModel

The type of view model to use as the Data Context for the window.

Start()

Starts the application host.

Task Start()

Returns

Task

A Task that will be completed when the Host starts.

Start<T>()

Starts the application host.

Task Start<T>() where T : Window

Returns

Task

A Task that will be completed when the Host starts.

Type Parameters

T

Main Window type.