private void SetCaptcha(RecaptchaState state, ReCaptchaType type) { if (string.IsNullOrEmpty(state.Challenge)) { WaveUrl = null; ImageUrl = null; } else { if (type == ReCaptchaType.Image) { ImageUrl = state.Server + "image?c=" + state.Challenge; WaveUrl = null; } else { ImageUrl = null; WaveUrl = (state.Server + "image?c=" + state.Challenge).Replace("https://", "http://"); } } }
/// <summary> /// handles the CaptchaTypeProperty changes. /// </summary> /// <param name="oldValue">The old value.</param> /// <param name="newValue">The new value.</param> private void OnCaptchaTypeChanged(ReCaptchaType oldValue, ReCaptchaType newValue) { if (newValue == ReCaptchaType.Image) VisualStateManager.GoToState(this, imageStateName, true); else VisualStateManager.GoToState(this, audioStateName, true); ImageUrl = null; WaveUrl = null; Reload(newValue == ReCaptchaType.Audio ? ReCaptchaReloadReason.ChangeTypeAudio : ReCaptchaReloadReason.ChangeTypeText); }