C++ data binding with DependencyProperty or with use NsProp and (differences Question)
It looks like there are two ways for databinding (if I understand it right).
With NsProp() definition and use class INotifyPropertyChange or use DependencyProperty. When to use one and when to use another? The DependencyProperty way is most used on UserControl without INotifyPropertyChange from tutorials and some examples.
With NsProp() definition and use class INotifyPropertyChange or use DependencyProperty. When to use one and when to use another? The DependencyProperty way is most used on UserControl without INotifyPropertyChange from tutorials and some examples.
- realesmedia
- Posts: 85
- Joined:
Re: C++ data binding with DependencyProperty or with use NsProp and (differences Question)
Use NsProp when you need your own getter or setter and use dependency when you need just a mirror of value.It looks like there are two ways for databinding (if I understand it right).
With NsProp() definition and use class INotifyPropertyChange or use DependencyProperty. When to use one and when to use another? The DependencyProperty way is most used on UserControl without INotifyPropertyChange from tutorials and some examples.
Re: C++ data binding with DependencyProperty or with use NsProp and (differences Question)
What you mean "mirror of value"?
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: C++ data binding with DependencyProperty or with use NsProp and (differences Question)
DependencyProperties are used (usually on controls) when your property requires advanced features like DynamicResources, Styling, Bindings, Animation...
A dependency property automatically provides an internal mechanism for property change notification, so they don't need the INotifyPropertyChanged interface.
If you just need a property to expose some data, you can use a simple reflected property (NsProp), and implement INotifyPropertyChanged interface only if you want to notify when that property changes its value to update the UI.
A dependency property automatically provides an internal mechanism for property change notification, so they don't need the INotifyPropertyChanged interface.
If you just need a property to expose some data, you can use a simple reflected property (NsProp), and implement INotifyPropertyChanged interface only if you want to notify when that property changes its value to update the UI.
Re: C++ data binding with DependencyProperty or with use NsProp and (differences Question)
Just to make this clear:
1. If you are implementing a UserControl -> DependencyProperty
2. If your are exposing a property in your DataContext for DataBinding -> Reflection property (NsProp)
1. If you are implementing a UserControl -> DependencyProperty
2. If your are exposing a property in your DataContext for DataBinding -> Reflection property (NsProp)
Re: C++ data binding with DependencyProperty or with use NsProp and (differences Question)
You welcome, I am marking this as solved.
Who is online
Users browsing this forum: No registered users and 89 guests