public CalculatorViewModel(IEventAggregator eventsAggregator, RiflesModel riflesModel, AmmoModel cartridgeModel, ConfigurationModel configurationModel) : base(eventsAggregator) { this.riflesModel = riflesModel; this.configurationModel = configurationModel; this.cartridgeModel = cartridgeModel; selectedRifle = null; DisplayName = "Ballistic Calculation"; configurationModel.Load(); selectedRifle = configurationModel.CalculatorSettings.CurrentRifle; var rifles = Rifles.ToList(); if (string.IsNullOrWhiteSpace(selectedRifle?.Name) && rifles.Count > 0) SelectedRifle = rifles.OrderByDescending(x => x.Name).FirstOrDefault(); if (selectedRifle != null) { selectedCartridge = configurationModel.CalculatorSettings.CurrentCartridge; if (string.IsNullOrWhiteSpace(selectedCartridge?.Name)) selectedCartridge = selectedRifle.Cartridge; } }
public ScopesViewModel(ScopesModel scopesModel, ConfigurationModel configurationModel, RiflesModel riflesModel, IWindowManager windowManager, IEventAggregator eventsAggregator) : base(eventsAggregator) { this.scopesModel = scopesModel; this.windowManager = windowManager; this.configurationModel = configurationModel; DisplayName = "Scopes"; this.riflesModel = riflesModel; }
public RiflesViewModel(RiflesModel riflesModel, ConfigurationModel configurationModel, AmmoModel cartridgesModel, ScopesModel scopesModel, IWindowManager windowManager, IEventAggregator eventsAggregator) : base(eventsAggregator) { DisplayName = "Rifles"; this.riflesModel = riflesModel; this.configurationModel = configurationModel; this.cartridgesModel = cartridgesModel; this.scopesModel = scopesModel; this.windowManager = windowManager; }
public AmmoViewModel(AmmoModel ammoModel, RiflesModel riflesModel, ConfigurationModel configurationModel, IWindowManager windowManager, IEventAggregator eventsAggregator) : base(eventsAggregator) { #pragma warning disable CC0021 // Use nameof DisplayName = "Cartridges"; #pragma warning restore CC0021 // Use nameof this.ammoModel = ammoModel; this.configurationModel = configurationModel; this.windowManager = windowManager; configurationModel.Initialize(); this.eventsAggregator = eventsAggregator; this.riflesModel = riflesModel; }