123456789101112131415161718192021222324252627282930313233343536 |
- using System.Linq;
- using InABox.Core;
- using Xamarin.Forms;
- namespace PRS.Mobile
- {
- public class DocScannerEditViewModel : BindableObject
- {
- private DataEntryDocumentShell _document = new ();
- private readonly DocumentModel _imageModel;
- public DataEntryDocumentShell Document
- {
- get => _document;
- set
- {
- if (Equals(value, _document)) return;
- _document = value;
- _imageModel.Refresh(true);
- OnPropertyChanged();
- OnPropertyChanged(nameof(Image));
- }
- }
- public DocumentShell? Image => _imageModel.Items.FirstOrDefault();
-
-
- public DocScannerEditViewModel()
- {
- _imageModel = new DocumentModel(App.Data,
- () => new Filter<Document>(x => x.ID).IsEqualTo(Document.DocumentID)
- );
- }
-
- }
- }
|