Interface IWindowService
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
stringThe title of the dialog
message
stringThe message of the dialog
confirm
stringThe text of the confirm button
cancel
stringThe text of the cancel button, if null the cancel button will not be shown
Returns
ShowDialogAsync(object)
Given a ViewModel, show its corresponding View as a dialog
Task ShowDialogAsync(object viewModel)
Parameters
viewModel
objectViewModel to show the View for
Returns
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
ShowWindow(object)
Given a ViewModel, show its corresponding View as a window
Window ShowWindow(object viewModel)
Parameters
viewModel
objectViewModel 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
TViewModelparameters
object[]
Returns
- Window
The created view model
Type Parameters
TViewModel
The type of view model to create