public GeolocationManager(ref MapControl MapMain) { // Check is the instance doesnt already exist. if (Instance != null) { //if there is an instance in the app already present then simply throw an error. throw new Exception("Only one settings manager can exist in a App."); } // Setting the instance to the static instance field. Instance = this; this.MapMain = MapMain; GeolocationPin = new MapGeolocationPin(); MapMain.Children.Add(GeolocationPin); MapControl.SetNormalizedAnchorPoint(GeolocationPin, new Point(0.5, 1)); MapControl.SetLocation(GeolocationPin, MapMain.Center); AccuracyCircle = new MapPolygon() { FillColor = Windows.UI.Color.FromArgb(60, 97, 211, 32), StrokeColor = Windows.UI.Color.FromArgb(100, 255, 255, 255) }; MapMain.MapElements.Add(AccuracyCircle); // Location tracking location and Compass StartTracking(); }
public GeolocationManager(ref MapControl MapMain) { // Check is the instance doesnt already exist. if (Instance != null) { //if there is an instance in the app already present then simply throw an error. throw new Exception("Only one settings manager can exist in a App."); } // Setting the instance to the static instance field. Instance = this; this.MapMain = MapMain; GeolocationPin = new MapGeolocationPin(); MapMain.Children.Add(GeolocationPin); MapControl.SetNormalizedAnchorPoint(GeolocationPin, new Point(0.5, 1)); MapControl.SetLocation(GeolocationPin, MapMain.Center); AccuracyCircle = new MapPolygon() { FillColor = Windows.UI.Color.FromArgb(60, 97, 211, 32), StrokeColor = Windows.UI.Color.FromArgb(100, 255, 255, 255) }; MapMain.MapElements.Add(AccuracyCircle); // Location tracking location and Compass StartTracking(); }