Exemplo n.º 1
0
        private async void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (PageNavigator is null)
            {
                return;
            }
            if (App.Current.Properties.Contains(App.ArgumentsKey))
            {
                await PageNavigator.GoToAsync <PgViewer>().ConfigureAwait(false);

                if (PageNavigator.CurrentPage is PgViewer pgViewer &&
                    App.Current.Properties[App.ArgumentsKey] is string[] args)
                {
                    pgViewer.View(args[0]);
                }
            }
            else
            {
                try
                {
                    await PageNavigator.GoToAsync <PgLibrary>().ConfigureAwait(false);
                }
                catch (TaskCanceledException)
                {
                    //
                }
            }
        }