public new void OnFinalize() { base.OnFinalize(); bool flag = Game.Current != null; if (flag) { Game.Current.AfterTick = (Action <float>)Delegate.Remove(Game.Current.AfterTick, new Action <float>(this.AfterTick)); } this.parentView = null; }
public VassalServiceVM(KindomScreenVM parent, GauntletKingdomScreen parentScreen, Action editClanBanner) { this.parentView = parent; this.parentScreen = parentScreen; this.editClanBanner = editClanBanner; this._clans = new MBBindingList <VassalClanVM>(); this._members = new MBBindingList <MemberItemVM>(); Kingdom kingdom = Hero.MainHero.MapFaction as Kingdom; if (kingdom.Clans.Count > 1) { IEnumerable <Clan> list = kingdom.Clans.Where(obj => obj != Clan.PlayerClan); list.ToList().ForEach(obj => this._clans.Add(new VassalClanVM(obj, new Action <VassalClanVM>(OnSelectVassal)))); Clan clan = list.First(); IEnumerable <Hero> heros = clan.Heroes; heros.ToList().ForEach(obj => this._members.Add(new MemberItemVM(obj, new Action <MemberItemVM>(OnSelectMember)))); } this.RefreshValues(); }