我正在尝试根据 SelectedDay 的 Date 属性的值导航到 ListCollectionView 中的特定项目。
虚拟机
private Day _selectedDay;
public Day SelectedDay // the Name property
{
get { return _selectedDay; }
set { _selectedDay = value; RaisePropertyChanged(); }
}
public ObservableCollection<ShootingDay> AllShootingDayInfo {get; set;}
private ListCollectionView _shootingDayInfoList;
public ListCollectionView ShootingDayInfoList
{
get
{
if (_shootingDayInfoList == null)
{
_shootingDayInfoList = new ListCollectionView(AllShootingDayInfo);}
return _shootingDayInfoList;
}
set
{
_shootingDayInfoList = value; RaisePropertyChanged();
}
}
该<Day>
对象有一个属性,Date
我希望它与ObjectDate
中的 Property匹配,<ShootingDay>
以便我可以导航到Item inside的ShootingDayInfoList
whereSelectedDay.Date
匹配项中的项目。Date
ShootingDayInfoList
我已经尝试过了,但这不起作用,因为 Selected Item 不是同一个对象的一部分。
ShootingDayInfoList.MoveCurrentTo(SelectedDay.Date);
我怎样才能使这项工作?我对这一切都很陌生。