示例#1
0
        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();
        }
示例#2
0
        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++;
                }
            }
        }
示例#3
0
 private void ExecuteViewDetailsCommand(PlanetTypeStatistic typeStatistic)
 {
     new TypeDetailWindow(typeStatistic)
     {
     }.Show();
 }