2011-06-17 58 views
0

我想自动值是在绑定解析后设置的。在XAML中绑定到自动值

绑定代码:

Width="{Binding Capacity, Converter={StaticResource CapacityConverter}, ElementName=LayoutPath}" 
Height="{Binding Capacity, Converter={StaticResource CapacityConverter}, ElementName=LayoutPath}" 

来源:

<LayoutPath 
    x:Name="LayoutPath" 
    SourceElement="{Binding ElementName=ellipse}" 
    FillBehavior="NoOverlap" 
    Orientation="OrientToPath" 
    Capacity="auto" 
    Padding="34" 
    Distribution="Even"/> 

它的工作原理,如果我能力设定为一个固定值,而不是在基于XML中的总节上自动计算。

任何解决方案?

-

+0

请[编辑帮助](http://stackoverflow.com/editing-help)改进问题的格式。 – 2011-06-17 09:45:22

回答

1

尝试绑定到ActualCapacity来代替。

+0

这个返回值= 0: 'width =“{Binding ActualCapacity,Converter = {StaticResource CapacityConverter},ElementName = LayoutPath}”' – Bluewater 2011-06-17 10:24:51

+1

问题是该属性没有提供更新,当第一次查询控件时没有足够的负载,你得到0,但当容量计算,你没有通知。 – 2011-06-17 11:15:31

+0

好的,谢谢! :) 那么接下来我应该做什么,创建我自己的通知器onCalculated?或者可能设置计算超时? – Bluewater 2011-06-17 11:26:50