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);
            }
        }
Beispiel #2
0
        /// <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);
        }
Beispiel #3
0
        protected virtual void Validate()
        {
            OnPropertyChanged(nameof(IsValid));
            OnPropertyChanged(nameof(Errors));

            IsValidChanged?.Invoke(this, EventArgs.Empty);
        }
Beispiel #4
0
 void StartDebuggingOptionsPage_PropertyChanged(object?sender, PropertyChangedEventArgs e)
 {
     Debug.Assert(sender == StartDebuggingOptionsPage);
     if (e.PropertyName == nameof(StartDebuggingOptionsPage.IsValid))
     {
         IsValidChanged?.Invoke(this, EventArgs.Empty);
     }
 }
Beispiel #5
0
 public void OnAfterModelValidation(bool isValid)
 {
     if (isValid != IsValid || !initialized)
     {
         initialized = true;
         IsValid     = isValid;
         StateHasChanged();
         IsValidChanged.InvokeAsync(IsValid);
     }
 }
 protected virtual void OnIsValidChanged()
 {
     IsValidChanged?.Invoke(this, EventArgs.Empty);
 }
Beispiel #7
0
 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));
 }