TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
WPF Binding One Way and Two Way
Ramen Adhikary
Oct 15, 2014
126.3
k
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
In this blog you will learn One Way and Two Way Binding in WPF.
MVVMApplication.zip
One way binding
<TextBox Text=
"{Binding ElementName=listView, Path=SelectedItem.EmployeeSalary, Mode=OneWay}"
>
Two way binding
<TextBox Grid.Row=
"0"
Text=
"{Binding ElementName=listView, Path=SelectedItem.EmployeeName, Mode=TwoWay}"
>
Picture 1:
Except employee salary field remaining fields are having two way binding.
Picture 2:
Now modifying all fields (except Employee Salary field) are effecting the list view items also because we are having Two Way bindings for each. But Employee Salary filed is having One way binding.
WPF Binding One Way and Two Way
Next Recommended Reading
Dynamically Render And Bind One User Control In Another User Control Using MVVM Pattern In WPF