void MainWindow_ContentRendered(object sender, EventArgs e) { var componentModel = (IComponentModel)(GetService(typeof(SComponentModel))); IClippyVSSettings s = componentModel.DefaultExportProvider.GetExportedValue <IClippyVSSettings>(); SpriteContainer container = new SpriteContainer(this); if (s.ShowAtStartup) { container.Show(); } }
async void MainWindow_ContentRendered(object sender, EventArgs e) { var token = new CancellationToken(); await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(token); var shellSettingsManager = new ShellSettingsManager(ServiceProvider.GlobalProvider); var writableSettingsStore = shellSettingsManager.GetWritableSettingsStore(SettingsScope.UserSettings); IClippyVSSettings settings = new ClippyVSSettings(writableSettingsStore); SpriteContainer container = new SpriteContainer(this); if (settings.ShowAtStartup) { container.Show(); } }