private void InitController() { TextFieldName.Text = ViewModel.Name; TextFieldDescription.Text = ViewModel.Description; TextFieldRating.Text = ViewModel.Rating; PickerViewTypes.Model = new LocationTypePickerViewModel(PickerChangedEvent); PickerViewTypes.Select((int)ViewModel.SelectedPlaceType, 0, true); PickerViewTypes.UserInteractionEnabled = false; }
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; } }
void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { switch (e.PropertyName) { case "Name": TextFieldName.Text = ViewModel.Name; break; case "Description": TextFieldDescription.Text = ViewModel.Description; break; case "Rating": TextFieldRating.Text = ViewModel.Rating; break; case "SelectedPlaceType": PickerViewTypes.Select((int)ViewModel.SelectedPlaceType, 0, true); break; default: return; } }