Пример #1
0
        /// <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;
        }
Пример #2
0
        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();
            }
        }
Пример #3
0
        /// <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;
        }