SIPSorcery.UIHelper.SetText C# (CSharp) Method

SetText() public static method

public static SetText ( System.Windows.Controls.PasswordBox passwordBox, string text ) : void
passwordBox System.Windows.Controls.PasswordBox
text string
return void
        public static void SetText(PasswordBox passwordBox, string text)
        {
            if (passwordBox.Dispatcher.CheckAccess())
            {
                passwordBox.Password = text;
            }
            else
            {
                passwordBox.Dispatcher.BeginInvoke(new SetPasswordBoxDelegate(SetText), passwordBox, text);
            }
        }

Same methods

UIHelper::SetText ( System.Windows.Controls.TextBlock textBlock, string text ) : void
UIHelper::SetText ( TextBox textBox, string text ) : void
UIHelper::SetText ( System.Windows.Controls.ToolTip toolTip, string text ) : void

Usage Example

        private void UpdateCustomerComplete(SubmitOperation so)
        {
            if (so.HasError)
            {
                if (!m_customer.HasValidationErrors)
                {
                    // Only display the exception message if it's not already being set in the validation summary.

                    // Remove the error information the RIA domain services framework adds in and that will just confuse things.
                    string errorMessage = Regex.Replace(so.Error.Message, @"Submit operation failed.", "");
                    UIHelper.SetText(m_statusTextBlock, errorMessage);
                }
                else
                {
                    UIHelper.SetText(m_statusTextBlock, "There was a validation error updating your details.");
                }

                so.MarkErrorAsHandled();
            }
            else
            {
                UIHelper.SetText(m_statusTextBlock, "Details successfully updated.");
            }

            SetUpdateButtonsEnabled(true);
        }
All Usage Examples Of SIPSorcery.UIHelper::SetText