DependencyProperty值UWP中的等效继承

时间:2017-04-15 10:20:28

标签: wpf uwp dependency-properties uwp-xaml

在WPF中给定一个Visual Tree,可以指定AttachedProperties继承如下:

public static class MyClass 
{
    public static readonly DependencyProperty FooProperty = 
        DependencyProperty.RegisterAttached(
            "Foo", typeof(string), typeof(MyClass),
            new FrameworkPropertyMetadata(
                "AString",
                FrameworkPropertyMetadataOptions.Inherits));
}

在UWP中没有FrameworkPropertyMetadata,因此您无法指定FrameworkPropertyMetadataOptions.Inherits。

我曾希望默认行为是继承DependencyProperty值,但事实并非如此。

UWP中是否有任何等价物允许继承DependencyProperty

0 个答案:

没有答案