notify change of SearchSource's image after selection

This commit is contained in:
Jeremy Wu 2020-07-22 20:35:56 +10:00
parent e2dff94f7c
commit 8f8b2d7ff8
2 changed files with 6 additions and 2 deletions

View file

@ -47,6 +47,8 @@ namespace Flow.Launcher.Plugin.WebSearch
[JsonIgnore]
public ImageSource Image => ImageLoader.Load(IconPath);
internal void NotifyImageChange() => OnPropertyChanged(nameof(Image));
public string Url { get; set; }
public bool Enabled { get; set; }

View file

@ -1,4 +1,4 @@
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.UserSettings;
using System;
using System.IO;
@ -6,7 +6,7 @@ using System.Windows.Forms;
namespace Flow.Launcher.Plugin.WebSearch
{
public class SearchSourceViewModel
public class SearchSourceViewModel : BaseModel
{
private readonly string destinationDirectory =
Path.Combine(DataLocation.DataDirectory(), @"Settings\Plugins\Flow.Launcher.Plugin.WebSearch\IconImages");
@ -30,6 +30,8 @@ namespace Flow.Launcher.Plugin.WebSearch
Directory.CreateDirectory(destinationDirectory);
File.Copy(fullpathToSelectedImage, destinationFileNameFullPath);
selectedSearchSource.NotifyImageChange();
}
catch(Exception e)
{