我上课:
public class Class1
{
public static string Property1
{
get
{
return "Prop1";
}
}
public class Class2
{
public static string Property2
{
get
{
return "Prop2";
}
}
}
}
XAML:
<ObjectDataProvider x:Key="provider" ObjectType="{x:Type local:Class1}"/>
此作品有效:
<Button Content="{Binding Source={StaticResource provider},Path=Property1}" />
但这不是:
<Button Content="{Binding Source={StaticResource provider},Path=Class2.Property2}" />
如何绑定到Class2.Property2
?