Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <maps:Map x:Name="Map">
- ...
- </maps:Map>
- var position = new Position(37.79762, -122.40181);
- Map.MoveToRegion(new MapSpan(position, 0.01, 0.01));
- Map.Pins.Add(new Pin
- {
- Label = "Xamarin",
- Position = position
- });
- ((ViewModels.YourViewModel)BindingContext).PropertyChanged += yourPropertyChanged;
- private void yourPropertyChanged(object sender, PropertyChangedEventArgs e)
- {
- if(e.PropertyName == "YourPropertyName")
- {
- var position = new Position(37.79762, -122.40181);
- Map.MoveToRegion(new MapSpan(position, 0.01, 0.01));
- Map.Pins.Add(new Pin
- {
- Label = "Xamarin",
- Position = position
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement