Exemplo n.º 1
0
 private async void streamsGridView_ItemClick(object sender, ItemClickEventArgs e)
 {
     await HelperMethods.GoToStreamPage(e, Frame);
 }
Exemplo n.º 2
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            if (Frame.BackStack.Count > 0)
            {
                if (Frame.BackStack[Frame.BackStack.Count - 1].SourcePageType == typeof(LoadingPage) ||
                    Frame.BackStack[Frame.BackStack.Count - 1].SourcePageType == typeof(FinalConfirmation))
                {
                    HelperMethods.DisableBackButton();
                }
            }

            progressRing.IsActive = true;

            try
            {
                streams = await AppConstants.Twixel.RetrieveFeaturedStreams(0, 10);
            }
            catch (TwixelException ex)
            {
                await HelperMethods.ShowErrorDialog(ex);
            }
            foreach (FeaturedStream stream in streams)
            {
                stream.CleanTextString();
                stream.text = stream.text.Replace('\n', ' ').Trim();
                Dictionary <AppConstants.StreamQuality, Uri> q = null;
                try
                {
                    q = await HelperMethods.RetrieveHlsStream(stream.stream.channel.name);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }
                if (q != null)
                {
                    qualities.Add(q);
                }
                else
                {
                    qualities.Add(q);
                }
            }

            if (streams.Count > 0)
            {
                SetUpFeaturedStream();
                streamButton.IsEnabled = true;
                playButton.IsEnabled   = true;
                nextButton.IsEnabled   = true;
            }

            Total <List <Game> > topGames = null;

            try
            {
                topGames = await AppConstants.Twixel.RetrieveTopGames(0, 10);
            }
            catch (TwixelException ex)
            {
                await HelperMethods.ShowErrorDialog(ex);
            }
            if (topGames != null)
            {
                foreach (Game game in topGames.wrapped)
                {
                    topGamesCollection.Add(new GameGridViewBinding(game));
                }
            }
            progressRing.IsActive = false;
            base.OnNavigatedTo(e);
        }