本文整理汇总了C#中System.ComponentModel.PropertyChangedEventArgs.IsProperty方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyChangedEventArgs.IsProperty方法的具体用法?C# PropertyChangedEventArgs.IsProperty怎么用?C# PropertyChangedEventArgs.IsProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ComponentModel.PropertyChangedEventArgs
的用法示例。
在下文中一共展示了PropertyChangedEventArgs.IsProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPropertyChanged
private void OnPropertyChanged(object sender, PropertyChangedEventArgs args)
{
// Sample of strongly typed property changed checking (MyToolkit only)
if (args.IsProperty<MvvmSamplePageModel>(i => i.DependentProperty))
{
// TODO: Add logic for handling DependentProperty change
}
}
示例2: OnValidateProperty
/// <summary>Called when a property needs to be validated. </summary>
/// <param name="sender">The sender. </param>
/// <param name="args">The arguments. </param>
protected virtual void OnValidateProperty(object sender, PropertyChangedEventArgs args)
{
if (AutoValidateProperties &&
!args.IsProperty<ValidatedObservableObject>(o => o.HasErrors) &&
!args.IsProperty<ValidatedObservableObject>(o => o.InvalidProperties) &&
!args.IsProperty<ValidatedObservableObject>(o => o.InvariantErrors))
{
var propertyErrors = ValidateProperty(args.PropertyName);
SetPropertyErrors(args.PropertyName, propertyErrors);
var invariantErrors = ValidateInvariants();
SetPropertyErrors(string.Empty, invariantErrors);
}
}
示例3: UndoRedoManagerOnPropertyChanged
private void UndoRedoManagerOnPropertyChanged(object sender, PropertyChangedEventArgs args)
{
if (args.IsProperty<UndoRedoManager>(i => i.CanUndo))
{
UndoCommand.RaiseCanExecuteChanged();
SaveDocumentCommand.RaiseCanExecuteChanged();
SaveDocumentAsCommand.RaiseCanExecuteChanged();
}
if (args.IsProperty<UndoRedoManager>(i => i.CanRedo))
RedoCommand.RaiseCanExecuteChanged();
}