public TypeDetailWindow(PlanetTypeStatistic planetTypeStatistic) { InitializeComponent(); this.ViewContext.OxygenChart = this.OxygenChart; this.ViewContext.OxygenChartGrid = this.OxygenChartGrid; this.ViewContext.FoodChart = this.FoodChart; this.ViewContext.FoodChartGrid = this.FoodChartGrid; this.ViewContext.FuelChart = this.FuelChart; this.ViewContext.FuelChartGrid = this.FuelChartGrid; this.ViewContext.Statistic = planetTypeStatistic; this.ViewContext.Load(); }
public void AddPlanet(Planet planet) { if (!planetTypeCache.TryGetValue(planet.Type.Name, out PlanetTypeStatistic planetTypeStatistic)) { planetTypeStatistic = new PlanetTypeStatistic(planet.Type); planetTypeCache[planet.Type.Name] = planetTypeStatistic; OnPropertyChanged(nameof(PlanetTypeStatistics)); } if (planetTypeStatistic.Add(planet)) { lock (lockerObject) { TotalPlanets++; } } }
private void ExecuteViewDetailsCommand(PlanetTypeStatistic typeStatistic) { new TypeDetailWindow(typeStatistic) { }.Show(); }