System.Windows.DependencyProperty与System.Workflow.ComponentModel.DependencyProperty [英] System.Windows.DependencyProperty vs. System.Workflow.ComponentModel.DependencyProperty

查看:218
本文介绍了System.Windows.DependencyProperty与System.Workflow.ComponentModel.DependencyProperty的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.NET框架似乎已经将DependencyProperty对象的两个实现

The .NET Framework seems to have two implementations of the DependencyProperty object

  1. System.Windows.DependencyProperty
  2. <一个href="http://msdn.microsoft.com/en-us/library/system.workflow.componentmodel.dependencyproperty.aspx"相对=nofollow> System.Workflow.ComponentModel.DependencyProperty
  1. System.Windows.DependencyProperty
  2. System.Workflow.ComponentModel.DependencyProperty

据我所知,在正常使用的第一个是在WPF和正常使用的,第二个是在WF但什么是如果有的话?
它们之间的差异 如果我没有使用WPF / WF,仍然想使用的DependencyProperty这将是最好用?
任何计划合并到一个在未来?

I understand that the normal use of the first one is in WPF and the normal use of the second one is in WF but what are the differences between them if any?
If I was not using WPF/WF and still wanted to use a DependencyProperty which would be best to use?
Any plans to merge to one in the future?

推荐答案

的区别是微妙的,但它是相当清楚不过了:

The difference is subtle but it's quite clear enough:

System.Windows.DependencyProperty主要作为处理任何WPF依赖对象的依赖属性,并且可以提供有关财产的元数据可选的附加信息,如措施,动画,和许多WPF具体注册。

System.Windows.DependencyProperty is focused toward handling dependency property of any WPF dependency object, and you can register it with optional additional information about the metadata of the property, such as measures, animatable, and many WPF specific.

为什么?由于这种依赖属性就可以使用PropertyMetadata的派生类中进一步明确。 这包括WPF的UIPropertyMetadata和FrameworkPropertyMetadata为WPF依赖属性的高级注册。

WHy? Because this dependency property can then be further specified using derived classes of PropertyMetadata. This includes WPF's UIPropertyMetadata and FrameworkPropertyMetadata for advanced registration of WPF dependency property.

System.Workflow.ComponentModel.DependencyProperty只能注册为一个简单的依赖属性,而不需要特定的WF的Pr​​opertyMetadata更多的信息。

System.Workflow.ComponentModel.DependencyProperty can only register as a simple dependency property, without needing additional information of specific WF's PropertyMetadata.

在present,有没有计划整合他们,因为他们两个在概念和内容不同。

At present, there's no plan to integrate them, since both of them are conceptually and contextually different.

这篇关于System.Windows.DependencyProperty与System.Workflow.ComponentModel.DependencyProperty的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆