تبلیغات
یادداشتهای علی سالخورده حقیقی - How to: Specify the Direction of the Binding
 
یادداشتهای علی سالخورده حقیقی
We Provide Solutions for The Future Developement.
درباره وبلاگ


دریافت لوح تقدیر از سازمان ملل به عنوان مشاور فناوری اطلاعات سازمان در انتخابات برون مرزی سال 2004.

مدیر وبلاگ : علی سالخورده
نویسندگان
نظرسنجی
از کدامیک از آنتی ویروس های زیر استفاده میکنید و راضی هستید؟








آمار وبلاگ
  • کل بازدید :
  • بازدید امروز :
  • بازدید دیروز :
  • بازدید این ماه :
  • بازدید ماه قبل :
  • تعداد نویسندگان :
  • تعداد کل پست ها :
  • آخرین بازدید :
  • آخرین بروز رسانی :

Source: MSDN

This example shows how to specify whether the binding updates only the binding target (target) property, the binding source (source) property, or both the target property and the source property.

You use the Mode property to specify the direction of the binding. The following enumeration list shows the available options for binding updates:

  • TwoWay updates the target property or the property whenever either the target property or the source property changes.

  • OneWay updates the target property only when the source property changes.

  • OneTime updates the target property only when the application starts or when the DataContext undergoes a change.

  • OneWayToSource updates the source property when the target property changes.

  • Default causes the default Mode value of target property to be used.

For more information, see the BindingMode enumeration.

The following example shows how to set the Mode property.

<TextBlock Name="IncomeText" Grid.Row="0" Grid.Column="1"
  Text="{Binding Path=TotalIncome, Mode=OneTime}"/>


To detect source changes (applicable to OneWay and TwoWay bindings), the source must implement a suitable property change notification mechanism such as INotifyPropertyChanged. See How to: Implement Property Change Notification for an example of an INotifyPropertyChanged implementation.

For TwoWay or OneWayToSource bindings, you can control the timing of the source updates by setting the UpdateSourceTrigger property. See UpdateSourceTrigger for more information.





نوع مطلب : MVVP، WPF، #C، 
برچسب ها : Data Binding، wpf، binding updates، TwoWay updates، OneWay updates، OneTime updates، OneWayToSource updates،
لینک های مرتبط :

       نظرات
1391/01/15
علی سالخورده
1396/05/16 11:46
Hi there would you mind sharing which blog platform you're working with?
I'm looking to start my own blog soon but I'm having a difficult
time selecting between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your design seems different then most blogs
and I'm looking for something unique. P.S My apologies
for being off-topic but I had to ask!
1396/04/6 08:04
Hey! This is my first visit to your blog! We are
a collection of volunteers and starting a new initiative in a community in the same niche.
Your blog provided us valuable information to work on. You have done a extraordinary job!
1396/02/13 19:34
Ahaa, its pleasant dialogue concerning this paragraph here
at this website, I have read all that, so now me also commenting here.
1396/02/13 06:17
Hello, Neat post. There's a problem with your web site in internet explorer, may check this?

IE nonetheless is the market chief and a big section of folks will
pass over your magnificent writing because of this problem.
1396/02/9 15:47
My brother suggested I would possibly like this
blog. He used to be totally right. This put up truly made my day.
You cann't believe simply how a lot time I had spent for this info!
Thanks!
1396/02/9 14:44
Hello i am kavin, its my first time to commenting
anywhere, when i read this piece of writing i thought i
could also create comment due to this sensible piece of
writing.
1396/01/25 05:26
Thank you, I've just been searching for information about this subject for a long time and yours is the greatest I've found out so far.

But, what in regards to the bottom line? Are you positive concerning the source?
1396/01/23 17:50
This website was... how do I say it? Relevant!!
Finally I've found something that helped me. Appreciate it!
1396/01/22 07:30
Thanks for some other informative web site. Where else may just I get that
kind of information written in such an ideal way? I've a mission that I'm just now
running on, and I've been on the look out for such information.
1396/01/16 08:46
Good post. I learn something totally new and challenging on sites I stumbleupon on a
daily basis. It's always interesting to read content from other writers and use a little something from other web sites.
 
لبخندناراحتچشمک
نیشخندبغلسوال
قلبخجالتزبان
ماچتعجبعصبانی
عینکشیطانگریه
خندهقهقههخداحافظ
سبزقهرهورا
دستگلتفکر