From 5acda54e340bb696baacd267b92f031ab7157924 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 17 Sep 2017 16:13:31 +0100 Subject: [PATCH] WinGui: Experimenting with InLine vs Preset Pane designs. --- .../HandBrakeWPF/ViewModels/MainViewModel.cs | 29 +++ win/CS/HandBrakeWPF/Views/MainView.xaml | 208 +++++++++++++++++- win/CS/HandBrakeWPF/Views/MainView.xaml.cs | 41 ++++ win/CS/HandBrakeWPF/Views/ShellView.xaml | 4 +- win/CS/HandBrakeWPF/defaultsettings.xml | 8 + 5 files changed, 287 insertions(+), 3 deletions(-) diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 5d7d10027..3c8281145 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -89,6 +89,7 @@ namespace HandBrakeWPF.ViewModels private Preset selectedPreset; private EncodeTask queueEditTask; private int lastEncodePercentage; + private bool isPresetPanelShowing; private bool showSourceSelection; private BindingList drives; private bool canPause; @@ -950,6 +951,31 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets or sets a value indicating whether is preset panel showing. + /// + public bool IsPresetPanelShowing + { + get + { + return this.isPresetPanelShowing; + } + set + { + if (!Equals(this.isPresetPanelShowing, value)) + { + this.isPresetPanelShowing = value; + this.NotifyOfPropertyChange(() => this.IsPresetPanelShowing); + + // Save the setting if it has changed. + if (this.userSettingService.GetUserSetting(UserSettingConstants.ShowPresetPanel) != value) + { + this.userSettingService.SetUserSetting(UserSettingConstants.ShowPresetPanel, value); + } + } + } + } + /// /// Gets or sets a value indicating progress percentage. /// @@ -1208,6 +1234,9 @@ namespace HandBrakeWPF.ViewModels // Perform an update check if required this.updateService.PerformStartupUpdateCheck(this.HandleUpdateCheckResults); + // Show or Hide the Preset Panel. + this.IsPresetPanelShowing = this.userSettingService.GetUserSetting(UserSettingConstants.ShowPresetPanel); + // Setup the presets. this.presetService.Load(); this.PresetsCategories = this.presetService.Presets; diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 57f2cb518..34a7c159a 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -6,6 +6,10 @@ xmlns:Properties="clr-namespace:HandBrakeWPF.Properties" xmlns:cal="http://www.caliburnproject.org" xmlns:menu="clr-namespace:HandBrakeWPF.Commands.Menu" + xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" + xmlns:commands="clr-namespace:HandBrakeWPF.Commands" + xmlns:helpers="clr-namespace:HandBrakeWPF.Helpers" + xmlns:loc="clr-namespace:HandBrakeWPF.Services.Presets.Model" AllowDrop="True" FontSize="11" cal:Message.Attach="[Event Loaded] = [Action Load]" @@ -25,6 +29,11 @@ + + @@ -81,6 +90,8 @@ + + @@ -245,6 +256,10 @@ + + + + @@ -330,7 +345,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +