使用网格和列表框的WPF布局问题
我是WPF的新手。我被这个布局困住了。Viewbox显示良好,ListBox的空间(30%)也显示良好,但我在该空间中看不到ListBox。下面是我的XAML,只是关于这个问题使用网格和列表框的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
<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
是该上下文的一部分,没有该上下文,任何数据都不会绑定到列表框。但我仍然很困惑,为什么它的输出窗口中没有任何绑定错误。嗯