public LiveStreamControl() { ViewModel = (LiveStreamModel)this.DataContext; InitializeComponent(); LsCurrentMonthControl.DataContext = ViewModel; LsTodayControl.DataContext = ViewModel; }
public void DataBind(LiveStreamModel model) { ViewModel = model; //DataContext = (LiveStreamModel)model; LsTodayControl.DataBind(model); LsCurrentMonthControl.DataBind(model); }
public void DataBind(LiveStreamModel model) { ViewModel = (LiveStreamModel)model; this.DataContext = (LiveStreamModel)model; if (ViewModel.CycleMoneyDiagram != null) { LoadDiagram(ref chart); } }
public void DataBind(LiveStreamModel model) { ViewModel = (LiveStreamModel)model; this.DataContext = (LiveStreamModel)model; if (ViewModel.CurrentMonthDiagram != null && ViewModel.LastMonthDiagram != null) { LoadDiagram(ref chart); } UpdateColors(); }
private async void GetData() { // Simulate pulling data from api string response; StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(@"ms-appx:///DesignData/GetLive.json")); using (StreamReader sRead = new StreamReader(await file.OpenStreamForReadAsync())) response = await sRead.ReadToEndAsync(); // Deserialize data to class LiveStreamModel liveGames = JsonConvert.DeserializeObject <LiveStreamModel>(response); //Schedules = liveGames.schedule; // Group data by event var groupData = liveGames.schedule.GroupBy(a => a.@event); // Set cvs source to grouped data ScheduleSource = new CollectionViewSource() { IsSourceGrouped = true, Source = groupData }; }