我有 2 个表,并使用此查询来选择一些记录。
var temp = db.Letters
.Where(l => !db.SendLetters.Any(s => s.LetterId == l.Id))
.Select(l => new { CreatedDate = l.CreatedDate, priority = l.priority, Subject = l.Subject);
DashboardListView = CollectionViewSource.GetDefaultView(temp.ToList());
我有一个列表视图并将其与 DashboardListView 绑定
<ListView ItemsSource="{Binding DashboardListView}" SelectedItem="{Binding SelectedItem}" sort:GridViewSort.AutoSort="True" IsSynchronizedWithCurrentItem="True" >
<ListView.View>
<GridView>
<GridView.Columns >
<GridViewColumn DisplayMemberBinding="{Binding Subject}" Width="170" sort:GridViewSort.PropertyName="Subject" />
<GridViewColumn DisplayMemberBinding="{Binding CreatedDate}" Width="110" sort:GridViewSort.PropertyName="CreatedDate" />
<GridViewColumn DisplayMemberBinding="{Binding priority}" Width="80" sort:GridViewSort.PropertyName="priority" />
</GridView.Columns>
</GridView>
</ListView.View>
</ListView>
并将 SelectedItem 与 SelectedItem 属性绑定。选择一行时,我想获得SelectedItem的项目。(主题,createDate,..)
SelectedItem as //type
我的 linq 的返回类型是什么?