public void UpdateBackButton(bool canGoBack, bool canGoForward = false)
        {
            switch (Settings.ShellBackButtonPreference)
            {
            case ShellBackButtonPreferences.AlwaysShowInShell when(!Settings.ShellBackButtonVisible):
                Settings.ShellBackButtonVisible = true;

                BackButtonUpdated?.Invoke(null, EventArgs.Empty);
                break;

            case ShellBackButtonPreferences.AutoShowInShell when(!Settings.ShellBackButtonVisible):
                Settings.ShellBackButtonVisible = canGoBack;

                BackButtonUpdated?.Invoke(null, EventArgs.Empty);
                break;

            case ShellBackButtonPreferences.NeverShowInShell when(Settings.ShellBackButtonVisible):
                Settings.ShellBackButtonVisible = false;

                BackButtonUpdated?.Invoke(null, EventArgs.Empty);
                break;

            default:
                Settings.ShellBackButtonVisible = false;
                BackButtonUpdated?.Invoke(null, EventArgs.Empty);
                break;
            }
        }
 public void UpdateBackButton(bool canGoBack, bool canGoForward = false)
 {
     // show the shell back only if there is anywhere to go in the default frame
     SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
         (Settings.ShellBackButtonVisible && (canGoBack || Settings.ForceShowShellBackButton))
             ? AppViewBackButtonVisibility.Visible
             : AppViewBackButtonVisibility.Collapsed;
     BackButtonUpdated?.Invoke(null, EventArgs.Empty);
 }
Beispiel #3
0
        public GestureService(IMessengerService messengerService)
        {
            _keyService2 = new KeyboardService() as IKeyboardService2;
            InitKeyServiceEvents();

            _backService2 = new BackButtonService(_keyService2 as IKeyboardService) as IBackButtonService2;
            _backService2.BackButtonUpdated += (s, e) => BackButtonUpdated?.Invoke(s, e);
            InitBackServiceEvents();

            _messenger = messengerService;
        }