我已經完成了這個使用RelativePanel
內的2個列表框。
有第一ListBox中有RelativePanel.AlignTopWithPanel = "True"
有第二個列表框有RelativePanel.AlignBottomWithPanel = "True"
接下來,如果你希望它看起來渾然一體,確保您的相對面板的背景顏色相同的列表框(S )。
<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="" />
<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="" />
<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="" />
<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="" />
<TextBlock
Foreground="White"
Text="Settings"
FontFamily="Arial"
FontSize="16"
Margin="20,0,0,0" />
</StackPanel>
</ListBoxItem>
</ListBox>
</RelativePanel>
</SplitView.Pane>