/// <summary> /// Save contextual information about the current section state. /// </summary> public override void SaveContext(object sender, SectionSaveContextEventArgs e) { base.SaveContext(sender, e); // Save our current so when the user navigates back to the page the content is restored rather than requeried TimeRecordsContext context = new TimeRecordsContext { TimeRecords = this.TimeRecords }; e.Context = context; }
public async override void Initialize(object sender, SectionInitializeEventArgs e) { base.Initialize(sender, e); // If the user navigated back to this page, there could be saved context information that is passed in var sectionContext = e.Context as TimeRecordsContext; if (sectionContext != null) { // Restore the context instead of refreshing TimeRecordsContext context = sectionContext; this.TimeRecords = context.TimeRecords; } else { // Kick off the refresh await this.RefreshAsync(); } }
/// <summary> /// Save contextual information about the current section state. /// </summary> public override void SaveContext(object sender, SectionSaveContextEventArgs e) { base.SaveContext(sender, e); // Save our current so when the user navigates back to the page the content is restored rather than requeried TimeRecordsContext context = new TimeRecordsContext { TimeRecords = this.TimeRecords }; e.Context = context; }