/// <summary> /// Protected method for validating the ViewModel /// - Fires PropertyChanged for IsValid and Errors /// </summary> protected virtual void Validate() { OnPropertyChanged("IsValid"); OnPropertyChanged("Errors"); IsValidChanged?.Invoke(this, EventArgs.Empty); }
private void CheckValid() { if (!UseProxyRadioButton.Checked) { IsValidChanged?.Invoke(true); return; } if (AuthenticationCheckBox.Checked && string.IsNullOrEmpty(ProxyUsernameTextBox.Text)) { IsValidChanged?.Invoke(false); return; } if (!Util.IsValidPort(ProxyPortTextBox.Text)) { IsValidChanged?.Invoke(false); return; } try { var uriHostNameType = Uri.CheckHostName(ProxyAddressTextBox.Text); IsValidChanged?.Invoke(uriHostNameType != UriHostNameType.Unknown && uriHostNameType != UriHostNameType.IPv6); } catch { IsValidChanged?.Invoke(false); } }
protected virtual void Validate() { OnPropertyChanged(nameof(IsValid)); OnPropertyChanged(nameof(Errors)); IsValidChanged?.Invoke(this, EventArgs.Empty); }
void StartDebuggingOptionsPage_PropertyChanged(object?sender, PropertyChangedEventArgs e) { Debug.Assert(sender == StartDebuggingOptionsPage); if (e.PropertyName == nameof(StartDebuggingOptionsPage.IsValid)) { IsValidChanged?.Invoke(this, EventArgs.Empty); } }
protected virtual void OnIsValidChanged() { IsValidChanged?.Invoke(this, EventArgs.Empty); }
protected void OnIsValidChanged() { IsValidChanged?.Invoke(this, new EventArgs()); }
/// <summary> /// Raise the is valid property changed /// </summary> /// <param name="isValid"></param> protected virtual void RaiseIsValidChaged(bool isValid) { IsValidChanged?.Invoke(this, new IsValidEventArgs(isValid)); }