summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2014-05-24 17:25:48 +0000
committersr55 <[email protected]>2014-05-24 17:25:48 +0000
commit9ab2cefc88f522c02817a248e2b8d964d186c04f (patch)
tree643d7aca00d99162a5eef4a05f4b29601de45b87 /win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
parent281c44b0914b21ff6dea0b401a0312d09197a4c3 (diff)
WinGui: Don't grab previews when the preview window hasn't been opened. (Note, there is still a crash that sometimes happens for some resolutions that needs fixed, but the UI shouldn't crash anymore if the window hasn't been opened)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6205 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index b10c0f292..51c018ad9 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -12,6 +12,7 @@ namespace HandBrakeWPF.ViewModels
using System;
using System.Collections.Generic;
using System.Globalization;
+ using System.Windows;
using System.Windows.Media.Imaging;
using Caliburn.Micro;
@@ -825,6 +826,7 @@ namespace HandBrakeWPF.ViewModels
{
if (!string.IsNullOrEmpty(this.Task.Source))
{
+ this.StaticPreviewViewModel.IsOpen = true;
this.StaticPreviewViewModel.UpdatePreviewFrame(this.Task);
this.WindowManager.ShowWindow(this.StaticPreviewViewModel);
}
@@ -1197,7 +1199,7 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private void UpdatePreviewImage()
{
- if (delayedPreviewprocessor != null && this.Task != null)
+ if (delayedPreviewprocessor != null && this.Task != null && this.StaticPreviewViewModel != null && this.StaticPreviewViewModel.IsOpen)
{
delayedPreviewprocessor.PerformTask(() => this.StaticPreviewViewModel.UpdatePreviewFrame(this.Task), 800);
}