ArcGISPortalViewer.App.OnLaunched C# (CSharp) Method

OnLaunched() protected method

Invoked when the application is launched normally by the end user. Other entry points will be used when the application is launched to open a specific file, to display search results, and so forth.
protected OnLaunched ( LaunchActivatedEventArgs args ) : void
args Windows.ApplicationModel.Activation.LaunchActivatedEventArgs Details about the launch request and process.
return void
        protected override async void OnLaunched(LaunchActivatedEventArgs args)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            // Initializes application's properties and navigates to the appropriate page after checking internet connection.
            await AppViewModel.CurrentAppViewModel.AppInit(rootFrame, args);

            // Subscribes to event that occurs when settings pane is displayed so app-specific Settings may be added.
            SettingsPane.GetForCurrentView().CommandsRequested += App_CommandsRequested;

            // Ensure the current window is active
            Window.Current.Activate();

            DispatcherHelper.Initialize();

            // handle lauching the app by secondary tiles:
            // in this case the args passed should start with "arcgis".
            if (args.Arguments.StartsWith("arcgis:"))
            {
                LaunchMapByID(new Uri(args.Arguments, UriKind.RelativeOrAbsolute));
            }
        }