开发者

Declare a Style TargetType for a NestedClass in WPF

开发者 https://www.devze.com 2023-01-27 10:46 出处:网络
I have MyClass class. I declare <Style TargetType=\"local:MyClass\"></Style> no pr开发者_开发问答oblems.

I have MyClass class.

I declare

<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

0

精彩评论

暂无评论...
验证码 换一张
取 消