I send a property changed event for two different property values in the same block of code. In between is a Sleep Command. The Window does not update the property.
XAML:
<TextBlock Text="{Binding ReferenceRunExecuting}" /> Code behind:
ReferenceRunExecuting = true; Thread.Sleep(TimeSpan.FromSeconds(2)); ReferenceRunExecuting = false; Property:
private bool _referenceRunExecuting = false; public bool ReferenceRunExecuting { get { return _referenceRunExecuting; } set { if (value != _referenceRunExecuting) { _referenceRunExecuting = value; OnPropertyChanged("ReferenceRunExecuting"); } } } OnPropertyChanged:
public void OnPropertyChanged(string propertyChanged) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyChanged)); }
setmethod is being called properly?