示例#1
0
 public LiveStreamControl()
 {
     ViewModel = (LiveStreamModel)this.DataContext;
     InitializeComponent();
     LsCurrentMonthControl.DataContext = ViewModel;
     LsTodayControl.DataContext        = ViewModel;
 }
示例#2
0
 public void DataBind(LiveStreamModel model)
 {
     ViewModel = model;
     //DataContext = (LiveStreamModel)model;
     LsTodayControl.DataBind(model);
     LsCurrentMonthControl.DataBind(model);
 }
示例#3
0
 public void DataBind(LiveStreamModel model)
 {
     ViewModel        = (LiveStreamModel)model;
     this.DataContext = (LiveStreamModel)model;
     if (ViewModel.CycleMoneyDiagram != null)
     {
         LoadDiagram(ref chart);
     }
 }
示例#4
0
 public void DataBind(LiveStreamModel model)
 {
     ViewModel        = (LiveStreamModel)model;
     this.DataContext = (LiveStreamModel)model;
     if (ViewModel.CurrentMonthDiagram != null && ViewModel.LastMonthDiagram != null)
     {
         LoadDiagram(ref chart);
     }
     UpdateColors();
 }
示例#5
0
        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
            };
        }