private void ApplicationBarInfo_ButtonClick(object sender, ApplicationBarButtonClickEventArgs e) { if (e.Button == LocationPicker.ApplicationBarInfo.Buttons[0]) { if (geoCoordinateWatcher == null) { geoCoordinateWatcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High); geoCoordinateWatcher.MovementThreshold = 20; // Use MovementThreshold to ignore noise in the signal. geoCoordinateWatcher.StatusChanged += this.geoCoordinateWatcher_StatusChanged; } geoCoordinateWatcher.Start(); } else if (e.Button == LocationPicker.ApplicationBarInfo.Buttons[1]) { GeoCoordinate location; if (mapPushpin != null) { location = mapPushpin.Location; } else { location = BingMap1.TargetBoundingRectangle.Center; } task.Latitude = location.Latitude; task.Longitude = location.Longitude; LocationPicker.IsPopupOpen = false; } else if (e.Button == LocationPicker.ApplicationBarInfo.Buttons[2]) { task.Latitude = 0; task.Longitude = 0; LocationPicker.IsPopupOpen = false; } }
private void ApplicationBarInfo_ButtonClick(object sender, ApplicationBarButtonClickEventArgs e) { if (e.Button == LocationPicker.ApplicationBarInfo.Buttons[0]) { if (geoCoordinateWatcher == null) { geoCoordinateWatcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High); geoCoordinateWatcher.MovementThreshold = 20; // Use MovementThreshold to ignore noise in the signal. geoCoordinateWatcher.StatusChanged += this.geoCoordinateWatcher_StatusChanged; } geoCoordinateWatcher.Start(); } else if (e.Button == LocationPicker.ApplicationBarInfo.Buttons[1]) { GeoCoordinate location; if (mapPushpin != null) { location = mapPushpin.Location; } else { location = BingMap1.TargetBoundingRectangle.Center; } task.Latitude = location.Latitude; task.Longitude = location.Longitude; LocationPicker.IsPopupOpen = false; } else if (e.Button == LocationPicker.ApplicationBarInfo.Buttons[2]) { task.Latitude = 0; task.Longitude = 0; LocationPicker.IsPopupOpen = false; } }
private void pbFilters_ApplicationBarInfo_ButtonClick(object sender, ApplicationBarButtonClickEventArgs e) { if (e.Button.Name == "btnOK") { SaveFiltersChanges(); ApplyFilters(); } else CancelFiltersChanges(); pbFilters.IsPopupOpen = false; }