private void OnViewModelPropertyChanged(object sender, PropertyChangedEventArgs e) { if (Property.NameEquals(e.PropertyName, () => ViewModel.Error)) { if (ViewModel.Error != null) { var type = ViewModel.Error; switch (type) { case "PASSWORD": ShippingInfoView.Shake(PasswordLabel, PasswordLabel.Input); break; } } } }
private void OnViewModelPropertyChanged(object sender, PropertyChangedEventArgs e) { if (Property.NameEquals(e.PropertyName, () => ViewModel.Error)) { if (ViewModel.Error != null) { var type = ViewModel.Error; if (!string.IsNullOrEmpty(type)) { switch (type) { case "invalid_number": case "CARD_NUMBER_INVALID": ShippingInfoView.Shake(CardNumberLabel, CardNumberLabel.Input); break; case "invalid_expiry_year": case "invalid_expiry_month": case "CARD_EXPIRE_DATE_INVALID": ShippingInfoView.Shake(ExpirationDateLabel, ExpirationDateLabel.Input); break; case "CARD_HOLDER_NAME_INVALID": ShippingInfoView.Shake(CardholderNameLabel, CardholderNameLabel.Input); break; case "invalid_cvc": case "CARD_CVC_INVALID": ShippingInfoView.Shake(SecurityCodeLabel, SecurityCodeLabel.Input); break; case "CARD_COUNTRY_INVALID": ShippingInfoView.Shake(SelectCountry); break; case "CARD_ZIP_INVALID": ShippingInfoView.Shake(PostCodeLabel, PostCodeLabel.Input); break; case "invalid_button": ShippingInfoView.Shake(Validate); break; } } } } }
private void OnViewModelPropertyChanged(object sender, PropertyChangedEventArgs e) { if (Property.NameEquals(e.PropertyName, () => ViewModel.Error)) { var type = ViewModel.Error; if (!string.IsNullOrEmpty(type)) { switch (type) { case "invalid_password": ShippingInfoView.Shake(PasswordLabel, PasswordLabel.Input); break; case "invalid_confirmpassword": ShippingInfoView.Shake(ConfirmPasswordLabel, ConfirmPasswordLabel.Input); break; case "invalid_email": ShippingInfoView.Shake(RecoveryEmailLabel, RecoveryEmailLabel.Input); break; } } } }