Equivalence equivalence equivalence DependencyProperty in UWP

Given the visual tree in WPF, you can specify that AttachedProperties are inherited as follows:

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

There is no FrameworkPropertyMetadata in UWP, and therefore you cannot specify FrameworkPropertyMetadataOptions.Inherits.

I was hoping that the default behavior would inherit DependencyProperty values, but that is not the case.

Is there an equivalent in UWP that allows the inheritance of DependencyProperty values ?

+5
source share

Source: https://habr.com/ru/post/1266756/


All Articles