Show / Hide Table of Contents

Class ValidationViewModelBase

データ検証を実装したビューモデルの基底クラス。

Inheritance
System.Object
NotifyObject
ViewModelBase
WeakEventViewModelBase
ValidationViewModelBase
DialogViewModelBase
Implements
System.ComponentModel.INotifyPropertyChanged
System.IDisposable
System.Windows.IWeakEventListener
System.ComponentModel.INotifyDataErrorInfo
Inherited Members
WeakEventViewModelBase.ReceiveWeakEvent(Type, Object, EventArgs)
WeakEventViewModelBase.OnReceivedPropertyChangeNotification(Type, Object, EventArgs)
WeakEventViewModelBase.OnReceiveWeakEventNotification(Type, Object, EventArgs)
ViewModelBase.UiDispatcher
ViewModelBase.IsUiThread()
ViewModelBase.RaisePropertyChanged(String)
ViewModelBase.InvalidateRequerySuggested()
ViewModelBase.Dispose()
ViewModelBase.Dispose(Boolean)
NotifyObject.PropertyChanged
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: MakCraft.ViewModels
Assembly: MakViewModelBaseCore.dll
Syntax
public abstract class ValidationViewModelBase : WeakEventViewModelBase, INotifyPropertyChanged, IDisposable, IWeakEventListener, INotifyDataErrorInfo

Constructors

| Improve this Doc View Source

ValidationViewModelBase()

コンストラクタ。

Declaration
public ValidationViewModelBase()
| Improve this Doc View Source

ValidationViewModelBase(IValidationDictionary)

コンストラクタ。

Declaration
public ValidationViewModelBase(IValidationDictionary dictionary)
Parameters
Type Name Description
IValidationDictionary dictionary

データ検証に用いるディクショナリ

Properties

| Improve this Doc View Source

HasErrors

エンティティに検証エラーがあるかどうかを示す値を取得します。

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

IsValid

データ検証エラーの発生の有無を取得します。

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

Item[String]

指定した名前のプロパティに関するエラー メッセージの配列を取得します。

Declaration
public string[] this[string columnName] { get; }
Parameters
Type Name Description
System.String columnName
Property Value
Type Description
System.String[]
| Improve this Doc View Source

ViewModelState

ビューモデルの状態及びバインディングの検証の状態を格納するビューモデル状態ディクショナリ オブジェクトを取得します。

Declaration
public IValidationDictionary ViewModelState { get; }
Property Value
Type Description
IValidationDictionary

Methods

| Improve this Doc View Source

GetErrors(String)

指定されたプロパティまたはエンティティ全体の検証エラーを取得します。

Declaration
public IEnumerable GetErrors(string propertyName)
Parameters
Type Name Description
System.String propertyName
Returns
Type Description
System.Collections.IEnumerable
| Improve this Doc View Source

IsPropertyAnnotationError(String)

指定されたプロパティの System.ComponentModel.DataAnnotations のデータ検証アトリビュート検査の結果を確認します。 propertyName が省略された場合、呼び出し元のメソッドまたはプロパティの名前を用います。

Declaration
public bool IsPropertyAnnotationError(string propertyName = null)
Parameters
Type Name Description
System.String propertyName
Returns
Type Description
System.Boolean

検証エラーが発生していれば true

| Improve this Doc View Source

RaiseErrorsChanged(String)

ErrorsChanged イベントを発火します。

Declaration
protected virtual void RaiseErrorsChanged(string propertyName)
Parameters
Type Name Description
System.String propertyName

エラー状態が変化したプロパティの名前

| Improve this Doc View Source

SetProperty<T>(ref T, T, String)

メンバ変数 variable を value の値で書き換え、propertyName を用いてPropertyChanged イベントを発火し、データ検証属性を用いたデータの検証を行います。 propertyName が省略された場合、呼び出し元のプロパティの名前を用います。

Declaration
protected override void SetProperty<T>(ref T variable, T value, string propertyName = null)
Parameters
Type Name Description
T variable
T value
System.String propertyName
Type Parameters
Name Description
T
Overrides
MakCraft.ViewModels.NotifyObject.SetProperty<T>(T, T, System.String)
| Improve this Doc View Source

Validate()

すべてのデータ検証対象プロパティのデータ検証を行います。

Declaration
protected bool Validate()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Validate(String)

プロパティのデータ検証を行います。

Declaration
protected bool Validate(string propertyName)
Parameters
Type Name Description
System.String propertyName

プロパティ名

Returns
Type Description
System.Boolean

Events

| Improve this Doc View Source

ErrorsChanged

プロパティまたはエンティティ全体の検証エラーが変更されたときに発生します。

Declaration
public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged
Event Type
Type Description
System.EventHandler<System.ComponentModel.DataErrorsChangedEventArgs>

Implements

System.ComponentModel.INotifyPropertyChanged
System.IDisposable
System.Windows.IWeakEventListener
System.ComponentModel.INotifyDataErrorInfo
  • Improve this Doc
  • View Source
Back to top Generated by DocFX