Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Silverlight-带列表框的扩展控件,100%高度_Silverlight_Xaml_Expression Blend_Blend - Fatal编程技术网

Silverlight-带列表框的扩展控件,100%高度

Silverlight-带列表框的扩展控件,100%高度,silverlight,xaml,expression-blend,blend,Silverlight,Xaml,Expression Blend,Blend,我试图把4个扩展控件放在一个有4行的网格中,扩展控件包含一个网格和一个列表框(当前包含一些示例数据) 理想情况下,当一个扩展器被扩展时,我希望它能够填满所有可用的空间,而不会将剩余的扩展器从屏幕上推下,或将列表框从屏幕上推下。有人能想出一种方法来调整下面的XAML或更新下面的XAML来实现这一点吗 <Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource Exp

我试图把4个扩展控件放在一个有4行的网格中,扩展控件包含一个网格和一个列表框(当前包含一些示例数据)

理想情况下,当一个扩展器被扩展时,我希望它能够填满所有可用的空间,而不会将剩余的扩展器从屏幕上推下,或将列表框从屏幕上推下。有人能想出一种方法来调整下面的XAML或更新下面的XAML来实现这一点吗

    <Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource ExpanderData}}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="0.246*"/>
                <RowDefinition Height="0.754*"/>
            </Grid.RowDefinitions>
            <Grid Margin="0" Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.275*"/>
                    <ColumnDefinition Width="0.725*"/>
                </Grid.ColumnDefinitions>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <toolkit:Expander x:Name="Expander1" Header="One" IsExpanded="False">
                        <Grid Background="#FFE5E5E5">
                            <ListBox Margin="0" ItemTemplate="{StaticResource ItemTemplate}" ItemsSource="{Binding Collection}"/>
                        </Grid>
                    </toolkit:Expander>
                    <toolkit:Expander x:Name="Expander2" Header="Two" IsExpanded="True" VerticalAlignment="Top" Grid.Row="1">
                        <Grid Background="#FFE5E5E5">
                            <ListBox Margin="0" ItemTemplate="{StaticResource ItemTemplate1}" ItemsSource="{Binding Collection}"/>
                        </Grid>
                    </toolkit:Expander>
                    <toolkit:Expander x:Name="Expander3" Header="Three" VerticalAlignment="Top" Grid.Row="2" IsExpanded="False">
                        <Grid Background="#FFE5E5E5">
                            <ListBox Margin="0" ItemTemplate="{StaticResource ItemTemplate2}" ItemsSource="{Binding Collection}"/>
                        </Grid>
                    </toolkit:Expander>
                    <toolkit:Expander x:Name="Expander4" Header="Four" VerticalAlignment="Top" Grid.Row="3" IsExpanded="False">
                        <Grid Background="#FFE5E5E5">
                            <ListBox Margin="0" ItemTemplate="{StaticResource ItemTemplate3}" ItemsSource="{Binding Collection}"/>
                        </Grid>
                    </toolkit:Expander>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</UserControl>

我可能会使用DockPanel而不是网格-对于Silverlight,您必须从Silverlight Toolkit()获取它-我知道您已经有了它,我只是为了存档而引用它。取消选中“LastChildFill”属性并将所有子项停靠到顶部

在没有足够数据的情况下很难进行测试,但是如果一次只打开一个扩展器,并将每个扩展器的MaxHeight设置为剩余可用空间,该怎么办