2013-05-09 63 views
0

我是(有點)WPF中的新手。我堅持這種佈局。視圖框顯示正常,列表框的空間(30%)也很好顯示,但我無法在該空間中看到列表框。以下是我的XAML,只是關於這個問題。使用網格和列表框的WPF佈局問題

<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> 

任何幫助將不勝感激。

回答

0

這是DataContext定義在一個錯誤的級別。 SomeOtherProperty是沒有它的數據將被綁定到ListBox的上下文的一部分。但是我仍然困惑於爲什麼在輸出窗口中沒有任何綁定錯誤。嗯...