protected override void OnLaunched()

in ContosoApp/App.xaml.cs [65:96]


        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            // Load the database.
            if (ApplicationData.Current.LocalSettings.Values.TryGetValue(
                "data_source", out object dataSource))
            {
                switch (dataSource.ToString())
                {
                    case "Rest": UseRest(); break;
                    default: UseSqlite(); break; 
                }
            }
            else
            {
                UseSqlite();
            }

            // Prepare the app shell and window content.
            AppShell shell = Window.Current.Content as AppShell ?? new AppShell();
            shell.Language = ApplicationLanguages.Languages[0];
            Window.Current.Content = shell;

            if (shell.AppFrame.Content == null)
            {
                // When the navigation stack isn't restored, navigate to the first page
                // suppressing the initial entrance animation.
                shell.AppFrame.Navigate(typeof(CustomerListPage), null,
                    new SuppressNavigationTransitionInfo());
            }

            Window.Current.Activate();
        }