protected async override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.view_stats); var name = Intent.GetStringExtra("name"); var id = Intent.GetStringExtra("id"); viewModel = new StatisticsViewModel(Mvx.Resolve<IMeetupService>(), Mvx.Resolve<IDataService>()); viewModel.Init(id, name); SupportActionBar.Title = viewModel.GroupName; barChart = FindViewById<BarChartView>(Resource.Id.barChart); barChart.LegendColor = Color.Black; progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar); viewModel.ShowPopUps = false; // Perform any additional setup after loading the view, typically from a nib. }
public static async Task<List<BarModel>> GenerateData(StatisticsViewModel vm, UIColor up, UIColor down) #endif { var models = new List<BarModel>(); if (vm.GroupsEventsCount.Count == 0) await vm.ExecuteRefreshCommand(); int previous = -1; foreach (var eventInGroup in vm.GroupsEventsCount) { var color = previous == -1 || previous < eventInGroup.Value ? up : down; models.Add(new BarModel() { Value = eventInGroup.Value, Color = color, Legend = vm.FromUnixTime(eventInGroup.Key).ToString("MM/dd/yy") }); previous = eventInGroup.Value; } return models; }
public StatisticsView(string gId, string gName) { InitializeComponent(); BindingContext = viewModel = new StatisticsViewModel(this, gId, gName); }
public static async Task<List<BarModel>> GenerateData(StatisticsViewModel vm, Color up, Color down)