When to use a WPF Dependency Property versus INotifyPropertyChanged

后端 未结 5 1882
眼角桃花
眼角桃花 2020-12-08 09:40

Do folks have any guidance on when a simple .NET property that fires INotifyPropertyChanged.PropertyChanged is sufficient in a view model? Then when do you wan

5条回答
  •  佛祖请我去吃肉
    2020-12-08 10:32

    As far as I know, DependencyProperty is only required when you need

    1. PropertyValue inheritence
    2. you need to allow the property to be set in Style setters
    3. Use animation for the property

    etc.

    These features will not be available with normal properties.

提交回复
热议问题