예제 #1
0
        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            var viewModel = (MainViewModel)this.DataContext;
            if (this.DataContext != null && !viewModel.Podcasts.Any())
            {
                await viewModel.LoadPodcastsAsync();
                await viewModel.SavePodcastsAsync();
            }

            //var episode = await PodcastR.Data.Services.PodcastDownloaderService.DownloadPodcastEpisodeAsync(podcastsFromLocal[0].Episodes[2], p =>
            //{
            //    if (p.Progress.TotalBytesToReceive > 0)
            //    {
            //        defaultViewModel["Progress"] = p.Progress.BytesReceived * 100 / p.Progress.TotalBytesToReceive;
            //    }
            //    if (int.Parse(defaultViewModel["Progress"].ToString()) == 100)
            //    {
            //        defaultViewModel["Progress"] = "Downlod succesfull.";
            //    }
            //}, cts, errorCallback: () =>
            //{
            //    defaultViewModel["Progress"] = "Download cancelled or something went wrong.";
            //});
        }
예제 #2
0
 void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
 }
예제 #3
0
 /// <summary>
 /// Populates the page with content passed during navigation.  Any saved state is also
 /// provided when recreating a page from a prior session.
 /// </summary>
 /// <param name="sender">
 /// The source of the event; typically <see cref="NavigationHelper"/>
 /// </param>
 /// <param name="e">Event data that provides both the navigation parameter passed to
 /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
 /// a dictionary of state preserved by this page during an earlier
 /// session.  The state will be null the first time a page is visited.</param>
 private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     this.DefaultViewModel["Podcast"] = (PodcastViewModel)e.NavigationParameter;
     this.DefaultViewModel["Episodes"] = ((PodcastViewModel)e.NavigationParameter).Episodes;
 }
예제 #4
0
 /// <summary>
 /// Populates the page with content passed during navigation.  Any saved state is also
 /// provided when recreating a page from a prior session.
 /// </summary>
 /// <param name="sender">
 /// The source of the event; typically <see cref="NavigationHelper"/>
 /// </param>
 /// <param name="e">Event data that provides both the navigation parameter passed to
 /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
 /// a dictionary of state preserved by this page during an earlier
 /// session.  The state will be null the first time a page is visited.</param>
 private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     // TODO: Assign a collection of bindable groups to this.DefaultViewModel["Groups"]
     this.DefaultViewModel["Groups"] = (IList<PodcastViewModel>)e.NavigationParameter;
 }
예제 #5
0
 /// <summary>
 /// Populates the page with content passed during navigation.  Any saved state is also
 /// provided when recreating a page from a prior session.
 /// </summary>
 /// <param name="sender">
 /// The source of the event; typically <see cref="NavigationHelper"/>
 /// </param>
 /// <param name="e">Event data that provides both the navigation parameter passed to
 /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
 /// a dictionary of state preserved by this page during an earlier
 /// session.  The state will be null the first time a page is visited.</param>
 private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     var episode = (EpisodeViewModel)e.NavigationParameter;
     this.DefaultViewModel["Episode"] = episode;
 }
예제 #6
0
 /// <summary>
 /// Populates the page with content passed during navigation.  Any saved state is also
 /// provided when recreating a page from a prior session.
 /// </summary>
 /// <param name="sender">
 /// The source of the event; typically <see cref="NavigationHelper"/>
 /// </param>
 /// <param name="e">Event data that provides both the navigation parameter passed to
 /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
 /// a dictionary of state preserved by this page during an earlier
 /// session.  The state will be null the first time a page is visited.</param>
 private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     // TODO: Assign a bindable collection of items to this.DefaultViewModel["Items"]
     this.DefaultViewModel["Items"] = (IList<EpisodeViewModel>)e.NavigationParameter;
 }