private void SetGroupedShips() { if (_shipsTypes == null) { return; } var order = Properties.Settings.Default.DScanShipAggregatorGroupBy; if (order == "Role") { _shipsTypes = _shipsTypes.OrderBy(x => x, ROLE_COMPARER) .ToList(); var vs = new ListCollectionView(_shipsTypes); // ReSharper disable PossibleNullReferenceException vs.GroupDescriptions.Add( // ReSharper restore PossibleNullReferenceException new PropertyGroupDescription( NotifyUtils.GetPropertyName((AggregatedShipTypeViewModel a) => a.FleetRole))); DataShips.ItemsSource = vs; } else { _shipsTypes = _shipsTypes.OrderBy(x => x, GROUP_COMPARER) .ToList(); var vs = new ListCollectionView(_shipsTypes); // ReSharper disable PossibleNullReferenceException vs.GroupDescriptions.Add( // ReSharper restore PossibleNullReferenceException new PropertyGroupDescription( NotifyUtils.GetPropertyName((AggregatedShipTypeViewModel a) => a.ShipGroup))); DataShips.ItemsSource = vs; } }
private void SettingsPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.CoalitionsJson)) { InitCoalitions(); } }
private void SettingsOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs) { //TODO extract in extra class/binder between settings/shortcutregistry/editorwidget if (propertyChangedEventArgs.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.ShortcutToggleMinimizeAll) || propertyChangedEventArgs.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.ShortcutQuickAction)) { Settings.RegisterGlobalShortcut(); } }
private void SettingsOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs) { if (propertyChangedEventArgs.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.AreVoiceCommandsEnabled) || propertyChangedEventArgs.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.VoiceCommandToggleMinimze) || propertyChangedEventArgs.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.VoiceCommandQuickAction)) { Setup(); } }
private void DefaultOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs) { if (propertyChangedEventArgs.PropertyName != NotifyUtils.GetPropertyName((Settings s) => s.PositionTrackingCharacters)) { return; } var lastActiveCharacter = _activeCharacterTracker.LastActiveCharacter; if (lastActiveCharacter == null || _curActiveCharacter == lastActiveCharacter) { return; } ActiveCharacterTrackerOnActiveCharacterChanged(lastActiveCharacter); }
private void UpdateColors() { OnPropertyChanged(NotifyUtils.GetPropertyName((SolarSystemViewModel x) => x.ForegroundColor)); OnPropertyChanged(NotifyUtils.GetPropertyName((SolarSystemViewModel x) => x.BackgroundColor)); }