Ejemplo n.º 1
0
 public CatalogStatisticsUserControl(Enums.STAT categoryStat)
 {
     InitializeComponent();
     lineChartUC = new LineChartUserControl();
     barChartUC  = new BarChartUserControl();
     setStatisticCatalog(categoryStat);
     this.DataContext = catalogStatVM;
     // init with line chart
     lineChartUC.SetValue(Grid.RowProperty, 2);
     lineChartUC.SetValue(Grid.ColumnProperty, 0);
     MainLayout.Children.Add(lineChartUC);
 }
        public CatalogStatViewModel(Enums.STAT categoryStat)
        {
            this.itemsModel = new ItemsModel();
            this.statistics = categoryStat;
            Title           = "Long-Term " + ((Enums.STAT)categoryStat).ToString();

            AggregationDay = new List <string>()
            {
                "Sunday", "Monday", "Tuestday", "Wendsday", "Thirstday", "Friday", "Saturday"
            };
            AggregationWeek = new List <string>()
            {
                "1st Week", "2st Week", "3st Week", "4st Week"
            };
            AggregationMonth = new List <string>()
            {
                "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
            };
            AggregationYear = new List <string>();
            for (int i = DateTime.Now.Year; i >= 1970; --i)
            {
                AggregationYear.Add(i.ToString());
            }

            foreach (var item in itemsModel.getAllProductsTupleNameKey())
            {
                if (!itemNames.ContainsKey(item.Item1))
                {
                    itemNames.Add(item.Item1, item.Item2);
                }
            }

            selectedMonth     = -1;
            selectedWeek      = -1;
            monthSelected     = false;
            SelectedIndexYear = 8;
        }
 public void OnCatalogChange(Enums.STAT categoryStat)
 {
     this.statistics = categoryStat;
     Title           = "Long-Term " + ((Enums.STAT)categoryStat).ToString();
 }