Skip to content

Commit

Permalink
Merge pull request #47 from H4llJ0rdan/bugfix/entryViewModelPropertyC…
Browse files Browse the repository at this point in the history
…hanges

Ensured that OnPropertyChanged is invoked on UIThread.
  • Loading branch information
Toxantron authored Aug 7, 2024
2 parents b623ab6 + 3dea529 commit 83f262d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/Moryx.Controls/EntryEditor/EntryViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Windows.Threading;
using Moryx.Serialization;
using Moryx.Tools;

Expand Down Expand Up @@ -76,7 +77,10 @@ public string Value
if (Entry.Value.Current is not null && Entry.Value.Current.Equals(value))
return;
Entry.Value.Current = value;
OnPropertyChanged();
Dispatcher.CurrentDispatcher.Invoke(() =>
{
OnPropertyChanged();
});
}
}

Expand Down Expand Up @@ -105,7 +109,10 @@ public ObservableCollection<EntryViewModel> SubEntries
_subEntries.CollectionChanged -= SyncSubEntries;
_subEntries = value;
_subEntries.CollectionChanged += SyncSubEntries;
OnPropertyChanged();
Dispatcher.CurrentDispatcher.Invoke(() =>
{
OnPropertyChanged();
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Moryx.WpfToolkit
{
/// <summary>
/// Bass class for the eddie buttons which adds some dependency properties to the
/// Base class for the eddie buttons which adds some dependency properties to the
/// basic <see cref="Button"/>
/// </summary>
public abstract class EddieButtonBase : Button
Expand Down

0 comments on commit 83f262d

Please sign in to comment.