From 144d696814bbfc133e05293ce53da520267ae6e0 Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 22 Jul 2015 18:04:29 +0000 Subject: WinGui: Minor tidy up of the Main VM constructor. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7365 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../HandBrakeWPF/ViewModels/AdvancedViewModel.cs | 11 ++++++ win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 46 ++++++++++++++++------ 2 files changed, 46 insertions(+), 11 deletions(-) (limited to 'win') diff --git a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs index da068d193..c4fc78868 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs @@ -30,6 +30,17 @@ namespace HandBrakeWPF.ViewModels #endregion + /// + /// Initializes a new instance of the class. + /// + /// + /// The x 264 view model. + /// + public AdvancedViewModel(IX264ViewModel x264ViewModel) + { + this.X264ViewModel = x264ViewModel; + } + #region Properties /// diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 638264d84..320ffbf23 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -239,9 +239,35 @@ namespace HandBrakeWPF.ViewModels /// /// The window Manager. /// + /// + /// The picture Settings View Model. + /// + /// + /// The video View Model. + /// + /// + /// The filters View Model. + /// + /// + /// The audio View Model. + /// + /// + /// The subtitles View Model. + /// + /// + /// The advanced View Model. + /// + /// + /// The chapters View Model. + /// + /// + /// The static Preview View Model. + /// public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService, IErrorService errorService, IUpdateService updateService, INotificationService notificationService, - IPrePostActionService whenDoneService, IWindowManager windowManager) + IPrePostActionService whenDoneService, IWindowManager windowManager, IPictureSettingsViewModel pictureSettingsViewModel, IVideoViewModel videoViewModel, + IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel, + IAdvancedViewModel advancedViewModel, IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel) { this.scanService = scanService; this.encodeService = encodeService; @@ -253,16 +279,14 @@ namespace HandBrakeWPF.ViewModels this.userSettingService = userSettingService; this.queueProcessor = IoC.Get(); - // TODO tidy up. The new Simple Container IOC isn't doing property injection for some reason, so temp IoC.get the properties set by it. - this.PictureSettingsViewModel = IoC.Get(); - this.VideoViewModel = IoC.Get(); - this.FiltersViewModel = IoC.Get(); - this.AudioViewModel = IoC.Get(); - this.SubtitleViewModel = IoC.Get(); - this.ChaptersViewModel = IoC.Get(); - this.AdvancedViewModel = IoC.Get(); - IoC.BuildUp(this.AdvancedViewModel); - this.StaticPreviewViewModel = IoC.Get(); + this.PictureSettingsViewModel = pictureSettingsViewModel; + this.VideoViewModel = videoViewModel; + this.FiltersViewModel = filtersViewModel; + this.AudioViewModel = audioViewModel; + this.SubtitleViewModel = subtitlesViewModel; + this.ChaptersViewModel = chaptersViewModel; + this.AdvancedViewModel = advancedViewModel; + this.StaticPreviewViewModel = staticPreviewViewModel; // Setup Properties this.WindowTitle = Resources.HandBrake_Title; -- cgit v1.2.3