Dr.*_*ABT 7 wpf dependency-properties uwp 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));
}
Run Code Online (Sandbox Code Playgroud)
在UWP中,没有FrameworkPropertyMetadata,因此您无法指定FrameworkPropertyMetadataOptions.Inherits.
我曾希望默认行为是继承DependencyProperty值,但事实并非如此.
UWP中是否有任何等价物允许继承DependencyProperty 值?
| 归档时间: |
|
| 查看次数: |
246 次 |
| 最近记录: |