protected TankViewModelBase(CommandBindingCollection commandBindings, ITank tank, HangarViewModel owner) : base(commandBindings, tank) { this.Owner = owner; this.BattleTiers = new BattleTiersViewModel(this.Tank.BattleTiers); this.Price = new PriceViewModel(this.Tank.Price, this.Tank.CurrencyType); this.InitializeModuleViewModels(); this.InitializeEquipmentAndConsumableViewModels(); this.InitializeCrews(); this.UpdateModificationContext(); }
public BenchmarkTankViewModel(CommandBindingCollection commandBindings, ITank tank, HangarViewModel owner) : base(commandBindings, tank, owner) { }
public SearchResultItemViewModel(CommandBindingCollection commandBindings, ITankInfo tankInfo, HangarViewModel owner) { _commandBindings = commandBindings; this.Tank = tankInfo; this.Owner = owner; this.SelectTankCommand = new RelayCommand(() => owner.SelectSearchResultTank(this.Tank)); this.SelectAsReferenceTankCommand = new RelayCommand(() => owner.SelectSearchResultTankAsReferenceTank(this.Tank)); }
public static TankViewModelBase CreateTank(CommandBindingCollection commandBindings, ITank tank, HangarViewModel owner) { if (tank is Tank) { return(new TankViewModel(commandBindings, (Tank)tank, owner)); } if (tank is BenchmarkTank) { return(new BenchmarkTankViewModel(commandBindings, tank, owner)); } return(null); }