/// <inheritdoc /> public override void AwakeFromNib() { // TODO: Delete this call? JzIntv.Model.Emulator.Instances(); // Why is this here? It doesn't have side effects. DisplayResolutionsArrayController.SynchronizeCollection(ViewModel.AvailableDisplayResolutions); _initializedDisplayResolutions = true; var selectedResolutionViewModel = ViewModel.SelectedDisplayResolutionViewModel; var selectedResolution = selectedResolutionViewModel == null ? JzIntvSettingsPageViewModel.DefaultResolution : selectedResolutionViewModel.Resolution; selectedResolutionViewModel = ViewModel.AvailableDisplayResolutions.First(r => r.Resolution == selectedResolution); if (selectedResolutionViewModel != null) { var selectedIndex = ViewModel.AvailableDisplayResolutions.IndexOf(selectedResolutionViewModel); if (selectedIndex >= 0) { DisplayResolutionsArrayController.SelectionIndex = (SelIndexType)selectedIndex; } } JzIntvDisplayModesController.SynchronizeCollection(ViewModel.AvailableDisplayModes); _initializeDisplayModes = true; var selectedModeViewModel = ViewModel.SelectedDisplayModeViewModel; var selectedMode = selectedModeViewModel == null ? JzIntvSettingsPageViewModel.DefaultMode : selectedModeViewModel.DisplayMode; selectedModeViewModel = ViewModel.AvailableDisplayModes.First(m => m.DisplayMode == selectedMode); if (selectedModeViewModel != null) { var selectedIndex = ViewModel.AvailableDisplayModes.IndexOf(selectedModeViewModel); if (selectedIndex >= 0) { JzIntvDisplayModesController.SelectionIndex = (SelIndexType)selectedIndex; } } if (LastSelectedTab == SelectedTab.None) { LastSelectedTab = ConfigurationCommandGroup.AreRequiredEmulatorPathsValid(false) ? SelectedTab.General : SelectedTab.Paths; } var tab = View.FindChild <NSTabView>(); if (LastSelectedTab > SelectedTab.None) { tab.SelectAt((int)LastSelectedTab - 1); } InitializeAlwaysUpdateDelegates(tab); InitializeCommandLineModeRadioButtons(tab); tab.DidSelect += OnTabSelected; View.Controller = this; HandleViewModelPropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(JzIntvSettingsPageViewModel.EnableIntellivoicePropertyName)); HandleViewModelPropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(JzIntvSettingsPageViewModel.EnableEcsPropertyName)); ViewModel.PropertyChanged += HandleViewModelPropertyChanged; }
void ReleaseDesignerOutlets() { if (DisplayResolutionsArrayController != null) { DisplayResolutionsArrayController.Dispose(); DisplayResolutionsArrayController = null; } if (JzIntvDisplayModesController != null) { JzIntvDisplayModesController.Dispose(); JzIntvDisplayModesController = null; } }