2016-12-31 9 views
0

リストボックスにはいくつかのlistboxItemがありますが、最後のアイテム名 "ExampleBottom"は最下部にある必要があります。私はverticalalignを試みたが、これは動作しません。ListboxItemをsplitview uwpのリストボックスの一番下に置く方法

 <SplitView.Pane> 

      <ListBox SelectionMode="Single" 
        SelectionChanged="ListBox_SelectionChanged" 
        Background="#333333" 
        Foreground="White"> 

       <ListBoxItem Name="Example1"> 
        <StackPanel Orientation="Horizontal"> 
         <TextBlock>Example</TextBlock> 
        </StackPanel> 
       </ListBoxItem> 

       <ListBoxItem Name="Example2"> 
        <StackPanel Orientation="Horizontal"> 
         <TextBlock>Example</TextBlock> 
        </StackPanel> 
       </ListBoxItem> 

       <ListBoxItem Name="Example3"> 
        <StackPanel Orientation="Horizontal"> 
         <TextBlock>Example</TextBlock> 
        </StackPanel> 
       </ListBoxItem> 

       <ListBoxItem Name="ExampleBottom" VerticalAlignment="Bottom"> 
        <StackPanel Orientation="Horizontal"> 
         <TextBlock>Example</TextBlock> 
        </StackPanel> 
       </ListBoxItem> 
      </ListBox> 

     </SplitView.Pane> 

答えて

0

これはリストボックスではできません。私はグリッドを使用して、中に空の行を持っていますが、あなた自身の選択メカニズムを実装する必要があります

0

私はRelativePanelの中に2つのリストボックスを使ってこれを達成しました。

は、最初のListBoxをお持ちのRelativePanel.AlignTopWithPanel = "True" が第二のListBoxを持っていますが、それがシームレスに見たい場合は、あなたの相対的なパネルの背景色があなたのリストボックス(Sと同じであることを確認し、RelativePanel.AlignBottomWithPanel = "True"

次を持っています)。

 <SplitView.Pane> 
      <RelativePanel Background="Black"> 
       <ListBox SelectionMode="Single" 
       Name="IconsListBox" 
       SelectionChanged="ListBoxSelectionChanged" 
       Background="Black" 
         RelativePanel.AlignTopWithPanel="True"> 
        <ListBoxItem Name="HomeListBoxItem" 
          ToolTipService.ToolTip="Home" 
          PointerEntered="HamburgerMenuItemPointerEntered" 
          PointerExited="HamburgerMenuItemPointerExited"> 
         <StackPanel Orientation="Horizontal"> 
          <TextBlock 
          Foreground="White" 
          FontFamily="Segoe MDL2 Assets" 
          FontSize="16" 
          Text="&#xE10F;" /> 
          <TextBlock 
          Foreground="White" 
          Text="Home" 
          FontSize="16" 
          FontFamily="Arial" 
          Margin="20,0,0,0" /> 
         </StackPanel> 
        </ListBoxItem> 
        <ListBoxItem Name="SecondListBoxItem" 
          ToolTipService.ToolTip="2nd Item" 
          PointerEntered="HamburgerMenuItemPointerEntered" 
          PointerExited="HamburgerMenuItemPointerExited"> 
         <StackPanel Orientation="Horizontal"> 
          <TextBlock Foreground="White" 
          FontFamily="Segoe MDL2 Assets" 
          FontSize="16" 
          Text="&#xE734;" /> 
          <TextBlock 
          Foreground="White" 
          Text="Dosimetry" 
          FontFamily="Arial" 
          FontSize="16" 
          Margin="20,0,0,0" /> 
         </StackPanel> 
        </ListBoxItem> 
       </ListBox> 
       <ListBox SelectionMode="Single" 
       Name="BottomListBox" 
       SelectionChanged="ListBoxSelectionChanged" 
       Background="Black" 
         RelativePanel.AlignBottomWithPanel="True"> 
        <ListBoxItem Name="UserListBoxItem" 
          ToolTipService.ToolTip="Dosimetry" 
          PointerEntered="HamburgerMenuItemPointerEntered" 
          PointerExited="HamburgerMenuItemPointerExited" 
          VerticalAlignment="Bottom"> 
         <StackPanel Orientation="Horizontal"> 
          <TextBlock Foreground="White" 
          FontFamily="Segoe MDL2 Assets" 
          FontSize="16" 
          Text="&#xE2AF;" /> 
          <TextBlock 
          Foreground="White" 
          Text="User" 
          FontFamily="Arial" 
          FontSize="16" 
          Margin="20,0,0,0" /> 
         </StackPanel> 
        </ListBoxItem> 
        <ListBoxItem Name="SettingsListBoxItem" 
          ToolTipService.ToolTip="Dosimetry" 
          PointerEntered="HamburgerMenuItemPointerEntered" 
          PointerExited="HamburgerMenuItemPointerExited"> 
         <StackPanel Orientation="Horizontal"> 
          <TextBlock Foreground="White" 
          FontFamily="Segoe MDL2 Assets" 
          FontSize="16" 
          Text="&#xE713;" /> 
          <TextBlock 
          Foreground="White" 
          Text="Settings" 
          FontFamily="Arial" 
          FontSize="16" 
          Margin="20,0,0,0" /> 
         </StackPanel> 
        </ListBoxItem> 
       </ListBox> 
      </RelativePanel> 
     </SplitView.Pane> 
関連する問題