From: Md. Farhan Mahtab/NC eXperience Group /SRBD/Engineer/Samsung Electronics Date: Fri, 20 Dec 2024 11:04:52 +0000 (+0600) Subject: Fixed Album window not closing issue X-Git-Tag: accepted/tizen/unified/20241231.014854^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_unified_dev;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsettings.git Fixed Album window not closing issue [Problem][TTEN-496] Clicking back button doesn't close album window [Cause & Measure] Cause : In NavigateBack function, last page is removed from the navigator which doesn't properly dispose the page Measure : To properly remove the page, the page also need to be removed from gadgetPages and the gadget also need to be removed from NUIGadgetManager Change-Id: I6b97cd4a4754d33b1ac194f6e839bcf53569e37e Signed-off-by: Md. Farhan Mahtab/NC eXperience Group /SRBD/Engineer/Samsung Electronics --- diff --git a/SettingCore/GadgetNavigation.cs b/SettingCore/GadgetNavigation.cs index f07c9a8..4444baf 100644 --- a/SettingCore/GadgetNavigation.cs +++ b/SettingCore/GadgetNavigation.cs @@ -42,15 +42,23 @@ namespace SettingCore } }; - NUIApplication.GetDefaultWindow().GetDefaultNavigator().Popped += (s, e) => + NUIApplication.GetDefaultWindow().GetDefaultNavigator().Popped += GadgetPoppedEventHandler; + } + + + private static void GadgetPoppedEventHandler(object o, PoppedEventArgs e) + { + RemoveGadget(e.Page); + } + + private static void RemoveGadget(Page page) + { + if (gadgetPages.TryGetValue(page, out MenuGadget gadget)) { - if (gadgetPages.TryGetValue(e.Page, out MenuGadget gadget)) - { - NUIGadgetManager.Remove(gadget); - gadgetPages.Remove(e.Page); - } - NUIApplication.GetDefaultWindow().GetDefaultNavigator().EnableBackNavigation = true; - }; + NUIGadgetManager.Remove(gadget); + gadgetPages.Remove(page); + } + NUIApplication.GetDefaultWindow().GetDefaultNavigator().EnableBackNavigation = true; } public static void SetFullScreenMode(bool fullScreen) @@ -198,6 +206,8 @@ namespace SettingCore Page currentPage = (Page)NUIApplication.GetDefaultWindow().GetDefaultNavigator().GetChildAt(0); NUIApplication.GetDefaultWindow().GetDefaultNavigator().Remove(currentPage); NUIApplication.GetDefaultWindow().GetDefaultNavigator().Add(previousView); + + RemoveGadget(currentPage); } private static Control GetMoreButton(IEnumerable moreMenu) diff --git a/packaging/org.tizen.cssettings-1.2.4.tpk b/packaging/org.tizen.cssettings-1.2.4.tpk index 3599eed..d25d444 100644 Binary files a/packaging/org.tizen.cssettings-1.2.4.tpk and b/packaging/org.tizen.cssettings-1.2.4.tpk differ