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

  • SEARCH
  • Home
  • 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 8764087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:56:37+00:00 2026-06-13T15:56:37+00:00

I have a MyUserControl with the following Xaml: <TextBox Text={Binding InputValueProperty} /> In the

  • 0

I have a MyUserControl with the following Xaml:

<TextBox Text="{Binding InputValueProperty}" />

In the MyUserControl.xaml.cs I have:

public string InputValue
{
    get { return (string)GetValue(InputValueProperty); }
    set { SetValue(InputValueProperty, value); }
}
public static readonly DependencyProperty InputValueProperty = 
    DependencyProperty.Register("InputValueProperty", typeof(string), 
    typeof(MyUserControl));

In my MainWindow.xaml I create a user control:

<local:MyUserControl InputValue="My Input" />

Later on in my MainWindow.xaml.cs I am trying to access this string. All instances of MyUserControl are contained in a List and I access them with a foreach.

string temp = userControl.InputValue;

This is always null. In my MainWindow.xaml I can see the “My Input” in the text box of the user control but I can’t ever seem to get it out of there.

  • 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-13T15:56:38+00:00Added an answer on June 13, 2026 at 3:56 pm

    You need to implement INotifyPropertyChanged on your class that has the property

        public class YourClassThatHasTheInputValuePropertyInIt: INotifyPropertyChanged
        {
                public event PropertyChangedEventHandler PropertyChanged;
                private void NotifyPropertyChanged(String propertyName)
                {
                    if (PropertyChanged != null)
                        PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
                }
    
                public string InputValue
                {
                    get { return (string)GetValue(InputValueProperty); }
                    set { SetValue(InputValueProperty, value);
                          NotifyPropertyChanged("InputValue"); }
         }
        }
    

    This will allow the binding to pick up the property

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UserControl called 'Inspirations' with the following public property private int pagenumber;
I have the following property Temp2 : (my UserControl implements INotifyPropertyChanged) ObservableCollection<Person> _Temp2; public
I have a solution with the following folder structure: Solution MainApplication MainWindow.xaml SharedResourcesLibrary (Class
Assuming we have such control: public partial class MyUserControl : UserControl { public MyUserControl()
I have a UserControl which contains the following XAML: <GroupBox> <Grid> <Button x:Name=btn Content=Test/>
I am trying to set twoway binding on a UserControl that I have created.
I have a usercontrol called MyUserControl.xaml which dynamically adds another user control: UserControl myControl
I currently have the following XAML for my Grid control: <dxg:GridControl x:Name=DXGrid> <dxg:GridControl.Columns> <dxg:Column
I have a UserControl which overrides the OnRender-Method as follow: MyUsercontrol.cs: MyUserControl: UserControl {
I have a bunch of UserControls ('MyUserControl') that I want to have a user

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.