private void FirstRun() { if (Settings.Instance.IsFirstRun || _forceTour) { _cairoApplication.Dispatch(() => { ShowWelcome(); }); } }
private void SetSearchProvider() { var thread = new Thread(() => { // this sometimes takes a while Type provider = typeof(SearchHelper); _cairoApplication.Dispatch(() => { CairoSearchMenu.DataContext = new ObjectDataProvider { ObjectType = provider }; Binding bSearchText = new Binding("SearchText") { Mode = BindingMode.Default, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged }; Binding bSearchResults = new Binding("Results") { Mode = BindingMode.Default, IsAsync = true }; searchStr.SetBinding(TextBox.TextProperty, bSearchText); lstSearchResults.SetBinding(ListView.ItemsSourceProperty, bSearchResults); }); }) { IsBackground = true }; thread.SetApartmentState(ApartmentState.STA); thread.Start(); try { if (_isPrimaryScreen && !isSearchHotkeyRegistered) { new HotKey(Key.S, HotKeyModifier.Win | HotKeyModifier.NoRepeat, OnShowSearchHotkey); isSearchHotkeyRegistered = true; } } catch (Exception ex) { ShellLogger.Warning($"Search: Unable to bind hotkey: {ex.Message}"); } }
private void RegisterSystemHotkeys() { if (EnvironmentHelper.IsAppRunningAsShell) { _cairoApplication.Dispatch(() => { new HotKey(Key.R, HotKeyModifier.Win | HotKeyModifier.NoRepeat, OnWinRCommand); new HotKey(Key.D, HotKeyModifier.Win | HotKeyModifier.NoRepeat, OnWinDCommand); new HotKey(Key.OemComma, HotKeyModifier.Win | HotKeyModifier.NoRepeat, OnWinDCommand); new HotKey(Key.E, HotKeyModifier.Win | HotKeyModifier.NoRepeat, OnWinECommand); new HotKey(Key.I, HotKeyModifier.Win | HotKeyModifier.NoRepeat, OnWinICommand); new HotKey(Key.Pause, HotKeyModifier.Win | HotKeyModifier.NoRepeat, OnWinPauseCommand); }); } }