1
基於this question,但略有不同。將UI元素的綁定寬度與另一個UI元素的寬度的百分比
我不確定這是否可能。有什麼辦法將UI元素的寬度鏈接到另一個元素的寬度百分比?
例如:
<ScrollViewer x:Name="scrollviewerWrapper">
<TextBlock x:Name="textblock"
Width="{Binding Path=Width, [[[ % of ]]] ElementName=scrollviewerWrapper}" />
</ScrollViewer>
所以,如果我的ScrollViewer是100px的,我希望我的TextBlock成爲其中的= 60像素(該ScrollViewer中的寬度是動態的)60%。