0
我想學習如何在列表視圖的DataTemplate在我贏8應用文本贏8應用程序獲取從列表視圖的DataTemplate
我有下面的代碼在我的XAML代碼
<!-- Vertical scrolling item list -->
<ListView x:Name="itemListView"
Margin="0,4.714,10,0.429"
ItemsSource="{Binding Source={StaticResource itemsViewSource}}"
SelectionChanged="itemListView_SelectionChanged" Loaded="itemListView_Loaded" Grid.Row="4" Tapped="itemListView_Tapped_1">
<ListView.ItemTemplate>
<DataTemplate>
<Grid Height="110" Margin="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="110" Height="110">
<Image Source="{Binding Image}" Stretch="UniformToFill"/>
</Border>
<StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,0,0,0">
<TextBlock Text="{Binding Title}" TextWrapping="NoWrap" FontFamily="Global User Interface"/>
<TextBlock Text="{Binding Subtitle}" TextWrapping="NoWrap"/>
<TextBlock Text="{Binding Description}" MaxHeight="60" FontFamily="Global User Interface"/>
<TextBlock Text="{Binding Description2}" MaxHeight="60" FontFamily="Global User Interface"/>
<TextBlock Text="{Binding Description3}" MaxHeight="60" FontFamily="Global User Interface"/>
<TextBlock Text="{Binding Description4}" MaxHeight="60" FontFamily="Global User Interface"/>
</StackPanel>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
這使6列表視圖上每個項目的文本塊
問題我有當我在列表視圖中選擇一個項目我使用輕擊事件然後填充詳細信息窗格,但我無法解決如何從選定的項目中獲取6個項目
有人點我在正確的方向,請
任何幫助表示讚賞
馬克
感謝這個XAML進去不錯,但我得到了竊聽事件的錯誤說「的類型或Namplace名稱」StackPanel「找不到」 –
排序它Stackpanel被拼寫錯誤很多謝謝 –