private void SetControllEvents() { Map.DidUpdateUserLocation += (sender, e) => { if (sender is MKMapView map) { if (map.UserLocation != null) { var coordinates = map.UserLocation.Coordinate; var span = new MKCoordinateSpan(.015, .015); map.Region = new MKCoordinateRegion(coordinates, span); ViewModel.Longitude = coordinates.Longitude; ViewModel.Latitude = coordinates.Latitude; LocationManager.StopUpdatingLocation(); coordinates = new CLLocationCoordinate2D(ViewModel.Latitude, ViewModel.Longitude); Map.Region = new MKCoordinateRegion(coordinates, span); Map.RemoveAnnotations(); Map.AddAnnotation(new MKPointAnnotation { Coordinate = coordinates, Title = Strings.YOU_ARE_HERE }); } } }; TextFieldName.ShouldReturn = textField => { textField.ResignFirstResponder(); return(true); }; TextFieldDescription.ShouldReturn = textField => { textField.ResignFirstResponder(); return(true); }; TextFieldName.EditingChanged += (sender, e) => { ViewModel.Name = ((UITextField)sender).Text; ButtonSavePosition.Enabled = ViewModel.SavePlaceCommand.CanExecute(null); }; TextFieldDescription.EditingChanged += (sender, e) => { ViewModel.Description = ((UITextField)sender).Text; ButtonSavePosition.Enabled = ViewModel.SavePlaceCommand.CanExecute(null); }; ButtonSavePosition.TouchUpInside += (sender, e) => { TextFieldName.ResignFirstResponder(); }; }
void ReleaseDesignerOutlets() { if (TextFieldName != null) { TextFieldName.Dispose(); TextFieldName = null; } if (TextFieldQuantity != null) { TextFieldQuantity.Dispose(); TextFieldQuantity = null; } }
void ReleaseDesignerOutlets() { if (LabelAddress != null) { LabelAddress.Dispose(); LabelAddress = null; } if (LabelCity != null) { LabelCity.Dispose(); LabelCity = null; } if (LabelName != null) { LabelName.Dispose(); LabelName = null; } if (LabelTelNumber != null) { LabelTelNumber.Dispose(); LabelTelNumber = null; } if (TextFieldAddress != null) { TextFieldAddress.Dispose(); TextFieldAddress = null; } if (TextFieldCity != null) { TextFieldCity.Dispose(); TextFieldCity = null; } if (TextFieldName != null) { TextFieldName.Dispose(); TextFieldName = null; } if (TextFieldTelNumber != null) { TextFieldTelNumber.Dispose(); TextFieldTelNumber = null; } }
void ReleaseDesignerOutlets() { if (BottomSpaceButtonSave != null) { BottomSpaceButtonSave.Dispose(); BottomSpaceButtonSave = null; } if (ButtonSave != null) { ButtonSave.Dispose(); ButtonSave = null; } if (PickerViewTypes != null) { PickerViewTypes.Dispose(); PickerViewTypes = null; } if (TextFieldDescription != null) { TextFieldDescription.Dispose(); TextFieldDescription = null; } if (TextFieldName != null) { TextFieldName.Dispose(); TextFieldName = null; } if (TextFieldRating != null) { TextFieldRating.Dispose(); TextFieldRating = null; } }