Skip to content

Commit 8f8b2d7

Browse files
committed
notify change of SearchSource's image after selection
1 parent e2dff94 commit 8f8b2d7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Plugins/Flow.Launcher.Plugin.WebSearch/SearchSource.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public string IconPath
4747
[JsonIgnore]
4848
public ImageSource Image => ImageLoader.Load(IconPath);
4949

50+
internal void NotifyImageChange() => OnPropertyChanged(nameof(Image));
51+
5052
public string Url { get; set; }
5153
public bool Enabled { get; set; }
5254

Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceViewModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using Flow.Launcher.Infrastructure;
1+
using Flow.Launcher.Infrastructure;
22
using Flow.Launcher.Infrastructure.UserSettings;
33
using System;
44
using System.IO;
55
using System.Windows.Forms;
66

77
namespace Flow.Launcher.Plugin.WebSearch
88
{
9-
public class SearchSourceViewModel
9+
public class SearchSourceViewModel : BaseModel
1010
{
1111
private readonly string destinationDirectory =
1212
Path.Combine(DataLocation.DataDirectory(), @"Settings\Plugins\Flow.Launcher.Plugin.WebSearch\IconImages");
@@ -30,6 +30,8 @@ public void CopyNewImageToUserDataDirectory(SearchSource selectedSearchSource, s
3030
Directory.CreateDirectory(destinationDirectory);
3131

3232
File.Copy(fullpathToSelectedImage, destinationFileNameFullPath);
33+
34+
selectedSearchSource.NotifyImageChange();
3335
}
3436
catch(Exception e)
3537
{

0 commit comments

Comments
 (0)