From bfd79c7ca947ec205a238a334bfe7f37fd40bb21 Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 27 Aug 2013 19:11:43 +0000 Subject: WinGui: Some more work on the Instant HandBrake prototype. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5756 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'win/CS/HandBrakeWPF/Commands') diff --git a/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs b/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs index 617778b08..e9ec9966a 100644 --- a/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs +++ b/win/CS/HandBrakeWPF/Commands/CancelScanCommand.cs @@ -49,7 +49,7 @@ namespace HandBrakeWPF.Commands /// private void ScanServiceWrapperScanCompleted(object sender, HandBrake.ApplicationServices.EventArgs.ScanCompletedEventArgs e) { - Caliburn.Micro.Execute.OnUIThread(() => this.CanExecuteChanged(sender, EventArgs.Empty)); + Caliburn.Micro.Execute.OnUIThread(this.OnCanExecuteChanged); } /// @@ -64,7 +64,7 @@ namespace HandBrakeWPF.Commands /// private void ScanServiceWrapperScanStared(object sender, EventArgs e) { - Caliburn.Micro.Execute.OnUIThread(() => this.CanExecuteChanged(sender, EventArgs.Empty)); + Caliburn.Micro.Execute.OnUIThread(this.OnCanExecuteChanged); } #region Implementation of ICommand @@ -100,6 +100,18 @@ namespace HandBrakeWPF.Commands /// public event EventHandler CanExecuteChanged; + /// + /// The on can execute changed. + /// + protected virtual void OnCanExecuteChanged() + { + EventHandler handler = this.CanExecuteChanged; + if (handler != null) + { + handler(this, EventArgs.Empty); + } + } + #endregion } } -- cgit v1.2.3