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

            IsValidChanged?.Invoke(this, EventArgs.Empty);
        }
Example #4
0
 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);
 }
Example #6
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));
 }