When to use Dependency Properties

后端 未结 5 1378
深忆病人
深忆病人 2020-12-14 10:32

I sometimes think I maybe using Dependency Properties unnecessarily. When do I need to use it? When I have a property that dependes on other properties? Say I have a C

5条回答
  •  情歌与酒
    2020-12-14 10:57

    Remember that Dependency Properties, although they allow Binding either as a source or a target, are also Thread-Sensitive, and when serializing you will have to use a surrogate, serialization as DependencyObject isn't serializable.

    Oh, and Equals and GetHashCode are sealed :(

提交回复
热议问题