public async void SetDialogFrame(object content) { bool animate = Properties.LauncherSettings.Default.AnimatePageTransitions; await Application.Current.Dispatcher.InvokeAsync(() => { bool isEmpty = content == null; var focusMode = (isEmpty ? MainFrame_KeyboardNavigationMode_Default : KeyboardNavigationMode.None); KeyboardNavigation.SetTabNavigation(MainThread.MainFrame, focusMode); KeyboardNavigation.SetTabNavigation(MainThread.OverlayFrame, focusMode); Keyboard.ClearFocus(); if (animate) { if (isEmpty) { PageAnimator.FrameFadeOut(MainThread.ErrorFrame, content); } else { PageAnimator.FrameFadeIn(MainThread.ErrorFrame, content); } } else { MainThread.ErrorFrame.Navigate(content); } }); }
public void SetDialogFrame(object content, bool useFade = true) { bool isEmpty = content == null; var focusMode = (isEmpty ? MainFrame_KeyboardNavigationMode_Default : KeyboardNavigationMode.None); KeyboardNavigation.SetTabNavigation(MainThread.MainFrame, focusMode); KeyboardNavigation.SetTabNavigation(MainThread.OverlayFrame, focusMode); Keyboard.ClearFocus(); if (useFade) { if (isEmpty) { PageAnimator.FrameFadeOut(MainThread.ErrorFrame, content); } else { PageAnimator.FrameFadeIn(MainThread.ErrorFrame, content); } } else { MainThread.ErrorFrame.Navigate(content); } }