using System; using System.Linq; using InABox.Mobile; using Xamarin.Forms; namespace PRS.Mobile { public class EmployeeMultiSelectionPage : SelectionPage { public EmployeeMultiSelectionPage(Action action) : base( (string)"SelectEmployee", (SelectionPageMode)SelectionPageMode.MultiSelect, (columns, filters) => { columns .BeginUpdate() .Clear() .Add(new MobileGridTextColumn() { Column = x => x.Code, Width = GridLength.Auto }) .Add(new MobileGridTextColumn() { Column = x => x.Name, Width = GridLength.Star }) .EndUpdate(); }, (args) => { App.Data.Employees.SelectFilter(args.Filter); var result = App.Data.Employees.Refresh(args.Force); args.LastUpdated = App.Data.Employees.LastUpdated; return result; }, (items) => action?.Invoke(items.OfType().ToArray()) ) { } } }