12345678910111213141516171819202122232425262728293031323334 |
- using System;
- using System.Linq;
- using InABox.Mobile;
- namespace PRS.Mobile
- {
- public class TaskSelectionPage : SelectionPage
- {
- public TaskSelectionPage(Action<KanbanShell> action)
- : base(
- (string)"Select Task",
- (SelectionPageMode)SelectionPageMode.Immediate,
- (columns, Filters) =>
- {
- columns
- .BeginUpdate()
- .Clear()
- .Add(new MobileGridIntegerColumn<KanbanShell>() { Column = x=>x.Number })
- .Add(new MobileGridTextColumn<KanbanShell>() { Column = x=>x.Title })
- .Add(new MobileGridTextColumn<KanbanShell>() { Column = x=>x.TypeName })
- .Add(new MobileGridDateColumn<KanbanShell>() { Column = x=>x.DueDate, Format = "dd MMM yy"})
- .EndUpdate();
- },
- (args) =>
- {
- App.Data.Kanbans.SelectFilter(args.Filter);
- var result = App.Data.Kanbans.Refresh(args.Force);
- args.LastUpdated = App.Data.Kanbans.LastUpdated;
- return result;
- },
- (items) => action?.Invoke(items.FirstOrDefault() as KanbanShell)
- ) { }
- }
- }
|