Xamarin.Forms BindableProperty 和 WPF DependencyProperty 之间的区别

Difference between Xamarin.Forms BindableProperty and WPF DependencyProperty

我在 WPF 开发方面拥有丰富的经验,现在正在尝试创建我的第一个 Xamarin.Forms 应用程序。我认识到有一些等效于 WPF DependencyProperty 的东西叫做 BindableProperty。他们看起来很像,所以我的问题是:

与 WPF DependencyProperty 相比,Xamarin.Forms BindableProperty 的实现和行为之间是否存在任何关键差异?

已经有关于这个主题的 number of guides

从第一个link我引用;

DependencyObject & DependencyProperty

There are something’s that have simply been implemented under a different name. This is very important as they form the backbone of the binding mechanism. If you’ve done any WPF you’ll no doubt be familiar with DependencyProperty and DependencyObject. You won’t find these in Xamarin Forms because they are called something else. DependencyObject is now BindableObject, and DependencyProperty is now known as BindableProperty. Fundamentally they are the same.

不太确定来源,但我认为他已经做了一些研究。

您当然可以查看两者的文档:DependencyProperty, which you probably already know by heart. And the BindableProperty 来自 Xamarin.Forms。

正如您在评论中指出的那样,您之所以疑惑是因为命名不同。我没有记录它的来源,但我有 read/heard 某个地方,他们已经重命名了一些东西以使命名更适合移动设备。此外,为了防止人们只是将 WPF 布局复制并粘贴到移动应用程序中,并以这种方式创造糟糕的用户体验。