diff --git a/src/modules/launcher/PowerLauncher.UI/LauncherControl.xaml.cs b/src/modules/launcher/PowerLauncher.UI/LauncherControl.xaml.cs index 31ca2be00a..245ea2c5ff 100644 --- a/src/modules/launcher/PowerLauncher.UI/LauncherControl.xaml.cs +++ b/src/modules/launcher/PowerLauncher.UI/LauncherControl.xaml.cs @@ -13,25 +13,14 @@ using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; -// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 - namespace PowerLauncher.UI { public sealed partial class LauncherControl : UserControl { - List SearchResults; public LauncherControl() { this.InitializeComponent(); ShellBarShadow.Receivers.Add(ShadowReceiverGrid); } } - - - public class SearchApp - { - public string Title { get; set; } - public string Icon { get; set; } - public string Path { get; set; } - } } diff --git a/src/modules/launcher/Wox.Plugin/BaseModel.cs b/src/modules/launcher/Wox.Plugin/BaseModel.cs index 107fe81e7d..c332529d36 100644 --- a/src/modules/launcher/Wox.Plugin/BaseModel.cs +++ b/src/modules/launcher/Wox.Plugin/BaseModel.cs @@ -1,5 +1,7 @@ -using System.ComponentModel; +using System; +using System.ComponentModel; using System.Runtime.CompilerServices; +using System.Windows; using JetBrains.Annotations; namespace Wox.Plugin @@ -11,7 +13,13 @@ namespace Wox.Plugin [NotifyPropertyChangedInvocator] protected void OnPropertyChanged([CallerMemberName] string propertyName = null) { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + if (Application.Current.Dispatcher.CheckAccess()) + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + else + Application.Current.Dispatcher.BeginInvoke(new Action(() => + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + })); } } } \ No newline at end of file