diff options
author | sr55 <[email protected]> | 2015-01-17 23:03:53 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-01-17 23:03:53 +0000 |
commit | 9250daa1b69db695007f2b43ae19ec2d66112ef9 (patch) | |
tree | 1bf8b813f10f78f6155ba367d23503bdcd03554a /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | |
parent | 7f7da739dc4485771416931aab652b6651737d69 (diff) |
WinGui: Combine the Still and Live previews into a single window in the same style as the Mac and Linux GUI's
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6765 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 7280bc091..788b2ba0f 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1037,6 +1037,11 @@ namespace HandBrakeWPF.ViewModels }
}
+ /// <summary>
+ /// Gets or sets the static preview view model.
+ /// </summary>
+ public IStaticPreviewViewModel StaticPreviewViewModel { get; set; }
+
#endregion
#region Load and Shutdown Handling
@@ -1158,18 +1163,11 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void OpenPreviewWindow()
{
- Window window = Application.Current.Windows.Cast<Window>().FirstOrDefault(x => x.GetType() == typeof(PreviewView));
- IPreviewViewModel viewModel = IoC.Get<IPreviewViewModel>();
-
- if (window != null)
+ if (!string.IsNullOrEmpty(this.CurrentTask.Source))
{
- viewModel.Task = this.CurrentTask;
- window.Activate();
- }
- else
- {
- viewModel.Task = this.CurrentTask;
- this.WindowManager.ShowWindow(viewModel);
+ this.StaticPreviewViewModel.IsOpen = true;
+ this.StaticPreviewViewModel.UpdatePreviewFrame(this.CurrentTask);
+ this.WindowManager.ShowWindow(this.StaticPreviewViewModel);
}
}
@@ -1845,10 +1843,6 @@ namespace HandBrakeWPF.ViewModels this.ChaptersViewModel.UpdateTask(this.CurrentTask);
this.AdvancedViewModel.UpdateTask(this.CurrentTask);
- // Tell the Preivew Window
- IPreviewViewModel viewModel = IoC.Get<IPreviewViewModel>();
- viewModel.Task = this.CurrentTask;
-
// Cleanup
this.ShowStatusWindow = false;
this.SourceLabel = this.SourceName;
|