如何在 UWP 中将“DependencyProperty”标记为“BindsTwoWayByDefault”?

How can I mark a `DependencyProperty` as `BindsTwoWayByDefault` in UWP?

在 WPF 中,您可以将自定义控件上的 DependencyProperty 标记为默认绑定 Mode=TwoWay,使用 FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, but FrameworkPropertyMetadata seems to be missing in UWP. The UWP documentation on the {Binding} markup extension 表示默认模式可能会更改,但没有说明如何更改影响它。

Mode

Specifies the binding mode, as one of these values: "OneTime", "OneWay", or "TwoWay". These correspond to the constant names of the BindingMode enumeration. The default depends on the binding target but in most cases it is "OneWay". Note that this differs from the default for {x:Bind}, which is "OneTime".

如何更改自定义控件上 UWP XAML 依赖项 属性 的默认绑定模式?

当前的 UWP SDK 不支持影响 DependencyProperty 的默认值 BindingMode;这只有在 WPF 中才有可能。

在 UWP 上,所有 {Binding} 默认都有 BindingMode.OneWay,而 {x:Bind}BindingMode.OneTime