Table of Contents

Interface IWindowService

Namespace
Tudormobile.Wpf.Services
Assembly
Tudormobile.WpfApp.dll

Window management service.

public interface IWindowService : IWpfAppService
Inherited Members

Properties

Windows

Collection of application windows created by the service.

ObservableCollection<Window> Windows { get; }

Property Value

ObservableCollection<Window>

Remarks

The service will attempt to maintain the application MainWindow as the first item in this collection. Windows created by the service will be added automatically to this collection, and removed when they are closed.

Methods

CreateWindow(Type)

Creates a new application window to be managed by the service. The DataContext of the window will be inferred from the view type if set via the DI container for the Window.

Window CreateWindow(Type windowType)

Parameters

windowType Type

The application window type.

Returns

Window

A reference to the created window.

CreateWindow(Type, Type)

Creates a new application window to be managed by the service. The DataContext of the window will be inferred from the view type if set via the DI container for the Window.

Window CreateWindow(Type windowType, Type modelType)

Parameters

windowType Type

The application window type.

modelType Type

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

Returns

Window

CreateWindow<TView>()

Creates a new application window to be managed by the service. The DataContext of the window will be inferred from the view type if set via the DI container for the Window.

Window CreateWindow<TView>() where TView : Window

Returns

Window

A reference to the created window.

Type Parameters

TView

The application window type.

CreateWindow<TView, TViewModel>()

Creates a new application window to be managed by the service. The DataContext of the window will be set to the specified view model type.

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.

ShowDialog(Window)

Opens a window and returns only when the newly opened window is closed.

bool? ShowDialog(Window window)

Parameters

window Window

Window to show.

Returns

bool?

A bool? value that specifies whether the activity was accepted (true) or canceled (false)

ShowWindow(Window)

Opens a window and returns without waiting for the newly opened window to close.

void ShowWindow(Window window)

Parameters

window Window

Window to open.