topPage.SetVisible(false);
}
+ // Need to update Content of the new page
+ ShowContentOfPage(page);
+
//Invoke Page events
page.InvokeAppeared();
topPage.InvokeDisappeared();
Remove(topPage);
topPage.SetVisible(true);
+ // Need to update Content of the new page
+ ShowContentOfPage(newTopPage);
+
//Invoke Page events
newTopPage.InvokeAppeared();
topPage.InvokeDisappeared();
newAnimation.EndAction = Animation.EndActions.StopFinal;
newAnimation.Finished += (object sender, EventArgs e) =>
{
+ // Need to update Content of the new page
+ ShowContentOfPage(page);
+
//Invoke Page events
page.InvokeAppeared();
NotifyAccessibilityStatesChangeOfPages(curTop, page);
};
newAnimation.Play();
}
+ else
+ {
+ ShowContentOfPage(page);
+ }
}
/// <summary>
newAnimation.EndAction = Animation.EndActions.StopFinal;
newAnimation.Finished += (object sender, EventArgs e) =>
{
+ // Need to update Content of the new page
+ ShowContentOfPage(newTop);
+
//Invoke Page events
newTop.InvokeAppeared();
NotifyAccessibilityStatesChangeOfPages(curTop, newTop);
//TODO: The following transition codes will be replaced with view transition.
InitializeAnimation();
+ ShowContentOfPage(page);
+
if (index == PageCount)
{
page.Opacity = 1.0f;
//TODO: The following transition codes will be replaced with view transition.
InitializeAnimation();
+ HideContentOfPage(page);
+
if ((page == Peek()) && (PageCount >= 2))
{
navigationPages[PageCount - 2].Opacity = 1.0f;
newAnimation = null;
}
}
+
+ // Show and Register Content of Page to Accessibility bridge
+ private void ShowContentOfPage(Page page)
+ {
+ View content = (page is DialogPage) ? (page as DialogPage)?.Content : (page as ContentPage)?.Content;
+ if (content != null)
+ {
+ content.Show(); // Calls RegisterDefaultLabel()
+ }
+ }
+
+ // Hide and Remove Content of Page from Accessibility bridge
+ private void HideContentOfPage(Page page)
+ {
+ View content = (page is DialogPage) ? (page as DialogPage)?.Content : (page as ContentPage)?.Content;
+ if (content != null)
+ {
+ content.Hide(); // Calls UnregisterDefaultLabel()
+ }
+ }
}
}