1234567891011121314151617181920212223242526272829 |
- using System;
- using System.Linq;
- using Xamarin.Forms;
- namespace comal.timesheets
- {
- public class EmployeeMultiSelectionPage : SelectionPage
- {
- public EmployeeMultiSelectionPage(Action<EmployeeShell[]> action)
- : base(
- (string)"SelectEmployee",
- (SelectionPageMode)SelectionPageMode.MultiSelect,
- (columns) =>
- {
- 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();
- },
- (refresh) => App.Data.Employees.Refresh(refresh),
- (items) => action?.Invoke(items.OfType<EmployeeShell>().ToArray())
- ) { }
- }
- }
|