transitionSet.Finished += (object sender, EventArgs e) =>
{
topPage.SetVisible(false);
+
+ //Invoke Page events
+ page.InvokeAppeared();
+ topPage.InvokeDisappeared();
};
transitionFinished = false;
}
{
Remove(topPage);
topPage.SetVisible(true);
+
+ //Invoke Page events
+ newTopPage.InvokeAppeared();
+ topPage.InvokeDisappeared();
};
transitionFinished = false;
curAnimation.Finished += (object sender, EventArgs args) =>
{
curTop.SetVisible(false);
+
+ //Invoke Page events
+ curTop.InvokeDisappeared();
};
curAnimation.Play();
newAnimation = new Animation(1000);
newAnimation.AnimateTo(page, "Opacity", 1.0f, 0, 1000);
newAnimation.EndAction = Animation.EndActions.StopFinal;
+ newAnimation.Finished += (object sender, EventArgs e) =>
+ {
+ //Invoke Page events
+ page.InvokeAppeared();
+ };
newAnimation.Play();
}
}
//Removes the current top page after transition is finished.
Remove(curTop);
curTop.Opacity = 1.0f;
+
+ //Invoke Page events
+ curTop.InvokeDisappeared();
};
curAnimation.Play();
newAnimation = new Animation(1000);
newAnimation.AnimateTo(newTop, "Opacity", 1.0f, 0, 1000);
newAnimation.EndAction = Animation.EndActions.StopFinal;
+ newAnimation.Finished += (object sender, EventArgs e) =>
+ {
+ //Invoke Page events
+ newTop.InvokeAppeared();
+ };
newAnimation.Play();
}
else
}
/// <summary>
+ /// PageAppearedEventArgs is a class to record page appeared event arguments which will be sent to user.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class PageAppearedEventArgs : EventArgs
+ {
+ }
+
+ /// <summary>
+ /// PageDisappearedEventArgs is a class to record page disappeared event arguments which will be sent to user.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class PageDisappearedEventArgs : EventArgs
+ {
+ }
+
+ /// <summary>
/// The Page class is a class which is an element of navigation.
/// </summary>
/// <since_tizen> 9 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler<PageDisappearingEventArgs> Disappearing;
+ /// <summary>
+ /// An event for the page appeared signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<PageAppearedEventArgs> Appeared;
+
+ /// <summary>
+ /// An event for the page disappeared signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<PageDisappearedEventArgs> Disappeared;
+
internal void InvokeAppearing()
{
Appearing?.Invoke(this, new PageAppearingEventArgs());
{
Disappearing?.Invoke(this, new PageDisappearingEventArgs());
}
+
+ internal void InvokeAppeared()
+ {
+ Appeared?.Invoke(this, new PageAppearedEventArgs());
+ }
+
+ internal void InvokeDisappeared()
+ {
+ Disappeared?.Invoke(this, new PageDisappearedEventArgs());
+ }
}
}