private void InstanceOnInvalidateMap() { if (MapCanvas == null) { return; } MapCanvas.Invalidate(); }
private void OnPointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e) { var currentPoint = e.GetCurrentPoint(MapCanvas); HighlightedTile = ScreenToMap( new Vector2((float)currentPoint.Position.X, (float)currentPoint.Position.Y)); MapCanvas.Invalidate(); e.Handled = true; }
private void OnKeyDown(object sender, KeyEventArgs e) { if (e.VirtualKey == Windows.System.VirtualKey.Up) { ScrollMap(new Vector2(0.0f, -1.0f)); } else if (e.VirtualKey == Windows.System.VirtualKey.Down) { ScrollMap(new Vector2(0.0f, +1.0f)); } else if (e.VirtualKey == Windows.System.VirtualKey.Left) { ScrollMap(new Vector2(-1.0f, 0.0f)); } else if (e.VirtualKey == Windows.System.VirtualKey.Right) { ScrollMap(new Vector2(+1.0f, 0.0f)); } MapCanvas.Invalidate(); e.Handled = true; }