Quantcast
Channel: MVVM Light Toolkit
Viewing all articles
Browse latest Browse all 1826

New Post: How to Bind String Value to TextBox?

$
0
0
Is your Product class a ViewModel? If so, it should derive from ViewModelBase.
Then, your Name setter should look something like:
            set
            {
                if (Name == value)
                {
                    return;
                }
                Name = value;
                RaisePropertyChanged(() => Name);
            }
If your textbox's Text property is bound to the Name property, the textbox should update when the Name property changes.
Could you give more details?
  • How have you set the DataContext for the textbox?
  • What happens when the button is clicked?

Viewing all articles
Browse latest Browse all 1826

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>