C# Class System.Windows.Mvvm.Services.Dialog.DialogService

Represents a service for viewing dialogs. This is needed to abstract away the details from the view models, so that the view models can be unit tested better (view models should not have any dependencies to view code).
Exibir arquivo Open project: lecode-official/mvvm-framework

Public Methods

Method Description
DialogService ( ApplicationService applicationService ) : Microsoft.Win32

Initializes a new DialogService instance.

ShowFolderBrowseDialogAsync ( string description ) : Task>

Displays a folder browser dialog to the user.

ShowMessageBoxDialogAsync ( string message, string title, MessageBoxButton messageBoxButton, MessageBoxIcon messageBoxIcon ) : Task

Displays a message box to the user.

ShowOpenFileDialogAsync ( string title, IEnumerable filter, bool isMultiselect ) : Task>>

Displays a file open dialog to the user.

ShowOpenFileDialogAsync ( string title, IEnumerable filter ) : Task>

Displays a file open dialog to the user.

ShowSaveFileDialogAsync ( string title, IEnumerable filter, string defaultExtension ) : Task>

Displays a file save dialog to the user.

Method Details

DialogService() public method

Initializes a new DialogService instance.
public DialogService ( ApplicationService applicationService ) : Microsoft.Win32
applicationService System.Windows.Mvvm.Services.Application.ApplicationService A service, which can be used to manage the application life-cycle.
return Microsoft.Win32

ShowFolderBrowseDialogAsync() public method

Displays a folder browser dialog to the user.
public ShowFolderBrowseDialogAsync ( string description ) : Task>
description string The description that is displayed inside the folder browser dialog.
return Task>

ShowMessageBoxDialogAsync() public method

Displays a message box to the user.
public ShowMessageBoxDialogAsync ( string message, string title, MessageBoxButton messageBoxButton, MessageBoxIcon messageBoxIcon ) : Task
message string The message that is to be displayed.
title string The title of the message box.
messageBoxButton MessageBoxButton Determines the buttons that are displayed in the message box.
messageBoxIcon MessageBoxIcon Determines the icon that is displayed in the message box.
return Task

ShowOpenFileDialogAsync() public method

Displays a file open dialog to the user.
public ShowOpenFileDialogAsync ( string title, IEnumerable filter, bool isMultiselect ) : Task>>
title string The title of the file open dialog.
filter IEnumerable The file type restrictions, that should be put on the file open dialog.
isMultiselect bool Determines whether the user is able to select multiple files.
return Task>>

ShowOpenFileDialogAsync() public method

Displays a file open dialog to the user.
public ShowOpenFileDialogAsync ( string title, IEnumerable filter ) : Task>
title string The title of the file open dialog.
filter IEnumerable The file type restrictions, that should be put on the file open dialog.
return Task>

ShowSaveFileDialogAsync() public method

Displays a file save dialog to the user.
public ShowSaveFileDialogAsync ( string title, IEnumerable filter, string defaultExtension ) : Task>
title string The title of the file save dialog.
filter IEnumerable The file type restrictions, that should be put on the file save dialog.
defaultExtension string The file extension, that is used by default for the new file (without dot and star, e.g. "txt" instead of "*.txt").
return Task>