开发者

Declare a Style TargetType for a NestedClass in WPF

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜