in a XAML file (a WPF UserControl), is there a way to reference an inner class "B" defined in another class "A" ?
public class A
{
public class B
{
}
}
Something like :
<local:A.B ... />
This syntax does not work because "B" is interpreted as a property named "B" in class "A".
I've tried more exotic syntaxes like "::" or "+" but none seems to work.
I'm currently using Silverlight 4 with VS2010.
Thanks in advance for your help.
<d:Style.DataContext>
tag (exactly withoutd:DesignInstance
markup extension because otherwise VS designer shows errors). Then I figured out I can specify<x:Type Type="nmspc:A+B" />
instead and it will work too. Maybe this will be helpful for someone. – Aparicio.
refers to a property; not sure why XAML couldn't also search for a nested class, but it doesn't. A nested class can be represented when inside a string (e.g. a property value), using+
instead of.
. As an element name (as shown in question),+
is not allowed, as the result would no longer be valid XML;+
is not a valid name character. – Kush