123456789101112131415161718192021222324252627282930313233343536 |
- using System;
- using System.Linq;
- using InABox.Mobile;
- using Xamarin.Forms;
- namespace PRS.Mobile
- {
- public class EmployeeMultiSelectionPage : SelectionPage
- {
- public EmployeeMultiSelectionPage(Action<EmployeeShell[]> action)
- : base(
- (string)"SelectEmployee",
- (SelectionPageMode)SelectionPageMode.MultiSelect,
- (columns, filters) =>
- {
- columns
- .BeginUpdate()
- .Clear()
- .Add(new MobileGridTextColumn<EmployeeShell>()
- { Column = x => x.Code, Width = GridLength.Auto })
- .Add(new MobileGridTextColumn<EmployeeShell>()
- { 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<EmployeeShell>().ToArray())
- ) { }
- }
- }
|