namespace Tizen.NUI.Components
{
/// <summary>
+ /// PoppedEventArgs is a class to record popped event arguments which will be sent to user.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class PoppedEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Page popped by Navigator.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Page Page { get; internal set; }
+ }
+
+ /// <summary>
/// The Navigator is a class which navigates pages with stack methods such as Push and Pop.
/// </summary>
/// <remarks>
public event EventHandler<EventArgs> TransitionFinished;
/// <summary>
+ /// An event fired when Pop of a page has been finished.
+ /// Notice that Popped event handler should be removed when it is called not to call it duplicate.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<PoppedEventArgs> Popped;
+
+ /// <summary>
/// Returns the count of pages in Navigator.
/// </summary>
/// <since_tizen> 9 </since_tizen>
if (navigationPages.Count == 1)
{
Remove(topPage);
+
+ //Invoke Popped event
+ Popped?.Invoke(this, new PoppedEventArgs() { Page = topPage });
+
return topPage;
}
var newTopPage = navigationPages[navigationPages.Count - 2];
//Invoke Page events
newTopPage.InvokeAppeared();
topPage.InvokeDisappeared();
+
+ //Invoke Popped event
+ Popped?.Invoke(this, new PoppedEventArgs() { Page = topPage });
};
transitionFinished = false;
if (navigationPages.Count == 1)
{
Remove(curTop);
+
+ //Invoke Popped event
+ Popped?.Invoke(this, new PoppedEventArgs() { Page = curTop });
+
return curTop;
}
//Invoke Page events
curTop.InvokeDisappeared();
+
+ //Invoke Popped event
+ Popped?.Invoke(this, new PoppedEventArgs() { Page = curTop });
};
curAnimation.Play();
private ContentPage firstPage, secondPage;
private Button firstButton, secondButton;
+ private void Popped(object sender, PoppedEventArgs args)
+ {
+ global::System.Console.WriteLine("Page is popped!");
+ args.page.Dispose();
+
+ if (args.page == firstPage)
+ {
+ firstPage = null;
+ }
+ else
+ {
+ secondPage = null;
+ }
+
+ navigator.Popped -= Popped;
+ }
+
public void Activate()
{
Window window = NUIApplication.GetDefaultWindow();
firstPage = new ContentPage()
{
+ AppBar = new AppBar()
+ {
+ AutoNavigationContent = false,
+ Title = "FirstPage",
+ },
Content = firstButton,
};
firstPage.Appearing += (object sender, PageAppearingEventArgs e) =>
secondPage = new ContentPage()
{
+ AppBar = new AppBar()
+ {
+ Title = "SecondPage",
+ },
Content = secondButton,
};
secondPage.Appearing += (object sender, PageAppearingEventArgs e) =>