Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7992209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:29:54+00:00 2026-06-04T13:29:54+00:00

Before I was using my custom user control I was using a standard textxbox

  • 0

Before I was using my custom user control I was using a standard textxbox with the text property bound to a property of an item selected in a list box. The binding also used validation rules. After this property was set the text changed event was fired in the xaml and everything worked fine.

Now I have changed it to use a user control that contains a textbox. I added a dependency property to my user control that is bound to the text property of the textbox. Now the event is fired when the text is changed before the validation has occured. The validation does not occur until a checkbox in my dialog that is bound to another property of the same item is checked. A breakpoint on the set method in my model view is not being broken anymore other than on the inital selection in the listbox, however the value is being update as I am seeing the effect after I click on the textbox. My error message shown by the validation does not appear until the checkbox is clicked on either.

The XAML for the user control in my window:

<my:BoundTextBox x:Name="spacingValueBox" TextBoxBase.TextChanged="spacingValueBox_TextChanged">
    <my:BoundTextBox.Text>
       <Binding Path="SelectedItem.Property" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay">                                       
           <Binding.ValidationRules>
              <validators:ValidationRule ErrorMessage="Invalid"/>
           </Binding.ValidationRules>
      </Binding>
   </my:BoundTextBox.Text>

The Text property bound to my user control in the XAML:

<UserControl x:Class="ButtonTextBox" ...
         ... Name="control">
<TextBox Text="{Binding Text, ElementName=control}"/>

The dependency property:

public static readonly DependencyProperty TextProperty =
TextBox.TextProperty.AddOwner(typeof(BoundTextBox));

public string Text
{
  get { return (string)GetValue(TextProperty); }
  set { SetValue(TextProperty, value); }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:29:56+00:00Added an answer on June 4, 2026 at 1:29 pm

    The solution was actually surprisingly simple I just had to set the UpdateSourceTrigger value to PropertyChanged.

    <TextBox Text="{Binding Text, ElementName=control, UpdateSourceTrigger=PropertyChanged}"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom user control (JCUserControl), and I am using it in
I'm using standard forms authentication with my custom membership and roles providers. Everything fine,
I am using a custom Alert dialog. If user go with negative button of
I have a dependency property (Foreground) on a custom control which is inheriting from
I am custom drawing a text box and now I am implementing the part
I've used lambda expressions in other languages before using them in C#, and so
I've done some simple string -> DateTime conversions before using DateTime.ParseExact(), but I have
Is there a way to check if a template tag exists before using the
I am currently trying to clean URL in my local machine(wamp) before using that(.htaccess)
Why I can use setcookie without any preparation while need a session_start() before using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.