Created
October 11, 2017 20:27
-
-
Save elbruno/428aa4877d9e590ded7080f6a8ebb620 to your computer and use it in GitHub Desktop.
SurfaceDialMapControlZoom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
readonly RadialController _controller; | |
public MapPagePage() | |
{ | |
locationService = new LocationService(); | |
Center = new Geopoint(defaultPosition); | |
ZoomLevel = DefaultZoomLevel; | |
InitializeComponent(); | |
_controller = RadialController.CreateForCurrentView(); | |
_controller.RotationResolutionInDegrees = 0.2; | |
_controller.UseAutomaticHapticFeedback = false; | |
var myItem = RadialControllerMenuItem.CreateFromFontGlyph("El Bruno - Maps", "\xE128", "Segoe MDL2 Assets" ); | |
_controller.Menu.Items.Add(myItem); | |
_controller.ButtonClicked += ControllerButtonClicked; | |
_controller.RotationChanged += ControllerRotationChanged; | |
} | |
private void ControllerRotationChanged(RadialController sender, RadialControllerRotationChangedEventArgs args) | |
{ | |
Debug.WriteLine($"{mapControl.ZoomLevel} - {args.RotationDeltaInDegrees}"); | |
mapControl.ZoomLevel = mapControl.ZoomLevel + args.RotationDeltaInDegrees; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment