是否有办法约束另一种控制? 与此类似:
<Button x:Name="Foo" Content="Foo" />
<local:CustomControl OtherControl="{Binding Foo}" />
我试图在主食建筑商中确定数据内容,但似乎没有工作。
习惯法的定义类似:
class CustomControl
{
public FrameworkElement OtherControl { get; set; }
}
是否有办法约束另一种控制? 与此类似:
<Button x:Name="Foo" Content="Foo" />
<local:CustomControl OtherControl="{Binding Foo}" />
我试图在主食建筑商中确定数据内容,但似乎没有工作。
习惯法的定义类似:
class CustomControl
{
public FrameworkElement OtherControl { get; set; }
}
不能确定你试图做些什么,但在银星3中,你可以使用对控制的财产具有约束力的要素。
<Button x:Name="Foo" Content="Foo" />
<local:CustomControl x:Name="control" Property="{Binding Path=Content, ElementName=Foo}" />
在法典中,你可以永远分析具有约束力的内容并从中获取内容?
控制。 育儿。 来源
在银目中不可能做到:
Silverlight 2 doesn’t allow you to bind one element to another element. Instead, all bindings are to data objects. (You could get around this using an intermediate object, but the added inconvenience means it’s rarely worthwhile.)
<Button x:Name="Foo" Content="Foo" />
<local:CustomControl x:Name="control" OtherControl="{Binding ElementName=Foo}" />