| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System;
- using System.Threading.Tasks;
- using Comal.Classes;
- using InABox.Core;
- using InABox.Mobile;
- using Point = Xamarin.Forms.Point;
- namespace PRS.Mobile
- {
- public class AssignmentEditViewModel : MobileViewModel<Assignment, AssignmentShell>
- {
- protected override void DoLoad()
- {
- Task[] tasks = new Task[]
- {
- Task.Run(() => Forms.Refresh(true)),
- Task.Run(() => Documents.Refresh(true))
- };
- Task.WaitAll(tasks);
- }
- public Point Coordinates =>
- Item == null
- ? new Point()
- : new Point
- (
- Item.Longitude,
- Item.Latitude
- );
-
- public AssignmentFormModel Forms { get; private set; }
-
- public AssignmentDocumentModel Documents { get; private set; }
- public AssignmentEditViewModel()
- {
- Forms = new AssignmentFormModel(App.Data,
- () => new Filter<AssignmentForm>(x => x.Parent.ID).IsEqualTo(Item?.ID ?? CoreUtils.FullGuid)
- );
-
- Documents = new AssignmentDocumentModel(App.Data,
- () => new Filter<AssignmentDocument>(x => x.EntityLink.ID).IsEqualTo(Item?.ID ?? CoreUtils.FullGuid)
- );
- }
-
- public override bool IsChanged => Item == null || Item.ID == Guid.Empty || Item.IsChanged();
-
- }
- }
|