Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.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
使用网格和列表框的WPF布局问题_Wpf_Listbox_Grid Layout - Fatal编程技术网

使用网格和列表框的WPF布局问题

使用网格和列表框的WPF布局问题,wpf,listbox,grid-layout,Wpf,Listbox,Grid Layout,我是WPF的新手。我被这个布局困住了。Viewbox显示良好,ListBox的空间(30%)也显示良好,但我在该空间中看不到ListBox。下面是我的XAML,只是关于这个问题 <Grid> <Grid.RowDefinitions> <RowDefinition Height="70*"/> <RowDefinition Height="30*"/> </Grid.RowDefinitions

我是WPF的新手。我被这个布局困住了。Viewbox显示良好,ListBox的空间(30%)也显示良好,但我在该空间中看不到ListBox。下面是我的XAML,只是关于这个问题

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="70*"/>
        <RowDefinition Height="30*"/>
    </Grid.RowDefinitions>
    <Viewbox Grid.Row="0" Grid.Column="0" DataContext="{Binding ElementName=thisControl}">
        <ItemsControl ItemsSource="{Binding Path=SomeProperty}" ItemTemplate="{StaticResource SomeTemplate}" >
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <UniformGrid/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
        </ItemsControl>
    </Viewbox>
    <ListBox Grid.Row="1" Grid.Column="0" ItemTemplate="{StaticResource ListBoxItemTemplate}" ItemsSource="{Binding Path=SomeOtherProperty}" Utils:ListBoxExtenders.AutoScrollToEnd="True"/>
</Grid>  


任何帮助都将不胜感激。

这是定义在错误级别的
DataContext
SomeOtherProperty
是该上下文的一部分,没有该上下文,任何数据都不会绑定到列表框。但我仍然很困惑,为什么它的输出窗口中没有任何绑定错误。嗯