我正在尝试使用类似于XAML Controll Gallery中可用的SplitView示例的ListView构建SplitView。
我有一个对象列表,其名称显示在左侧的ListView中。我不知道的是
代码大纲:
<SplitView Name="..."
...
<SplitView.Pane>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="SYSTEM"
x:Name="SystemHeader"
Margin="60,12,0,0"
Style="{StaticResource BaseTextBlockStyle}"/>
<ListView Grid.RowSpan="1"
VerticalAlignment="Stretch"
Margin="0,12,0,0"
SelectionMode="None"
Name="MyListView"
ItemTemplate="{StaticResource WLY_DefaultItemTemplate}"
ItemsSource="{x:Bind WLYs}"
ItemClick="WLYListView_ItemClick"
IsItemClickEnabled="True"/>
<StackPanel Orientation="Horizontal"
Grid.Row="2"
Margin="14,24,0,24">
</StackPanel>
</Grid>
</SplitView.Pane>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="LAYOUT DETAILS" Margin="12,12,0,0" Style="{StaticResource BaseTextBlockStyle}"/>
<TextBlock x:Name="content" Grid.Row="1" Margin="12,12,0,0" Style="{StaticResource BodyTextBlockStyle}" />
</Grid>
</SplitView>
任何人都可以概述如何实现这一目标,或者向我指出可以做到这一点的资源吗?
编辑:我想我想出了_ItemClicked函数:
private void WLYListView_ItemClicked(object sender, ItemClickEventArgs e)
{
var clickedItem = e.ClickedItem;
selectedWLY = (WLY)clickedItem;
}