예제 #1
0
 public CachingEventRetriever()
 {
     this.NonCahcingImplementation = new EventRetriever();
 }
예제 #2
0
        private async Task LoadChannels()
        {
            ProgressRingControl.IsActive = true;
            Scroller.Opacity = 0;
            
            ScrollerContainer.Children.Clear();
            TimeHeaders.Children.Clear();
            ChannelsStackPanel.Children.Clear();
            SearchStatusText.Text = string.Empty;
            SearchHintContainer.Children.Clear();
            _currentTimeLine = null;
            viewModel.End = DateTime.MinValue;

            var start = viewModel.Start;
            var current = start.AddMinutes(30);

            var er = new EventRetriever();
            viewModel.ChannelList = await er.GetEventsForDateAsync(viewModel.Start, viewModel.Channels);

            foreach (var channel in viewModel.ChannelList)
            {
                var ci = channel.Events.Max(ev => ev.End);
                if (ci > viewModel.End)
                {
                    viewModel.End = ci;
                }
            }

            DrawTimeLines(current, viewModel.End, TimeWidth);
            DrawChannels(viewModel.ChannelList, start);
            DrawCurrentTimeLine(start, viewModel.End);
            UpdateFavorites();
            Scroller.Opacity = 1;
            UpdateLayout();
            CheckScrolling();
            TimeHeaders.Width = ScrollerContainer.ActualWidth;
            ScrollToCurrentTime(start, viewModel.End);

            ProgressRingControl.IsActive = false;
        }