Exemplo n.º 1
0
        public async override void Initialize(object sender, PageInitializeEventArgs 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 ChangesSectionContext;

            if (sectionContext != null)
            {
                // Restore the context instead of refreshing
                ChangesSectionContext context = sectionContext;
                this.Changesets = context.Changesets;
                this.WorkItems  = context.WorkItems;
                this.Shelvesets = context.Shelvesets;
            }
            else
            {
                // Kick off the refresh
                await this.RefreshAsyncChangesets();

                await this.RefreshAsyncShelveSets();

                await this.RefreshAsyncWorkitems();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Save contextual information about the current section state.
        /// </summary>
        public override void SaveContext(object sender, PageSaveContextEventArgs e)
        {
            base.SaveContext(sender, e);

            // Save our current so when the user navigates back to the page the content is restored rather than requeried
            ChangesSectionContext context = new ChangesSectionContext {
                Shelvesets = this.Shelvesets
            };

            e.Context = context;
        }