/// <summary>
        /// Loads the kernel.
        /// </summary>
        protected async void LoadKernel()
        {
            try
            {
                _appHost = new ApplicationHost(_appPaths, _logManager);

                _logger = _appHost.LogManager.GetLogger("App");

                await _appHost.Init();

                // Load default theme
                await _appHost.ThemeManager.LoadDefaultTheme();

                HiddenWindow = new HiddenWindow(_logManager.GetLogger("HiddenWindow"));
                HiddenWindow.Show();

                ShowApplicationWindow();

                _appHost.StartEntryPoints();

                await LoadInitialPresentation().ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Error launching application", ex);

                MessageBox.Show("There was an error launching Media Browser: " + ex.Message);

                // Shutdown the app with an error code
                Shutdown(1);
            }
        }
Example #2
0
        async void win_Loaded(object sender, RoutedEventArgs e)
        {
            _appHost.StartEntryPoints();

            await LoadInitialPresentation().ConfigureAwait(false);

            ApplicationWindow.Loaded -= win_Loaded;
        }