Example #1
0
        protected async override void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            this.viewModel = new PostListViewModel();
            this.DataContext = this.viewModel;
            await this.PostList.Initialize(this.viewModel, new BestSort() { Votes = -1, ID = -1, Submitted = -1 }, (post1, post2) =>
            {
                var votesComparison = post2.Votes.CompareTo(post1.Votes);

                if (votesComparison != 0)
                {
                    return votesComparison;
                }

                var timeComparison = post2.Submitted.DateTime.CompareTo(post1.Submitted.DateTime);

                if (timeComparison != 0)
                {
                    return timeComparison;
                }

                return post2.Id.CompareTo(post1.Id);
            });
        }
 private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
 }
 private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
 }
Example #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>
 protected abstract void navigationHelper_LoadState(object sender, LoadStateEventArgs e);
 protected virtual void OnNavigationHelperLoadState(object sender, LoadStateEventArgs e)
 {
 }