コード例 #1
0
ファイル: OffscreenWebView.cs プロジェクト: xeddmc/Playnite
        private void Browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
        {
            if (e.IsLoading == false)
            {
                loadCompleteEvent.Set();
            }

            NavigationChanged?.Invoke(this, new EventArgs());
        }
コード例 #2
0
 public void NavigateTo(Pages target)
 {
     if (target == Pages.Config)
     {
         _previous = Current;
     }
     Current = target;
     NavigationChanged?.Invoke(this, new NavigationChangedEventArgs(target));
 }
コード例 #3
0
 /// <inheritdoc />
 public void NavigateTo(string name, IReadOnlyDictionary <string, string> arguments)
 {
     NavigationChanged?.Invoke(this, new INavigator.ViewData(name, arguments));
     m_manager.NavigateTo($"{name}?{string.Join("&", arguments.Select(arg => $"{arg.Key}={arg.Value}"))}");
 }
コード例 #4
0
 /// <inheritdoc />
 public void NavigateTo(string name, params string[] arguments)
 {
     NavigationChanged?.Invoke(this, new INavigator.ViewData(name, arguments));
     m_manager.NavigateTo($"{name}/{string.Join("/", arguments)}");
 }
コード例 #5
0
 /// <inheritdoc />
 public void NavigateTo(string name)
 {
     NavigationChanged?.Invoke(this, new INavigator.ViewData(name));
     m_manager.NavigateTo(name);
 }
コード例 #6
0
 public void InvokeNavigationChanged(HumanFactorNavigationChangedArgs e)
 {
     NavigationChanged?.Invoke(this, e);
 }
コード例 #7
0
 /// <inheritdoc />
 public void NavigateTo(string name)
 {
     NavigationChanged?.Invoke(null, name);
     m_manager.NavigateTo(name);
 }
コード例 #8
0
ファイル: NavigationService.cs プロジェクト: GFlisch/Arc4u
        private async void _frame_Navigated(object sender, global::Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            if (NavigationMode.New == e.NavigationMode)
            {
                try
                {
                    if (null != CurrentPage)
                    {
                        if (CurrentPage.DataContext is INavigationAware navigationAware)
                        {
                            await navigationAware.OnNavigatedFromAsync();
                        }
                    }
                }
                catch (Exception ex)
                {
                    Logger.Technical.From <NavigationService>().Exception(ex).Log();
                }

                try
                {
                    if (e.Content is Page page && page.DataContext is INavigationAware navigationAware)
                    {
                        CurrentPage = page;
                        await navigationAware.OnNavigatedToAsync(e.Parameter as Dictionary <string, object>);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Technical.From <NavigationService>().Exception(ex).Log();
                }
            }

            if (NavigationMode.Back == e.NavigationMode && null != CurrentPage) // shoul be always true!
            {
                try
                {
                    if (CurrentPage.DataContext is INavigationAware navigationAware)
                    {
                        await navigationAware.OnNavigatedFromAsync();
                    }
                }
                catch (Exception ex)
                {
                    Logger.Technical.From <NavigationService>().Exception(ex).Log();
                }

                try
                {
                    if (e.Content is Page page && page.DataContext is INavigationAware navigationAware)
                    {
                        CurrentPage = page;
                        await navigationAware.OnNavigatedToAsync(new Dictionary <string, object>() { { "Back", true } });
                    }
                }
                catch (Exception ex)
                {
                    Logger.Technical.From <NavigationService>().Exception(ex).Log();
                }
            }


            NavigationChanged?.Invoke(sender, e);
        }