2013-10-22 68 views
0

我想建立一個WPF控件,就像自定義WPF列表控制

enter image description here

這是Outlook導航的一部分。

我不確定天氣使用選項卡控件還是列表控件。

如果您也可以參考樣品,那將會非常有幫助。

由於事先 KD

+2

您不必從頭開始構建自己的控制來實現這一目標。你可以使用這個項目:http://navigationpane.codeplex.com。 – kmatyaszek

+0

聽起來像你可以用標準的WPF機制來做到這一點,比如ItemTemplate,GroupStyle和CollectionView。 –

+0

這和'Expander'有什麼區別? – Shoe

回答

0

查找到Expander控制。這是一個可摺疊的內容面板,您可以點擊標題展開或摺疊內容。

這應該給你一些你的「當前視圖」窗口上方的面板:

<Border BorderThickness="0,0,0,2" BorderBrush="LightBlue" > 
    <Expander IsExpanded="True" Name="expander" Background="#FFB5E1F3"> 
     <Expander.Header> 
      <TextBlock Text="Current View" Background="#FFB5E1F3" Foreground="#FF166CD3" FontWeight="Bold" Padding="4,1,75,1"/> 
     </Expander.Header> 
     <Expander.Content> 
      <Grid Background="White"> 
       <StackPanel Margin="20,0,0,0"> 
        <RadioButton Content="Business Cards" Margin="2"/> 
        <RadioButton Content="Address Cards" Margin="2"/> 
        <RadioButton Content="Phone List" Margin="2"/> 
       </StackPanel> 
      </Grid> 
     </Expander.Content> 
    </Expander> 
</Border>