/// <summary> /// Handle the keydown event /// </summary>T private void LayoutRoot_KeyDown(object sender, KeyEventArgs e) { var locator = System.Windows.Application.Current.Resources["Locator"] as ViewModelLocator; if (locator != null) { if (e.Key == Key.Space && Keyboard.Modifiers == ModifierKeys.Control) { locator.TraceLogger.Enabled = !locator.TraceLogger.Enabled; e.Handled = true; } if (e.Key == Key.Q && Keyboard.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift)) { var map = locator.MapsViewModel.CurrentMap; var vs = map.ViewScale; var layers = map.Layers; var result = new MapLayerChangeCollection(); foreach (var layer in layers) { result.Add(new MapLayerChange(layer.Name, vs / 10, vs * 10, new[] { map.Envelope.EnlargedBy(2) })); } map.ProcessMapLayerChanges(result); } } }
/// <summary> /// Notify the changes to the outside world /// </summary> private void NotifyMapLayerChanges(MapLayerChangeCollection changes) { if (changes != null) { var changeMessage = new LiteMapLayerChangeMessage(this, changes); Messenger.Send(changeMessage); } }
/// <summary> /// Process the supplied changes /// </summary> /// <param name="changes"></param> internal void ProcessChanges(MapLayerChangeCollection changes) { // Send the changes on the messenger Messenger.Send(new LiteMapLayerChangeMessage(this, changes)); }
/// <summary> /// Constructs the message for the specified changes /// </summary> public LiteMapLayerChangeMessage(object sender, MapLayerChangeCollection mapLayerChanges) : base(sender) { Changes = mapLayerChanges; }