C# Класс Catel.Services.UIVisualizerService

Service to show modal or non-modal popup windows. All windows will have to be registered manually or are be resolved via the Catel.MVVM.IViewLocator.
Наследование: Catel.Services.ViewModelServiceBase, IUIVisualizerService
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
RegisteredWindows Type>.Dictionary

Открытые методы

Метод Описание
IsRegistered ( string name ) : bool

Determines whether the specified name is registered.

Register ( string name, Type windowType, bool throwExceptionIfExists = true ) : void

Registers the specified view model and the window type. This way, Catel knowns what window to show when a specific view model window is requested.

Show ( IViewModel viewModel, EventHandler completedProc = null ) : bool?

Shows a window that is registered with the specified view model in a non-modal state.

Show ( string name, object data, EventHandler completedProc = null ) : bool?

Shows a window that is registered with the specified view model in a non-modal state.

ShowAsync ( IViewModel viewModel, EventHandler completedProc = null ) : Task

Shows a window that is registered with the specified view model in a non-modal state.

ShowAsync ( string name, object data, EventHandler completedProc = null ) : Task

Shows a window that is registered with the specified view model in a non-modal state.

ShowDialog ( IViewModel viewModel, EventHandler completedProc = null ) : bool?

Shows a window that is registered with the specified view model in a modal state.

ShowDialog ( string name, object data, EventHandler completedProc = null ) : bool?

Shows a window that is registered with the specified view model in a modal state.

ShowDialogAsync ( IViewModel viewModel, EventHandler completedProc = null ) : Task

Shows a window that is registered with the specified view model in a modal state.

ShowDialogAsync ( string name, object data, EventHandler completedProc = null ) : Task

Shows a window that is registered with the specified view model in a modal state.

UIVisualizerService ( IViewLocator viewLocator ) : System

Initializes a new instance of the UIVisualizerService class.

UIVisualizerService ( IViewLocator viewLocator, ITypeFactory typeFactory, ILanguageService languageService ) : System

Initializes a new instance of the UIVisualizerService class.

Unregister ( string name ) : bool

This unregisters the specified view model.

Защищенные методы

Метод Описание
CreateWindow ( Type windowType, object data, EventHandler completedProc, bool isModal ) : FrameworkElement

This creates the window of the specified type.

CreateWindow ( string name, object data, EventHandler completedProc, bool isModal ) : FrameworkElement

This creates the window from a key.

EnsureViewIsRegistered ( string name ) : void

Ensures that the specified view is registered.

GetActiveWindow ( ) : FrameworkElement

Gets the active window to use as parent window of new windows. The default implementation returns the active window of the application.

HandleCloseSubscription ( object window, object data, EventHandler completedProc, bool isModal ) : void

Handles the close subscription. The default implementation uses the DynamicEventListener.

RegisterViewForViewModelIfRequired ( Type viewModelType ) : void

Registers the view for the specified view model if required.

ShowWindow ( FrameworkElement window, bool showModal ) : bool?

Shows the window.

ShowWindowAsync ( FrameworkElement window, bool showModal ) : Task

Shows the window.

Приватные методы

Метод Описание
CloseModal ( ) : System.Threading.Tasks.Task

DisplayUsingNavigation ( IViewModel viewModel, EventHandler completedProc, StackLayout contentLayout ) : System.Threading.Tasks.Task

OnBackButtonPressed ( object sender, EventArgs e ) : void

OnCancelButtonClicked ( IViewModel viewModel, EventHandler completedProc ) : void

OnOkButtonClicked ( IViewModel viewModel, EventHandler completedProc ) : void

TryDisplayAsPopup ( IViewModel viewModel, EventHandler completedProc, StackLayout contentLayout ) : Task

Описание методов

CreateWindow() защищенный Метод

This creates the window of the specified type.
protected CreateWindow ( Type windowType, object data, EventHandler completedProc, bool isModal ) : FrameworkElement
windowType System.Type The type of the window.
data object The data that will be set as data context.
completedProc EventHandler The completed callback.
isModal bool True if this is a ShowDialog request.
Результат System.Windows.FrameworkElement

CreateWindow() защищенный Метод

This creates the window from a key.
protected CreateWindow ( string name, object data, EventHandler completedProc, bool isModal ) : FrameworkElement
name string The name that the window is registered with.
data object The data that will be set as data context.
completedProc EventHandler The completed callback.
isModal bool True if this is a ShowDialog request.
Результат System.Windows.FrameworkElement

EnsureViewIsRegistered() защищенный Метод

Ensures that the specified view is registered.
protected EnsureViewIsRegistered ( string name ) : void
name string The name.
Результат void

GetActiveWindow() защищенный Метод

Gets the active window to use as parent window of new windows. The default implementation returns the active window of the application.
protected GetActiveWindow ( ) : FrameworkElement
Результат System.Windows.FrameworkElement

HandleCloseSubscription() защищенный Метод

Handles the close subscription. The default implementation uses the DynamicEventListener.
protected HandleCloseSubscription ( object window, object data, EventHandler completedProc, bool isModal ) : void
window object The window.
data object The data that will be set as data context.
completedProc EventHandler The completed callback.
isModal bool True if this is a ShowDialog request.
Результат void

IsRegistered() публичный Метод

Determines whether the specified name is registered.
The is null or whitespace.
public IsRegistered ( string name ) : bool
name string The name.
Результат bool

Register() публичный Метод

Registers the specified view model and the window type. This way, Catel knowns what window to show when a specific view model window is requested.
The is null or whitespace. The is not of the right type.
public Register ( string name, Type windowType, bool throwExceptionIfExists = true ) : void
name string Name of the registered window.
windowType System.Type Type of the window.
throwExceptionIfExists bool /// if set to true, this method will throw an exception when already /// registered. ///
Результат void

RegisterViewForViewModelIfRequired() защищенный Метод

Registers the view for the specified view model if required.
protected RegisterViewForViewModelIfRequired ( Type viewModelType ) : void
viewModelType System.Type Type of the view model.
Результат void

Show() публичный Метод

Shows a window that is registered with the specified view model in a non-modal state.
The is null. /// The is not registered by the /// method first. ///
public Show ( IViewModel viewModel, EventHandler completedProc = null ) : bool?
viewModel IViewModel The view model.
completedProc EventHandler /// The callback procedure that will be invoked as soon as the window is closed. This value can /// be null. ///
Результат bool?

Show() публичный Метод

Shows a window that is registered with the specified view model in a non-modal state.
The is null or whitespace. /// The is not registered by the /// method first. ///
public Show ( string name, object data, EventHandler completedProc = null ) : bool?
name string The name that the window is registered with.
data object The data to set as data context. If null, the data context will be untouched.
completedProc EventHandler /// The callback procedure that will be invoked as soon as the window is closed. This value can /// be null. ///
Результат bool?

ShowAsync() публичный Метод

Shows a window that is registered with the specified view model in a non-modal state.
The is null. /// The is not registered by the /// method first. ///
public ShowAsync ( IViewModel viewModel, EventHandler completedProc = null ) : Task
viewModel IViewModel The view model.
completedProc EventHandler /// The callback procedure that will be invoked as soon as the window is closed. This value can /// be null. ///
Результат Task

ShowAsync() публичный Метод

Shows a window that is registered with the specified view model in a non-modal state.
The is null or whitespace. /// The is not registered by the /// method first. ///
public ShowAsync ( string name, object data, EventHandler completedProc = null ) : Task
name string The name that the window is registered with.
data object The data to set as data context. If null, the data context will be untouched.
completedProc EventHandler /// The callback procedure that will be invoked as soon as the window is closed. This value can /// be null. ///
Результат Task

ShowDialog() публичный Метод

Shows a window that is registered with the specified view model in a modal state.
The is null. /// The is not registered by the /// method first. ///
public ShowDialog ( IViewModel viewModel, EventHandler completedProc = null ) : bool?
viewModel IViewModel The view model.
completedProc EventHandler /// The callback procedure that will be invoked as soon as the window is closed. This value can /// be null. ///
Результат bool?

ShowDialog() публичный Метод

Shows a window that is registered with the specified view model in a modal state.
The is null or whitespace. /// The is not registered by the /// method first. ///
public ShowDialog ( string name, object data, EventHandler completedProc = null ) : bool?
name string The name that the window is registered with.
data object The data to set as data context. If null, the data context will be untouched.
completedProc EventHandler /// The callback procedure that will be invoked as soon as the window is closed. This value can /// be null. ///
Результат bool?

ShowDialogAsync() публичный Метод

Shows a window that is registered with the specified view model in a modal state.
The is null. /// The is not registered by the /// method first. ///
public ShowDialogAsync ( IViewModel viewModel, EventHandler completedProc = null ) : Task
viewModel IViewModel The view model.
completedProc EventHandler /// The callback procedure that will be invoked as soon as the window is closed. This value can /// be null. ///
Результат Task

ShowDialogAsync() публичный Метод

Shows a window that is registered with the specified view model in a modal state.
The is null or whitespace. /// The is not registered by the /// method first. ///
public ShowDialogAsync ( string name, object data, EventHandler completedProc = null ) : Task
name string The name that the window is registered with.
data object The data to set as data context. If null, the data context will be untouched.
completedProc EventHandler /// The callback procedure that will be invoked as soon as the window is closed. This value can /// be null. ///
Результат Task

ShowWindow() защищенный Метод

Shows the window.
protected ShowWindow ( FrameworkElement window, bool showModal ) : bool?
window FrameworkElement The window.
showModal bool If true, the window should be shown as modal.
Результат bool?

ShowWindowAsync() защищенный Метод

Shows the window.
protected ShowWindowAsync ( FrameworkElement window, bool showModal ) : Task
window FrameworkElement The window.
showModal bool If true, the window should be shown as modal.
Результат Task

UIVisualizerService() публичный Метод

Initializes a new instance of the UIVisualizerService class.
The is null.
public UIVisualizerService ( IViewLocator viewLocator ) : System
viewLocator IViewLocator The view locator.
Результат System

UIVisualizerService() публичный Метод

Initializes a new instance of the UIVisualizerService class.
The is null. The is null. The is null.
public UIVisualizerService ( IViewLocator viewLocator, ITypeFactory typeFactory, ILanguageService languageService ) : System
viewLocator IViewLocator
typeFactory ITypeFactory
languageService ILanguageService
Результат System

Unregister() публичный Метод

This unregisters the specified view model.
public Unregister ( string name ) : bool
name string Name of the registered window.
Результат bool

Описание свойств

RegisteredWindows защищенное свойство

Dictionary of registered windows.
protected Dictionary RegisteredWindows
Результат Type>.Dictionary