{
if (page is DialogPage == false)
{
- topPage.SetVisible(false);
+ topPage.SetVisible(false);
}
//Invoke Page events
page.InvokeAppeared();
topPage.InvokeDisappeared();
+ NotifyAccessibilityStatesChangeOfPages(topPage, page);
};
transitionFinished = false;
}
//Invoke Page events
newTopPage.InvokeAppeared();
topPage.InvokeDisappeared();
+ NotifyAccessibilityStatesChangeOfPages(topPage, newTopPage);
//Invoke Popped event
Popped?.Invoke(this, new PoppedEventArgs() { Page = topPage });
{
//Invoke Page events
page.InvokeAppeared();
+ NotifyAccessibilityStatesChangeOfPages(curTop, page);
};
newAnimation.Play();
}
{
//Invoke Page events
newTop.InvokeAppeared();
+ NotifyAccessibilityStatesChangeOfPages(curTop, newTop);
};
newAnimation.Play();
}
}
}
+ /// <summary>
+ /// Notify accessibility states change of pages.
+ /// </summary>
+ /// <param name="disappearedPage">Disappeared page</param>
+ /// <param name="appearedPage">Appeared page</param>
+ private void NotifyAccessibilityStatesChangeOfPages(Page disappearedPage, Page appearedPage)
+ {
+ if (disappearedPage != null)
+ {
+ //We can call disappearedPage.NotifyAccessibilityStatesChange
+ //To reduce accessibility events, we are using currently highlighted view instead
+ View curHighlightedView = Accessibility.Accessibility.Instance.GetCurrentlyHighlightedView();
+ if (curHighlightedView != null)
+ {
+ curHighlightedView.NotifyAccessibilityStatesChange(AccessibilityStates.Visible | AccessibilityStates.Showing, false);
+ }
+ }
+
+ if (appearedPage != null)
+ {
+ appearedPage.NotifyAccessibilityStatesChange(AccessibilityStates.Visible | AccessibilityStates.Showing, false);
+ }
+ }
+
internal void InvokeTransitionFinished()
{
TransitionFinished?.Invoke(this, new EventArgs());