private void OnShellProfileDeleted(ShellProfileDeletedMessage message) { _keyboardCommandService.DeregisterCommandHandler(message.ProfileId.ToString()); UpdateDefaultShellProfile(); ApplicationView.ExecuteOnUiThreadAsync(CreateMenuViewModel, CoreDispatcherPriority.Low, true); }
private void OnShellProfileAdded(ShellProfileAddedMessage message) { _keyboardCommandService.RegisterCommandHandler(message.ShellProfile.Id.ToString(), async() => await AddProfileByGuidAsync(message.ShellProfile.Id)); UpdateDefaultShellProfile(); ApplicationView.ExecuteOnUiThreadAsync(CreateMenuViewModel, CoreDispatcherPriority.Low, true); }
private void UpdateDefaultShellProfile() { var defaultProfile = _settingsService.GetDefaultShellProfile(); // We need to rebuild the menu only if default profile Id or Name is changed var changeMenu = _defaultProfile == null || !_defaultProfile.Id.Equals(defaultProfile.Id) || !string.Equals(_defaultProfile.Name, defaultProfile.Name, StringComparison.Ordinal); _defaultProfile = defaultProfile; if (changeMenu) { ApplicationView.ExecuteOnUiThreadAsync(CreateMenuViewModel, CoreDispatcherPriority.Low, true); } }
private void OnShellProfileChanged(ShellProfileChangedMessage message) { UpdateDefaultShellProfile(); ApplicationView.ExecuteOnUiThreadAsync(CreateMenuViewModel, CoreDispatcherPriority.Low, true); }