我有下面的代码有效。它正确地将最小绘图宽度保持在 20 像素宽。但是,我需要设置一个 MinHeight 值。我希望我的 MinHeight 值保持当前的高度/宽度比率。我怎么做?
<Grid MinWidth="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type c:IWorldAndScreen}}, Path=MetersPerPixel, Converter={StaticResource multiplier}, ConverterParameter=20}">
<Grid.Width>
<MultiBinding Converter="{StaticResource summation}">
<Binding Path="Front" />
<Binding Path="Back" />
</MultiBinding>
</Grid.Width>
<Grid.Height>
<MultiBinding Converter="{StaticResource summation}">
<Binding Path="Left" />
<Binding Path="Right" />
</MultiBinding>
</Grid.Height>
...
</Grid>