Declare a Style TargetType for a NestedClass in WPF
I have MyClass
class.
<Style TargetType="local:MyClass"></Style>
no pr开发者_开发问答oblems.
I have MyClass.MyNestedClass
(public) class.
I declare ... ?
You need to use a + to separate the outer class name from the nested class name:
<Style TargetType="local:MyClass+MyNestedClass"></Style>
You cant declare nested classes in XAML (afaik), as it interferes with the Xaml parsing logic that assumes the dot notation represents a property
精彩评论