Skip to content
Discussion options

You must be logged in to vote

You can remove the PropertyChangedDispatcher and call the PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)) directly. Or try something like this:

 public class ObservableObject : INotifyPropertyChanged
 {
     /// <summary>
     /// Gets or sets the dispatcher to use to dispatch PropertyChanged events. Defaults to UI thread.
     /// </summary>
     public virtual Action<Action> PropertyChangedDispatcher { get; set; }

     /// <summary>
     /// Occurs when a property value changes
     /// </summary>
     public event PropertyChangedEventHandler? PropertyChanged;

     public ObservableObject()
     {
         if (Application.Current != null)
         {

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jg-at-home
Comment options

Answer selected by jg-at-home
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants