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.IDataErrorInfo
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
NotifyObject.SetProperty<T>(T, T, String)
NotifyObject.RaisePropertyChanged<T>(Expression<Func<T>>)
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: MakCraft.ViewModels
Assembly: MakViewModelsBase.dll
Syntax
public abstract class ValidationViewModelBase : WeakEventViewModelBase, INotifyPropertyChanged, IDisposable, IWeakEventListener, IDataErrorInfo

Constructors

| Improve this Doc View Source

ValidationViewModelBase()

コンストラクタ。

Declaration
public ValidationViewModelBase()

Properties

| Improve this Doc View Source

Error

オブジェクトに関する間違いを示すエラー メッセージを取得します。

Declaration
public string Error { get; }
Property Value
Type Description
System.String
| 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

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

IsPropertyAnnotationError<T>(Expression<Func<T>>)

指定されたプロパティの System.ComponentModel.DataAnnotations のデータ検証アトリビュート検査の結果を確認します。

Declaration
public bool IsPropertyAnnotationError<T>(Expression<Func<T>> propertyName)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<T>> propertyName
Returns
Type Description
System.Boolean

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

Type Parameters
Name Description
T
| Improve this Doc View Source

RaisePropertyChangedWithRemoveItemValidationError(String)

PropertyChanged イベントを発火します。 プロパティ変更通知まえに当該プロパティの検証エラーの削除を行います。 propertyName が省略された場合、呼び出し元のプロパティの名前を用います。

Declaration
protected virtual void RaisePropertyChangedWithRemoveItemValidationError(string propertyName = null)
Parameters
Type Name Description
System.String propertyName
| Improve this Doc View Source

RaisePropertyChangedWithRemoveItemValidationError<T>(Expression<Func<T>>)

PropertyChanged イベントを発火します。 プロパティ変更通知まえに当該プロパティの検証エラーの削除を行います。

Declaration
protected void RaisePropertyChangedWithRemoveItemValidationError<T>(Expression<Func<T>> e)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<T>> e
Type Parameters
Name Description
T
| Improve this Doc View Source

RemoveItemValidationError(String)

propertyName に設定されている検証エラーメッセージを削除します。 propertyName が省略された場合、呼び出し元のメソッドまたはプロパティの名前を用います。

Declaration
public void RemoveItemValidationError(string propertyName = null)
Parameters
Type Name Description
System.String propertyName
| Improve this Doc View Source

RemoveItemValidationError<T>(Expression<Func<T>>)

propertyName に設定されている検証エラーメッセージを削除します。

Declaration
public void RemoveItemValidationError<T>(Expression<Func<T>> propertyName)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<T>> propertyName
Type Parameters
Name Description
T
| Improve this Doc View Source

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

プロパティ名 property を value の値で書き換え、PropertyChanged イベントを発火します。 プロパティ変更通知まえに当該プロパティの検証エラーの削除を行います。 propertyName が省略された場合、呼び出し元のプロパティの名前を用います。

Declaration
protected void SetPropertyWithRemoveItemValidationError<T>(ref T property, T value, string propertyName = null)
Parameters
Type Name Description
T property
T value
System.String propertyName
Type Parameters
Name Description
T

Implements

System.ComponentModel.INotifyPropertyChanged
System.IDisposable
System.Windows.IWeakEventListener
System.ComponentModel.IDataErrorInfo
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • ValidationViewModelBase()
  • Properties
    • Error
    • IsValid
    • Item[String]
    • ViewModelState
  • Methods
    • IsPropertyAnnotationError(String)
    • IsPropertyAnnotationError<T>(Expression<Func<T>>)
    • RaisePropertyChangedWithRemoveItemValidationError(String)
    • RaisePropertyChangedWithRemoveItemValidationError<T>(Expression<Func<T>>)
    • RemoveItemValidationError(String)
    • RemoveItemValidationError<T>(Expression<Func<T>>)
    • SetPropertyWithRemoveItemValidationError<T>(ref T, T, String)
  • Implements
Back to top Generated by DocFX