本文整理汇总了C#中System.ComponentModel.PropertyChangedEventArgs.HasPropertyChanged方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyChangedEventArgs.HasPropertyChanged方法的具体用法?C# PropertyChangedEventArgs.HasPropertyChanged怎么用?C# PropertyChangedEventArgs.HasPropertyChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ComponentModel.PropertyChangedEventArgs
的用法示例。
在下文中一共展示了PropertyChangedEventArgs.HasPropertyChanged方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnViewModelPropertyChanged
protected override void OnViewModelPropertyChanged(PropertyChangedEventArgs e)
{
base.OnViewModelPropertyChanged(e);
if (e.HasPropertyChanged("CurrentPage"))
{
Dispatcher.BeginInvoke(async () =>
{
var vm = (WizardViewModel) ViewModel;
breadcrumb.CenterSelectedItem();
breadcrumbProgress.UpdateProgress(vm.Wizard.CurrentPage.Number, vm.Wizard.Pages.Count());
// We need to await the animation
await TaskShim.Delay(WizardConfiguration.AnimationDuration);
UpdateOpacityMask();
});
}
}
示例2: ReturnsFalseForDifferentPropertyName
public void ReturnsFalseForDifferentPropertyName()
{
var propertyChangedEventArgs = new PropertyChangedEventArgs("TestPropertyNotExisting");
Assert.IsFalse(propertyChangedEventArgs.HasPropertyChanged(() => TestProperty));
}
示例3: ReturnsTrueForSamePropertyName
public void ReturnsTrueForSamePropertyName()
{
var propertyChangedEventArgs = new PropertyChangedEventArgs("TestProperty");
Assert.IsTrue(propertyChangedEventArgs.HasPropertyChanged(() => TestProperty));
}
示例4: ThrowsArgumentNullExceptionForNullPropertyExpressionArguments
public void ThrowsArgumentNullExceptionForNullPropertyExpressionArguments()
{
var propertyChangedEventArgs = new PropertyChangedEventArgs("TestProperty");
ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => propertyChangedEventArgs.HasPropertyChanged((Expression<Func<string>>)null));
}