Table of Contents

Interface IWindowService

Namespace
Artemis.UI.Shared.Services
Assembly
Artemis.UI.Shared.dll

A service that can be used to show windows and dialogs.

public interface IWindowService : IArtemisSharedUIService

Methods

CreateContentDialog()

Creates a content dialog, use the fluent API to configure it

ContentDialogBuilder CreateContentDialog()

Returns

ContentDialogBuilder

The builder that can be used to configure the dialog

CreateOpenFileDialog()

Creates an open file dialog, use the fluent API to configure it

OpenFileDialogBuilder CreateOpenFileDialog()

Returns

OpenFileDialogBuilder

The builder that can be used to configure the dialog

CreateOpenFolderDialog()

Creates an open folder dialog, use the fluent API to configure it

OpenFolderDialogBuilder CreateOpenFolderDialog()

Returns

OpenFolderDialogBuilder

The builder that can be used to configure the dialog

CreateSaveFileDialog()

Creates a save file dialog, use the fluent API to configure it

SaveFileDialogBuilder CreateSaveFileDialog()

Returns

SaveFileDialogBuilder

The builder that can be used to configure the dialog

GetCurrentWindow()

Gets the current window of the application

Window? GetCurrentWindow()

Returns

Window

The current window of the application

ShowConfirmContentDialog(string, string, string, string?)

Shows a content dialog asking the user to confirm an action

Task<bool> ShowConfirmContentDialog(string title, string message, string confirm = "Confirm", string? cancel = "Cancel")

Parameters

title string

The title of the dialog

message string

The message of the dialog

confirm string

The text of the confirm button

cancel string

The text of the cancel button, if null the cancel button will not be shown

Returns

Task<bool>

A task containing the result of the dialog, true if confirmed; otherwise false

ShowDialogAsync(object)

Given a ViewModel, show its corresponding View as a dialog

Task ShowDialogAsync(object viewModel)

Parameters

viewModel object

ViewModel to show the View for

Returns

Task

ShowDialogAsync<TResult>(DialogViewModelBase<TResult>)

Given an existing ViewModel, show its corresponding View as a Dialog

Task<TResult> ShowDialogAsync<TResult>(DialogViewModelBase<TResult> viewModel)

Parameters

viewModel DialogViewModelBase<TResult>

ViewModel to show the View for

Returns

Task<TResult>

A task containing the return value of type TResult

Type Parameters

TResult

The return type

ShowDialogAsync<TViewModel>(params object[])

Creates a view model instance of type TViewModel and shows its corresponding View as a dialog

Task<TViewModel> ShowDialogAsync<TViewModel>(params object[] parameters)

Parameters

parameters object[]

Returns

Task<TViewModel>

The created view model

Type Parameters

TViewModel

The type of view model to create

ShowDialogAsync<TViewModel, TResult>(params object[])

Creates a view model instance of type TViewModel and shows its corresponding View as a Dialog

Task<TResult> ShowDialogAsync<TViewModel, TResult>(params object[] parameters) where TViewModel : DialogViewModelBase<TResult>

Parameters

parameters object[]

Returns

Task<TResult>

A task containing the return value of type TResult

Type Parameters

TViewModel

The view model type

TResult

The return type

ShowExceptionDialog(string, Exception)

Shows a dialog displaying the given exception

void ShowExceptionDialog(string title, Exception exception)

Parameters

title string

The title of the dialog

exception Exception

The exception to display

ShowWindow(object)

Given a ViewModel, show its corresponding View as a window

Window ShowWindow(object viewModel)

Parameters

viewModel object

ViewModel to show the View for

Returns

Window

ShowWindow<TViewModel>(out TViewModel, params object[])

Creates a view model instance of type TViewModel and shows its corresponding View as a window

Window ShowWindow<TViewModel>(out TViewModel viewModel, params object[] parameters)

Parameters

viewModel TViewModel
parameters object[]

Returns

Window

The created view model

Type Parameters

TViewModel

The type of view model to create