| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 | using System;using System.Collections.Generic;using System.Linq;using InABox.Core;using System.Diagnostics.CodeAnalysis;using Xamarin.Forms;namespace comal.timesheets{    public abstract class LookupModel<TParent, TItem, TEntity> : ListModel<TParent, TItem, TEntity>, ILookupModel        where TParent : LookupModel<TParent, TItem, TEntity>        where TEntity : Entity, IRemotable, IPersistent, new()        where TItem : Shell<TParent, TEntity>, ILookupShell, new()    {        protected LookupModel(IModelHost host, Func<Filter<TEntity>> filter, bool transient = false) : base(            host, filter, transient)        {        }        protected LookupModel(IModelHost host, Func<Filter<TEntity>> filter, [NotNull] string filename) : base(            host, filter, filename)        {        }        protected override void Initialize()        {            base.Initialize();            _selected.Clear();        }        private List<Guid> _selected = new List<Guid>();        public void Select(ILookupShell shell)        {            foreach (var _item in Items)                _item.Selected = _item == shell;        }                public Color Selected { get; set; }                public Color Background { get; set; }            }}
 |