Class ServiceViewModelBase
Represents a base class for a service view with a IsEnabled property for the view.
Inheritance
Implements
Inherited Members
Namespace: Loehnert.Lisrt.Modules.ViewModels
Assembly: Loehnert.Lisrt.Modules.dll
Syntax
public abstract class ServiceViewModelBase : Document, IViewAware, IChild, IDocument, ILayoutItem, IScreen, IHaveDisplayName, IActivate, IDeactivate, IGuardClose, IClose, INotifyPropertyChangedEx, INotifyPropertyChanged, ICommandHandler<UndoCommandDefinition>, ICommandHandler<RedoCommandDefinition>, ICommandHandler<SaveFileCommandDefinition>, ICommandHandler<SaveFileAsCommandDefinition>, ICommandHandler
Remarks
The IsEnabled property calls the GetEnabled method. The default GetEnabled method enables the service view when:
- The modules Enabled property is true
- The current user has the UseServiceWindow permission.
- The InitializationState is Initialized (only when the module implements IInitializable)
- The current operationg mode is a manual mode (only when a manual mode exists)
Constructors
ServiceViewModelBase(ILisrtModule)
Initializes a new instance of the ServiceViewModelBase class. Calls the ServiceViewModelBase(ILisrtModule, IUserManager, IOperatingModeManager) constructor, to get the IUserManager and the IOperatingModeManager implementations by the Caliburn.Micro.IoC.
Declaration
protected ServiceViewModelBase(ILisrtModule module)
Parameters
Type | Name | Description |
---|---|---|
ILisrtModule | module | The module for the service view. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
ServiceViewModelBase(ILisrtModule, IUserManager, IOperatingModeManager)
Initializes a new instance of the ServiceViewModelBase class.
Declaration
protected ServiceViewModelBase(ILisrtModule module, IUserManager userManager, IOperatingModeManager operatingModeManager)
Parameters
Type | Name | Description |
---|---|---|
ILisrtModule | module | The module for the service view. |
IUserManager | userManager | Manager for the users. |
IOperatingModeManager | operatingModeManager | Manager for the operating modes. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
Fields
_module
Gets the depending LisRT module.
Declaration
protected readonly ILisrtModule _module
Field Value
Type | Description |
---|---|
ILisrtModule |
Properties
GetEnabled
Gets or sets a method for getting the IsEnabled value.
Declaration
public static Predicate<ILisrtModule> GetEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Predicate<ILisrtModule> |
Remarks
Note that the value is set when you construct the ServiceViewModelBase the first time. When you set another predicate, don't forget to rise the PropertyChanged for IsEnabled if any depending value changes.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when set to null. |
IconSource
Gets the icon.
Declaration
public override Uri IconSource { get; }
Property Value
Type | Description |
---|---|
Uri |
Overrides
IsEnabled
Gets a value indicating whether the controls in the view can be changed.
Declaration
public virtual bool IsEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
ForceUpdatedIsEnabled()
Forces an update for IsEnabled in all ServiceViewModelBases.
Declaration
public static void ForceUpdatedIsEnabled()
Remarks
Rising a Caliburn.Micro.PropertyChangedBase.NotifyOfPropertyChange(System.String) for IsEnabled should be preferred.