Exemple #1
0
        private void Browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
        {
            if (e.IsLoading == false)
            {
                loadCompleteEvent.Set();
            }

            NavigationChanged?.Invoke(this, new EventArgs());
        }
Exemple #2
0
 public void NavigateTo(Pages target)
 {
     if (target == Pages.Config)
     {
         _previous = Current;
     }
     Current = target;
     NavigationChanged?.Invoke(this, new NavigationChangedEventArgs(target));
 }
 /// <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}"))}");
 }
 /// <inheritdoc />
 public void NavigateTo(string name, params string[] arguments)
 {
     NavigationChanged?.Invoke(this, new INavigator.ViewData(name, arguments));
     m_manager.NavigateTo($"{name}/{string.Join("/", arguments)}");
 }
 /// <inheritdoc />
 public void NavigateTo(string name)
 {
     NavigationChanged?.Invoke(this, new INavigator.ViewData(name));
     m_manager.NavigateTo(name);
 }
Exemple #6
0
 public void InvokeNavigationChanged(HumanFactorNavigationChangedArgs e)
 {
     NavigationChanged?.Invoke(this, e);
 }
Exemple #7
0
 /// <inheritdoc />
 public void NavigateTo(string name)
 {
     NavigationChanged?.Invoke(null, name);
     m_manager.NavigateTo(name);
 }
Exemple #8
0
        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);
        }