/// <summary> /// This is the entry-piont to the application, which gets called as soon as the application has finished starting up. /// </summary> /// <param name="eventArguments">The event arguments, that contains all necessary information about the application startup like the command line arguments.</param> protected override async Task OnStartedAsync(ApplicationStartedEventArgs eventArguments) { // Initializes the IOC container; in this sample the Simple IOC is used this.iocContainer = new SimpleIocContainer(); // Binds the todo list item repository and some services to the IOC container, so that it can be automatically injected into view models this.iocContainer.RegisterType<IReadOnlyIocContainer>(() => this.iocContainer); this.iocContainer.RegisterType<WindowNavigationService>(Scope.Singleton); this.iocContainer.RegisterType<ReportingService>(Scope.Singleton); // Navigates the user to the main view WindowNavigationService windowNavigationService = this.iocContainer.GetInstance<WindowNavigationService>(); await windowNavigationService.NavigateAsync<MainWindow>(true); }
/// <summary> /// Gets called after the application startup. This can be overridden by the user to implement custom startup logic and displaying views. /// </summary> /// <param name="eventArguments">The arguments that contain more information about the application startup and the navigation service, which can be used to navigate to the intial window and view.</param> protected virtual Task OnStartedAsync(ApplicationStartedEventArgs eventArguments) => Task.FromResult(0);