Я все еще новичок в xaml и .net maui, но даже не знаю, какие условия поиска использовать. Я хочу перечислить сегодняшние уведомления о задачах в формате xaml с представлением коллекции. Я хочу, чтобы этот список при отображении в представлении коллекции xaml извлекал сведения из другого списка, используя TaskID в качестве ключа идентификатора.
Например, примерно:
Код: Выделить всё
class Notification:
int Id;
int TaskID;
int Title;
DateTime NotificationTime;
class Task:
int Id;
string Name;
string Details;
Код: Выделить всё
UpcomingNotificationsViewModel:
List NotificationsList { get; set; }
List TasksList { get; set; }
async void LoadData()
{
var result = from s in NotificationsList
where s.NotificationTime.Date == today
group s by s.NotificationTime into g
select new GroupedNotification{ NotificationTime = g.Key, Notification = g.ToList() };
GroupedNotifications = result;
}
public class GroupedNotification
{
public DateTime NotifyTime { get; set; }
public List Notification { get; set; }
}
Код: Выделить всё
//this label below, how can I link it to TaskList and get details based on TaskID from this Notification List?
`
Источник: https://stackoverflow.com/questions/781 ... ccess-anot
Мобильная версия