From 4fb612ca610b03397562ef511d56dc364fb4d41c Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Fri, 7 Oct 2022 15:30:26 +0900 Subject: [PATCH] Change Navigator Pop() code to use Bundle by sending message - If only Navigator.Pop(), the widget just shows a black screen when Back button. - So, changed to use Bundle API and update Content info. Change-Id: I88fed3b4ac321023ae27f44fd359f80474fc44e1 Signed-off-by: Seoyeon Kim --- .../SettingWidgetAccessibility.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Settings/SettingAccessibility/SettingWidgetAccessibility.cs b/Settings/SettingAccessibility/SettingWidgetAccessibility.cs index 9ee614f..020b39f 100755 --- a/Settings/SettingAccessibility/SettingWidgetAccessibility.cs +++ b/Settings/SettingAccessibility/SettingWidgetAccessibility.cs @@ -47,7 +47,8 @@ namespace SettingAccessibility backButton.Clicked += (object source, ClickedEventArgs args) => { - navigator.Pop(); + // Instead of using `navigator.Pop();` code + RequestWidgetPop(); }; appBar.NavigationContent = backButton; @@ -160,6 +161,15 @@ namespace SettingAccessibility settingScroll.Add(label); } + protected void RequestWidgetPop() + { + // Update Widget Content by sending message to pop the fourth page. + Bundle nextBundle = new Bundle(); + nextBundle.AddItem("WIDGET_ACTION", "POP"); + String encodedBundle = nextBundle.Encode(); + SetContentInfo(encodedBundle); + } + protected override void OnPause() { base.OnPause(); -- 2.34.1