Table of Contents

Interface IDialogsFactory

Namespace
Playnite.SDK
Assembly
Playnite.SDK.dll

Describes object providing methods for dialog based actions.

public interface IDialogsFactory

Methods

ActivateGlobalProgress(Action<GlobalProgressActionArgs>, GlobalProgressOptions)

Activates progress dialog blocking app interaction until progress is finished or canceled.

GlobalProgressResult ActivateGlobalProgress(Action<GlobalProgressActionArgs> progresAction, GlobalProgressOptions progressOptions)

Parameters

progresAction Action<GlobalProgressActionArgs>

Action to be executed.

progressOptions GlobalProgressOptions

Options for progress dialog.

Returns

GlobalProgressResult

Status of the action execution.

ActivateGlobalProgress(Func<GlobalProgressActionArgs, Task>, GlobalProgressOptions)

Activates progress dialog blocking app interaction until progress is finished or canceled.

GlobalProgressResult ActivateGlobalProgress(Func<GlobalProgressActionArgs, Task> progresAction, GlobalProgressOptions progressOptions)

Parameters

progresAction Func<GlobalProgressActionArgs, Task>

Awaitable function to be executed.

progressOptions GlobalProgressOptions

Options for progress dialog.

Returns

GlobalProgressResult

Status of the action execution.

ChooseImageFile(List<ImageFileOption>, string, double, double)

Displays dialog with an option to choose single image.

ImageFileOption ChooseImageFile(List<ImageFileOption> files, string caption = null, double itemWidth = 240, double itemHeight = 180)

Parameters

files List<ImageFileOption>
caption string
itemWidth double
itemHeight double

Returns

ImageFileOption

Null if dialog was canceled otherwise selected ImageFileOption object.

ChooseItemWithSearch(List<GenericItemOption>, Func<string, List<GenericItemOption>>, string, string)

Displays dialog with an option to choose single item and option to search for different items.

GenericItemOption ChooseItemWithSearch(List<GenericItemOption> items, Func<string, List<GenericItemOption>> searchFunction, string defaultSearch = null, string caption = null)

Parameters

items List<GenericItemOption>
searchFunction Func<string, List<GenericItemOption>>
defaultSearch string
caption string

Returns

GenericItemOption

Null if dialog was canceled otherwise selected GenericItemOption object.

CreateWindow(WindowCreationOptions)

Creates new window with Playnite's default styling applied.

Window CreateWindow(WindowCreationOptions options)

Parameters

options WindowCreationOptions

Custom window options.

Returns

Window

New window instance.

GetCurrentAppWindow()

Gets currently active window. If no window is active, main window is returned instead.

Window GetCurrentAppWindow()

Returns

Window

Window object.

SaveFile(string)

Displays system file save dialog.

string SaveFile(string filter)

Parameters

filter string

File filter, for example "ZIP Archive|*.zip"

Returns

string

Selected file path or empty string if user cancels the dialog.

SaveFile(string, bool)

Displays system file save dialog.

string SaveFile(string filter, bool promptOverwrite)

Parameters

filter string

File filter, for example "ZIP Archive|*.zip"

promptOverwrite bool

Indicates whether to ask user for file overrite if selected path exists.

Returns

string

Selected file path or empty string if user cancels the dialog.

SelectFile(string)

Displays system open file dialog.

string SelectFile(string filter)

Parameters

filter string

File filter, for example "ZIP Archive|*.zip"

Returns

string

Selected file path or empty string if user cancels the dialog.

SelectFiles(string)

Displays system open file dialog allowing to select multiple files.

List<string> SelectFiles(string filter)

Parameters

filter string

File filter, for example "ZIP Archive|*.zip"

Returns

List<string>

List of paths or null if user cancels the dialog.

SelectFolder()

Displays system dialog for folder selection.

string SelectFolder()

Returns

string

Selected folder path or empty string if user cancels the dialog.

SelectIconFile()

Displays file open dialog with file filter set to show only image files used for icons.

string SelectIconFile()

Returns

string

Selected icon path or empty string if user cancels the dialog.

SelectImagefile()

Displays file open dialog with file filter set to show only image files.

string SelectImagefile()

Returns

string

Selected image path or empty string if user cancels the dialog.

SelectString(string, string, string)

Displays dialog asking user to input text string.

StringSelectionDialogResult SelectString(string messageBoxText, string caption, string defaultInput)

Parameters

messageBoxText string

Dialog message text.

caption string

Dialog window caption.

defaultInput string

Default string presented in input field.

Returns

StringSelectionDialogResult

Selection result.

SelectString(string, string, string, List<MessageBoxToggle>)

StringSelectionDialogResult SelectString(string messageBoxText, string caption, string defaultInput, List<MessageBoxToggle> options)

Parameters

messageBoxText string
caption string
defaultInput string
options List<MessageBoxToggle>

Returns

StringSelectionDialogResult

ShowErrorMessage(string)

Displays error dialog window with text message.

MessageBoxResult ShowErrorMessage(string messageBoxText)

Parameters

messageBoxText string

Dialog message text.

Returns

MessageBoxResult

ShowErrorMessage(string, string)

Displays error dialog window with text message.

MessageBoxResult ShowErrorMessage(string messageBoxText, string caption)

Parameters

messageBoxText string

Dialog message text.

caption string

Dialog window caption.

Returns

MessageBoxResult

ShowMessage(string)

Displays dialog window with text message.

MessageBoxResult ShowMessage(string messageBoxText)

Parameters

messageBoxText string

Dialog message text.

Returns

MessageBoxResult

Selected dialog response.

ShowMessage(string, string)

Displays dialog window with text message.

MessageBoxResult ShowMessage(string messageBoxText, string caption)

Parameters

messageBoxText string

Dialog message text.

caption string

Dialog window caption.

Returns

MessageBoxResult

Selected dialog response.

ShowMessage(string, string, MessageBoxButton)

Displays dialog window with text message.

MessageBoxResult ShowMessage(string messageBoxText, string caption, MessageBoxButton button)

Parameters

messageBoxText string

Dialog message text.

caption string

Dialog window caption.

button MessageBoxButton

Available response button.

Returns

MessageBoxResult

Selected dialog response.

ShowMessage(string, string, MessageBoxButton, MessageBoxImage)

Displays dialog window with text message.

MessageBoxResult ShowMessage(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon)

Parameters

messageBoxText string

Dialog message text.

caption string

Dialog window caption.

button MessageBoxButton

Available response button.

icon MessageBoxImage

Dialog icon.

Returns

MessageBoxResult

Selected dialog response.

ShowMessage(string, string, MessageBoxImage, List<MessageBoxOption>)

Displays dialog window custom response options.

MessageBoxOption ShowMessage(string messageBoxText, string caption, MessageBoxImage icon, List<MessageBoxOption> options)

Parameters

messageBoxText string

Dialog message text.

caption string

Dialog window caption.

icon MessageBoxImage

Dialog icon.

options List<MessageBoxOption>

Response options.

Returns

MessageBoxOption

Selected dialog option.

ShowSelectableString(string, string, string)

Displays dialog with textbox allowing to select/copy text.

void ShowSelectableString(string messageBoxText, string caption, string defaultInput)

Parameters

messageBoxText string

Dialog message text.

caption string

Dialog window caption.

defaultInput string

String added into selectable field.