using System; using System.Collections.Generic; using System.Text; using Comal.Classes; using Xamarin.Forms; namespace comal.timesheets { public class KanbanShell : Shell { static KanbanShell() { Columns .Map(nameof(ID), x => x.Kanban.ID) .Map(nameof(Number), x => x.Kanban.Number) .Map(nameof(Title), x => x.Kanban.Title) .Map(nameof(Type), x => x.Kanban.Type.Code) .Map(nameof(Category), x => x.Kanban.Category) .Map(nameof(DueDate), x => x.Kanban.DueDate) .Map(nameof(Completed), x => x.Kanban.Completed) .Map(nameof(Summary), x => x.Kanban.Summary) .Map(nameof(ManagerName), x => x.Kanban.ManagerLink.Name) .Map(nameof(Attachments), x => x.Kanban.Attachments) .Map(nameof(Locked), x => x.Kanban.Locked) .Map(nameof(IsManager), x => x.Manager) .Map(nameof(IsEmployee), x => x.Assignee); } public Guid ID => Get(); public int Number => Get(); public string Title => Get(); public String Type => Get(); public string Category => Get(); public DateTime Completed => Get(); public DateTime DueDate => Get(); public String Summary => Get(); public String ManagerName => Get(); public int Attachments => Get(); public String ImagePath => Attachments > 0 ? Device.RuntimePlatform.Equals(Device.iOS) ? "attachments.png" : "paperclip.png" : ""; public bool Locked => Get(); public bool IsManager => Get(); public bool IsEmployee => Get(); public bool IsObserver => !IsManager && !IsEmployee; public Color Color => IsEmployee ? DueDate > DateTime.Today.AddDays(7) ? Color.FromHex("#77dd77") //green / pastel green : DueDate > DateTime.Today ? Color.FromHex("#fff8dc") //cornsilk / light yellow : Color.FromHex("#f08080") //light coral / red : IsManager ? Color.LightGray : Color.FromHex("#cb99c9"); //purple / pastel violet } }