Search Results for

    Show / Hide Table of Contents

    Class ExtendableViewModelBase

    Viewmodel base which enabled adding custom properties to the viewmodel

    Inheritance
    System.Object
    CustomTypeHelper
    ExtendableViewModelBase
    Implements
    System.Reflection.ICustomTypeProvider
    IExtendableViewModel
    UI.MVC.IViewModelBase
    System.ComponentModel.INotifyPropertyChanged
    System.ComponentModel.INotifyDataErrorInfo
    IValidateableViewModel
    IAsyncViewModel
    Inherited Members
    CustomTypeHelper.AddProperty(String)
    CustomTypeHelper.AddProperty(String, Type)
    CustomTypeHelper.AddProperty(String, Type, List<Attribute>)
    CustomTypeHelper.CheckIfNameExists(String)
    CustomTypeHelper.CheckIfCustomPropertyExists(String)
    CustomTypeHelper.SetPropertyValue(String, Object)
    CustomTypeHelper.GetPropertyValue(String)
    CustomTypeHelper.GetProperties()
    CustomTypeHelper.GetCustomType()
    CustomTypeHelper.TypePropertiesMap
    CustomTypeHelper.CustomPropertyValues
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Simplic.UI.MVC
    Assembly: Simplic.UI.dll
    Syntax
    public abstract class ExtendableViewModelBase : CustomTypeHelper, ICustomTypeProvider, IExtendableViewModel, IViewModelBase, INotifyPropertyChanged, INotifyDataErrorInfo, IValidateableViewModel, IAsyncViewModel

    Constructors

    | Improve this Doc View Source

    ExtendableViewModelBase()

    Create new model base

    Declaration
    public ExtendableViewModelBase()

    Properties

    | Improve this Doc View Source

    ForceSave

    get or set a state which indicates if something has changed and needs to be saved. Passes the ForceSave value to the Parent Used by DefaultRibbonWindow to call the OnSave method

    Declaration
    [Browsable(false)]
    public bool ForceSave { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    HasErrors

    Gets whether validation errors exists or not

    Declaration
    public bool HasErrors { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsBusy

    Gets or sets whether the view model is processing data

    Declaration
    [Browsable(false)]
    public bool IsBusy { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsDirty

    Get/Set wether the values has changed in the current ViewModel instance. The default-value is false

    Declaration
    [Browsable(false)]
    public bool IsDirty { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsInValidationMode

    Gets or sets whether validation mode is active

    Declaration
    public bool IsInValidationMode { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Parent

    gets or sets the parent ViewModel

    Declaration
    [Browsable(false)]
    public IViewModelBase Parent { get; set; }
    Property Value
    Type Description
    UI.MVC.IViewModelBase
    | Improve this Doc View Source

    Validators

    Gets a list of all validators

    Declaration
    public IList<string> Validators { get; }
    Property Value
    Type Description
    System.Collections.Generic.IList<System.String>

    Methods

    | Improve this Doc View Source

    AddValidator(String, IPropertyValidator)

    Add a validator for a property

    Declaration
    public void AddValidator(string propertyName, IPropertyValidator validator)
    Parameters
    Type Name Description
    System.String propertyName

    PropertyName

    IPropertyValidator validator

    Validator instance

    | Improve this Doc View Source

    AddValidator(String, IPropertyValidator, String)

    Add a validator for a property

    Declaration
    public void AddValidator(string propertyName, IPropertyValidator validator, string customMessage)
    Parameters
    Type Name Description
    System.String propertyName

    PropertyName

    IPropertyValidator validator

    Validator instance

    System.String customMessage

    Own message if invalid

    | Improve this Doc View Source

    AllowTenantChange()

    Determines whether a tenant change is allowed.

    Declaration
    public virtual bool AllowTenantChange()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    CollectionNotifyPropertyChanged<Model, ViewModel>(ObservableCollection<ViewModel>, ICollection<Model>, Func<ViewModel, Model>)

    Viewmodel collection change notification

    Declaration
    protected void CollectionNotifyPropertyChanged<Model, ViewModel>(ObservableCollection<ViewModel> observableCollection, ICollection<Model> statefulCollection, Func<ViewModel, Model> getModel)
    Parameters
    Type Name Description
    System.Collections.ObjectModel.ObservableCollection<ViewModel> observableCollection

    Observable collection instance

    System.Collections.Generic.ICollection<Model> statefulCollection

    Stateful collection instance

    System.Func<ViewModel, Model> getModel

    Delegate/Method to get the Model from the ViewModel

    Type Parameters
    Name Description
    Model

    Type of model in the stateful collection

    ViewModel

    Type of viewmodel in the observable collection

    | Improve this Doc View Source

    CustomPropertyChanged(String, Object)

    Will be called when a custom property gets changed

    Declaration
    public virtual void CustomPropertyChanged(string name, object value)
    Parameters
    Type Name Description
    System.String name

    Name of the property that way changed

    System.Object value
    | Improve this Doc View Source

    CustomPropertyGetter(String, Object, PropertyInfo)

    Will be called when getting values from the getter

    Declaration
    public virtual object CustomPropertyGetter(string name, object value, PropertyInfo propertyInfo)
    Parameters
    Type Name Description
    System.String name

    Name of the property

    System.Object value

    Value that is currently stored in the field of the property

    System.Reflection.PropertyInfo propertyInfo

    Property informatiopn

    Returns
    Type Description
    System.Object

    Value to return from the getter

    | Improve this Doc View Source

    CustomPropertySetter(String, Object, out Object, PropertyInfo)

    Will be called before the custom property is changed

    Declaration
    public virtual bool CustomPropertySetter(string name, object inValue, out object outValue, PropertyInfo propertyInfo)
    Parameters
    Type Name Description
    System.String name

    Name of the property to change

    System.Object inValue

    Value that was passed into the setter

    System.Object outValue

    Value that should be set

    System.Reflection.PropertyInfo propertyInfo

    Property information

    Returns
    Type Description
    System.Boolean

    True if the setter should set the value

    | Improve this Doc View Source

    GetErrors(String)

    Get all enumeration errors

    Declaration
    public IEnumerable GetErrors(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName

    Property to get the errors of

    Returns
    Type Description
    System.Collections.IEnumerable

    List of errors

    | Improve this Doc View Source

    JsonDeserializeValidators(String)

    Deserialize validators configuration

    Declaration
    public void JsonDeserializeValidators(string json)
    Parameters
    Type Name Description
    System.String json

    Validators as json string

    | Improve this Doc View Source

    JsonSerializeValidators()

    Serialize validators

    Declaration
    public string JsonSerializeValidators()
    Returns
    Type Description
    System.String

    Validators as string

    | Improve this Doc View Source

    OnClose()

    Called when DefaultRibbonWindow closes used to clear locks

    Declaration
    public virtual void OnClose()
    | Improve this Doc View Source

    PropertySetter<T>(T, Action<T>, Boolean, Boolean, Boolean, String)

    Property setter wrapper to set property values and call CustomPropertySetter in one line

    Declaration
    protected void PropertySetter<T>(T value, Action<T> p, bool setIsDirty = true, bool raisePropertyChanged = true, bool raiseErrorsChanged = true, string propertyName = null)
    Parameters
    Type Name Description
    T value

    Property value

    System.Action<T> p

    Action to execute when setting the property

    System.Boolean setIsDirty

    Whether to set the IsDirty flag to true

    System.Boolean raisePropertyChanged
    System.Boolean raiseErrorsChanged
    System.String propertyName

    Name of the property

    Type Parameters
    Name Description
    T

    Type of the property

    | Improve this Doc View Source

    RaiseErrorsChanged(String, Object)

    Execute validator and add error messages

    Declaration
    public virtual void RaiseErrorsChanged(string propertyName, object value)
    Parameters
    Type Name Description
    System.String propertyName

    Properties to handle errors of

    System.Object value

    Values to handle

    | Improve this Doc View Source

    RaisePropertyChanged(String)

    Raise event for a property which value has changed

    Declaration
    public void RaisePropertyChanged(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName

    Name of the Property

    | Improve this Doc View Source

    RemoveValidator(String, Type)

    Remove a validator of a specific type

    Declaration
    public void RemoveValidator(string propertyName, Type validatorType)
    Parameters
    Type Name Description
    System.String propertyName

    Property name

    System.Type validatorType

    Validator type

    | Improve this Doc View Source

    RemoveValidators(String)

    Remove all validators for a specific property

    Declaration
    public void RemoveValidators(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName

    Name of the property to remove the validators from

    | Improve this Doc View Source

    ValidateAll()

    Validates without error

    Declaration
    public bool ValidateAll()
    Returns
    Type Description
    System.Boolean

    Success

    | Improve this Doc View Source

    ValidateAllProperties()

    Validate all properties

    Declaration
    public void ValidateAllProperties()
    | Improve this Doc View Source

    ValidateAllProperties(IList<IValidateableViewModel>)

    Validate all properties

    Declaration
    public void ValidateAllProperties(IList<IValidateableViewModel> validated)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<IValidateableViewModel> validated

    Events

    | Improve this Doc View Source

    ErrorsChanged

    Declaration
    public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged
    Event Type
    Type Description
    System.EventHandler<System.ComponentModel.DataErrorsChangedEventArgs>
    | Improve this Doc View Source

    PropertyChanged

    Event which will be raised if a property has changed (Setter)

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type Description
    System.ComponentModel.PropertyChangedEventHandler

    Implements

    System.Reflection.ICustomTypeProvider
    IExtendableViewModel
    IViewModelBase
    System.ComponentModel.INotifyPropertyChanged
    System.ComponentModel.INotifyDataErrorInfo
    IValidateableViewModel
    IAsyncViewModel
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx