From 0c541998fd82d300293ce9b7ab508d2f25627543 Mon Sep 17 00:00:00 2001 From: Scott Date: Sat, 24 Oct 2015 20:54:18 +0100 Subject: [PATCH] Improve the In-line queue display. --- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 7 + .../HandBrakeWPF/ViewModels/MainViewModel.cs | 6 +- .../HandBrakeWPF/ViewModels/QueueViewModel.cs | 6 +- win/CS/HandBrakeWPF/Views/MainView.xaml | 5 +- win/CS/HandBrakeWPF/Views/Queue/Embedded.xaml | 280 ++++++++++++++++++ .../HandBrakeWPF/Views/Queue/Embedded.xaml.cs | 27 ++ win/CS/HandBrakeWPF/Views/QueueView.xaml | 19 +- win/CS/HandBrakeWPF/Views/QueueView.xaml.cs | 7 +- 8 files changed, 336 insertions(+), 21 deletions(-) create mode 100644 win/CS/HandBrakeWPF/Views/Queue/Embedded.xaml create mode 100644 win/CS/HandBrakeWPF/Views/Queue/Embedded.xaml.cs diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 91d292c20..2af3ba412 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -297,6 +297,9 @@ MiniView.xaml + + Embedded.xaml + ShellView.xaml @@ -478,6 +481,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + Designer MSBuild:Compile diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 7a1f586a2..64b75e793 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1228,16 +1228,14 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => this.IsQueueShowingInLine); this.QueueViewModel.Activate(false); - Window window = Application.Current.Windows.Cast().FirstOrDefault(x => x.Content.GetType() == typeof(QueueView)); - + Window window = Application.Current.Windows.Cast().FirstOrDefault(x => x.GetType() == typeof(QueueView)); if (window != null) { window.Activate(); } else { - // TODO to control the size of this window, we will probably have to create a new window for hosting the queue. - this.windowManager.ShowWindow(this.QueueViewModel); + this.windowManager.ShowWindow(IoC.Get()); } } } diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index 18bb49284..cd3405d78 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -165,7 +165,7 @@ namespace HandBrakeWPF.ViewModels /// /// Display the current job status information. /// - public bool DisplayJobStatusInfo { get; set; } = false; + public bool IsQueueEmbedded { get; set; } = false; #endregion @@ -393,8 +393,8 @@ namespace HandBrakeWPF.ViewModels /// Indicdates if this panel is displayed in-line with the main view. public void Activate(bool isInline) { - this.DisplayJobStatusInfo = !isInline; - this.NotifyOfPropertyChange(() => this.DisplayJobStatusInfo); + this.IsQueueEmbedded = !isInline; + this.NotifyOfPropertyChange(() => this.IsQueueEmbedded); } #endregion diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 9cdbfb626..bfec2c3e6 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -485,7 +485,7 @@ diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs b/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs index e69dabe77..344a804cf 100644 --- a/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs @@ -10,19 +10,20 @@ namespace HandBrakeWPF.Views { using System.Windows; - using System.Windows.Controls; + + using HandBrakeWPF.Views; /// /// Interaction logic for VideoView /// - public partial class QueueView : UserControl + public partial class QueueView : Window { /// /// Initializes a new instance of the class. /// public QueueView() { - InitializeComponent(); + this.InitializeComponent(); } } } -- 2.40.0