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 8694387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:46:32+00:00 2026-06-13T00:46:32+00:00

I have one textbox and one button. The Button Command should change the property

  • 0

I have one textbox and one button. The Button Command should change the property which is binded to the TextBox.

But I don’t see any visual changes after command execution.
I think it easy question related to wpf binding

Please help me with this issue

Source of app:

<UserControl.DataContext>
    <local:SampleViewModel />
</UserControl.DataContext>
<Grid>
    <StackPanel>
        <TextBox Height="23" Width="120" Text="{Binding MyName}"  />
        <Button Content="Click" Command="{Binding ButtonCommand}" />
    </StackPanel>
</Grid>

ViewModel:

Private _myName As String
Public Property MyName As String
  Get
    Return _myName
  End Get
  Set(value As String)
    _myName = value
      OnPropertyChanged("MyName")
  End Set
End Property

Public _buttonCommand As DelegateCommand
Public ReadOnly Property ButtonCommand As DelegateCommand
Get
  Return If(_buttonCommand IsNot Nothing, _buttonCommand, 
  New DelegateCommand(AddressOf Execute, AddressOf CanExecute))
End Get
End Property

Private Sub Execute()
  MyName = "Executed"
End Sub

Private Function CanExecute() As Boolean
  Return True
End Function

Public Event PropertyChanged As PropertyChangedEventHandler
Private Sub OnPropertyChanged(propertyName As String)
  RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
End Sub
  • 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-13T00:46:33+00:00Added an answer on June 13, 2026 at 12:46 am

    Do the following:

    1.
    Class MainWindow
    Implements INotifyPropertyChanged

    2 . In Public Sub New() make sure you write Me.DataContext = Me to set the DataContext

    Note: Ignore step 2 if you’re using a ViewModel and setting it in XAML

    3 . Modify the ProperyChanged like this:
    Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged

    Only after implementing INotifyPropertyChanged correctly will the Binding correctly refresh the MyName property after the PropertyChanged event

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

Sidebar

Related Questions

see fiddle i have html table and one textbox and one button.make cell selection
I have a application in which there is one textbox and a button.I want
In my code I have one textbox and one button. Whatever place you type
This is my problem, I have one textbox, one button and one label. Everything
I have 2 textBox and 1 button! I want to insert text to one
On my page I have one textbox and one button. -- on the button
I have windows form with one textbox(Pname) and one button. I have one class
In my webpage i have one textbox(hotel name) and a button. Suppose if i
I have a form with one textbox and one button. Here I need to
I have a form with one textbox and one button. Here I need to

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.