Show / Hide Table of Contents

Class ViewModelSharedInfo

Some shared info that can be used by any view model class in Aruba.

Inheritance
object
ViewModelSharedInfo
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Phoenix.Aruba
Assembly: Phoenix.Plugin.Aruba.dll
Syntax
public class ViewModelSharedInfo
Remarks

Initializes a new instance of the ViewModelSharedInfo class. Constructor taking in all members.

Constructors

View Source

ViewModelSharedInfo(IDataStoreProvider, IDataStoreProvider, IBugServiceClient, IEventAggregator, ILogger, Func<Exception, bool, string, Task>)

Some shared info that can be used by any view model class in Aruba.

Declaration
public ViewModelSharedInfo(IDataStoreProvider storeProvider, IDataStoreProvider userStoreProvider, IBugServiceClient bugServiceClient, IEventAggregator eventAggregator, ILogger logger, Func<Exception, bool, string, Task> exceptionHandler)
Parameters
Type Name Description
IDataStoreProvider storeProvider

The store provider.

IDataStoreProvider userStoreProvider

The user store provider.

IBugServiceClient bugServiceClient

The bug service client.

IEventAggregator eventAggregator

The event aggregator.

ILogger logger

The logger.

Func<Exception, bool, string, Task> exceptionHandler

The exception handler.

Remarks

Initializes a new instance of the ViewModelSharedInfo class. Constructor taking in all members.

Properties

View Source

BugServiceClient

Gets the instance of IBugServiceClient to use.

Declaration
public IBugServiceClient BugServiceClient { get; }
Property Value
Type Description
IBugServiceClient
View Source

EventAggregator

Gets the Prism.Events.IEventAggregator to use to publish and subscribe to view-related events.

Declaration
public IEventAggregator EventAggregator { get; }
Property Value
Type Description
IEventAggregator
View Source

ExceptionHandler

Gets a handler for exceptions, returning a Task so that it can present a dialog if needed, etc. The bool parameter indicates whether the exception is assumed to be due to user (input-based) error. The string parameter is a "context" for the exception, that can be presented to the user as part of a message, like "creating bug", "saving file", etc.

Declaration
public Func<Exception, bool, string, Task> ExceptionHandler { get; }
Property Value
Type Description
Func<Exception, bool, string, Task>
View Source

Logger

Gets the ILogger to use for logging from operations.

Declaration
public ILogger Logger { get; }
Property Value
Type Description
ILogger
View Source

StoreProvider

Gets the IDataStoreProvider used to read and save data.

Declaration
public IDataStoreProvider StoreProvider { get; }
Property Value
Type Description
IDataStoreProvider
View Source

UserStoreProvider

Gets the IDataStoreProvider used to read and save user-specific data.

Declaration
public IDataStoreProvider UserStoreProvider { get; }
Property Value
Type Description
IDataStoreProvider

Methods

View Source

TryExecuteBusyAsync(Func<Task>, bool, string, Dispatcher)

Wrap the running of a task inside a request to show the UI as "busy" during that task.

Declaration
public Task<bool> TryExecuteBusyAsync(Func<Task> operation, bool isCritical, string context, Dispatcher dispatcher)
Parameters
Type Name Description
Func<Task> operation

The function to run.

bool isCritical

Indicates whether it is a critical task.

string context

The context to provide to the user about the exception.

Dispatcher dispatcher

The dispatcher.

Returns
Type Description
Task<bool>

The Task with the result of the execution.

View Source

TryOperationWithExceptionHandlerAsync(Func<Task>, bool, string)

Utility to help wrap an async operation inside our exception handler.

Declaration
public Task<bool> TryOperationWithExceptionHandlerAsync(Func<Task> operation, bool isCritical, string context)
Parameters
Type Name Description
Func<Task> operation

The function to run.

bool isCritical

Indicates whether it is a critical task.

string context

The context to provide to the user about the exception.

Returns
Type Description
Task<bool>

The Task with the result of the execution.

  • View Source
In this article
Back to top Generated by DocFX