Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Commit

Permalink
Refresh Manager context actions with selection changed. (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
elipriaulx authored and johanneszab committed Dec 19, 2018
1 parent 8b0b340 commit ee3e4eb
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@ public async Task InitializeAsync()

shellService.ContentView = ManagerViewModel.View;

// Refresh command availability on selection change.
ManagerViewModel.PropertyChanged += (sender, e) =>
{
if (e.PropertyName != nameof(ManagerViewModel.SelectedBlogFile))
return;

showFilesCommand.RaiseCanExecuteChanged();
visitBlogCommand.RaiseCanExecuteChanged();
showDetailsCommand.RaiseCanExecuteChanged();
copyUrlCommand.RaiseCanExecuteChanged();
checkStatusCommand.RaiseCanExecuteChanged();
};

if (shellService.Settings.CheckClipboard)
{
shellService.ClipboardMonitor.OnClipboardContentChanged += OnClipboardContentChanged;
Expand Down

0 comments on commit ee3e4eb

Please sign in to comment.