protected override void OnFinalize() { this._gauntletLayer.IsFocusLayer = false; ScreenManager.TryLoseFocus(this._gauntletLayer); this._dataSource.OnFinalize(); this._dataSource = null; this._gauntletLayer.ReleaseMovie(this._movie); base.MenuViewContext.RemoveLayer(this._gauntletLayer); this._movie = null; this._gauntletLayer = null; MapScreen mapScreen; if ((mapScreen = (ScreenManager.TopScreen as MapScreen)) != null) { mapScreen.IsInHideoutTroopManage = false; } base.OnFinalize(); }
protected override void OnInitialize() { base.OnInitialize(); this._dataSource = new SpousesSelectTroopsVM(this._initialRoster, this._maxNum, this._changeChangeStatusOfTroop, this._onDone) { IsEnabled = true }; this._gauntletLayer = new GauntletLayer(205, "GauntletLayer") { Name = "MenuSpouseSelectTroops" }; this._gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All); this._gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericCampaignPanelsGameKeyCategory")); this._movie = this._gauntletLayer.LoadMovie("SpousesSelectTroops", this._dataSource); this._gauntletLayer.IsFocusLayer = true; ScreenManager.TrySetFocus(this._gauntletLayer); base.MenuViewContext.AddLayer(this._gauntletLayer); MapScreen mapScreen; if ((mapScreen = (ScreenManager.TopScreen as MapScreen)) != null) { mapScreen.IsInHideoutTroopManage = true; } }