Table of Contents

Class BaseUserInterfaceService

Namespace
Acuit.Pinpoint.Windows
Assembly
Acuit.Pinpoint.Windows.dll

A standard implementation of the IUserInterfaceService user interface service.

public class BaseUserInterfaceService : IUserInterfaceService
Inheritance
BaseUserInterfaceService
Implements
Inherited Members
Extension Methods

Remarks

Applications can use this class to provide the basic user interface service implementation.

Constructors

BaseUserInterfaceService(string)

Initializes a new instance of the BaseUserInterfaceService class.

public BaseUserInterfaceService(string applicationName)

Parameters

applicationName string

The application name, for use in message box captions and error messages.

Remarks

MainWindow for Current will be assumed as the main window.

BaseUserInterfaceService(Window, string)

Initializes a new instance of the BaseUserInterfaceService class.

public BaseUserInterfaceService(Window mainWindow, string applicationName)

Parameters

mainWindow Window

The main window.

applicationName string

The application name, for use in message box captions and error messages.

Properties

ActiveWindow

Gets the active window, which will either be the main application window or a nested modal dialog box window.

public Window ActiveWindow { get; }

Property Value

Window

Remarks

This returns the active window from the perspective of the application, irrespective of whether the application is activated (i.e., has focus). Any active message box has no effect on this property (though message boxes will by default use the window specified by this property as their parent window).

IsDialogOrMessageBoxShown

Gets whether a modal dialog or message box is currently open.

public bool IsDialogOrMessageBoxShown { get; }

Property Value

bool

IsMessageBoxShown

Gets whether a message box is currently open.

public bool IsMessageBoxShown { get; }

Property Value

bool

Remarks

This will only be accurate if all dialogs and message boxes are invoked via the members of this interface.

MainWindow

Gets the main application window.

public Window MainWindow { get; }

Property Value

Window

Methods

SetMessageBoxFontSize(double)

Sets the message box font size.

public void SetMessageBoxFontSize(double fontSize)

Parameters

fontSize double

The new font size.

ShowAboutBox()

Displays the standard Acuit Pinpoint application about box.

public void ShowAboutBox()

ShowAboutBox(string)

Displays the standard Acuit Pinpoint application about box.

public void ShowAboutBox(string additionalDescription)

Parameters

additionalDescription string

Additional description text, that will appear in the dialog box below the assembly description.

ShowDialog(Window)

Displays a dialog box.

public bool ShowDialog(Window view)

Parameters

view Window

The window to use as the dialog box.

Returns

bool

If the view model is derived from DialogViewModel, then the value of the view model's DialogResult property will be returned; otherwise, the result of ShowDialog() will be returned.

ShowDialog(Window, object)

Displays a dialog box, using the supplied view model.

public bool ShowDialog(Window view, object viewModel)

Parameters

view Window

The window to use as the dialog box.

viewModel object

The object to use as the view model.

Returns

bool

If the view model is derived from DialogViewModel, then the value of the view model's DialogResult property will be returned; otherwise, the result of ShowDialog() will be returned.

ShowMessageBox(MessageBoxImage, string, params object[])

Displays a message box.

public MessageBoxResult ShowMessageBox(MessageBoxImage icon, string format, params object[] args)

Parameters

icon MessageBoxImage

The message box icon.

format string

The message text format string.

args object[]

The message text arguments.

Returns

MessageBoxResult

The message box result.

ShowMessageBox(MessageBoxImage, MessageBoxButton, string, params object[])

Displays a message box.

public MessageBoxResult ShowMessageBox(MessageBoxImage icon, MessageBoxButton button, string format, params object[] args)

Parameters

icon MessageBoxImage

The message box icon.

button MessageBoxButton

The message box button(s) to show.

format string

The message text format string.

args object[]

The message text arguments.

Returns

MessageBoxResult

The message box result.

WaitCursor()

Gets a disposable object that shows a wait cursor and removes it when the object is disposed.

public IDisposable WaitCursor()

Returns

IDisposable

A disposable object that shows and hides a wait cursor.