SharedSizeScope on a Grid makes the form 'dance'

孤者浪人 提交于 2019-12-08 02:41:28

问题


I have a StackPanel (tried with a Grid as well) on my page.

<StackPanel Grid.IsSharedSizeScope="True">
    <Partials:BaseInfo x:Name="baseInfo" />
    <Partials:ExtraInfo x:Name="extraInfo" />
</StackPanel>

Both partials are using a grid with the same ColumnDefinitions:

<Grid.ColumnDefinitions>
    <ColumnDefinition Width="90" SharedSizeGroup="C1" />
    <ColumnDefinition Width="Auto" SharedSizeGroup="C2" />
    <ColumnDefinition Width="Auto" SharedSizeGroup="C3" />
    <ColumnDefinition Width="Auto" SharedSizeGroup="C4" />
    <ColumnDefinition Width="Auto" SharedSizeGroup="C5" />
    <ColumnDefinition Width="Auto" SharedSizeGroup="C6" />
    <ColumnDefinition Width="Auto" SharedSizeGroup="C7" />
    <ColumnDefinition Width="Auto" SharedSizeGroup="C8" />
</Grid.ColumnDefinitions>

Somehow 'C5' is acting up. If i set a fixes size there, everything works. If i leave it at auto, both the designer and the app will jump left/right in something that looks like an attempt to adjust the widths. The columns size up and down like crazy. I also tried with Width="*" and without a Width.

If i only Share the first 4 groups, everthing is fine as well. Also i use some ColumnSpans across different coulmns, which are different in the two usercontrols

What gives?

来源:https://stackoverflow.com/questions/9827040/sharedsizescope-on-a-grid-makes-the-form-dance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!