开发者

Binding to Auto-value in XAML

开发者 https://www.devze.com 2023-03-13 11:44 出处:网络
I guess the auto-value is set after parsed by the binding. Binding code: Width=\"{Binding Capacity, Converter=开发者_如何学编程{StaticResource CapacityConverter}, ElementName=LayoutPath}\"

I guess the auto-value is set after parsed by the binding.

Binding code:

Width="{Binding Capacity, Converter=开发者_如何学编程{StaticResource CapacityConverter}, ElementName=LayoutPath}" 
Height="{Binding Capacity, Converter={StaticResource CapacityConverter}, ElementName=LayoutPath}" 

Source:

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

It works if I set capacity to a fixed value, but not when it auto-calculates based on total nodes in xml.

Any solution?

-


Try binding to ActualCapacity instead.

0

精彩评论

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