using System; using System.Collections.ObjectModel; using System.Threading.Tasks; using Comal.Classes; using InABox.Core; using InABox.Mobile; using Syncfusion.XForms.Buttons; using Xamarin.Forms; namespace PRS.Mobile { public class KanbanEditViewModel : MobileViewModel { public KanbanDocumentModel Documents { get; set; } public KanbanFormModel Forms { get; set; } public KanbanEditViewModel() { Documents = new KanbanDocumentModel(App.Data, () => new Filter(x => x.EntityLink.ID).IsEqualTo(Item?.ID ?? CoreUtils.FullGuid)); Forms = new KanbanFormModel(App.Data, () => new Filter(x => x.Parent.ID).IsEqualTo(Item?.ID ?? CoreUtils.FullGuid)); } protected override void DoLoad() { var tasks = new Task[] { Task.Run(() => Forms.Refresh(true)), Task.Run(() => Documents.Refresh(true)) }; Task.WaitAll(tasks); } public override bool IsChanged => Item == null || Item.ID == Guid.Empty || Item.IsChanged(); } }