I'm still fairly new to xaml and .net maui but I don't really know what search terms to even use. I want to list today's task notifications in xaml with a collection view. I want this list, when displaying in xaml collection view, to pull details from another list using the TaskID as an identifier key.
For example, roughly:
Код: Выделить всё
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
Мобильная версия