Example #1
0
        private void OnShellProfileDeleted(ShellProfileDeletedMessage message)
        {
            _keyboardCommandService.DeregisterCommandHandler(message.ProfileId.ToString());

            UpdateDefaultShellProfile();

            ApplicationView.ExecuteOnUiThreadAsync(CreateMenuViewModel, CoreDispatcherPriority.Low, true);
        }
Example #2
0
        private void OnShellProfileAdded(ShellProfileAddedMessage message)
        {
            _keyboardCommandService.RegisterCommandHandler(message.ShellProfile.Id.ToString(),
                                                           async() => await AddProfileByGuidAsync(message.ShellProfile.Id));

            UpdateDefaultShellProfile();

            ApplicationView.ExecuteOnUiThreadAsync(CreateMenuViewModel, CoreDispatcherPriority.Low, true);
        }
Example #3
0
        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);
            }
        }
Example #4
0
        private void OnShellProfileChanged(ShellProfileChangedMessage message)
        {
            UpdateDefaultShellProfile();

            ApplicationView.ExecuteOnUiThreadAsync(CreateMenuViewModel, CoreDispatcherPriority.Low, true);
        }