123456789101112131415161718192021222324252627 |
- using System;
- using System.Linq;
- using Xamarin.Forms;
- namespace comal.timesheets
- {
- public class ContactSelectionPage : SelectionPage
- {
- public ContactSelectionPage(Action<ContactShell> action)
- : base(
- (string)"Select Contact",
- (SelectionPageMode)SelectionPageMode.Immediate,
- (columns) =>
- {
- columns
- .BeginUpdate()
- .Clear()
- .Add(new MobileGridTextColumn<ContactShell>() { Column = x => x.Name, Width = GridLength.Star })
- .Add(new MobileGridTextColumn<ContactShell>() { Column = x => x.Street, Width = GridLength.Auto })
- .Add(new MobileGridTextColumn<ContactShell>() { Column = x => x.City, Width = GridLength.Auto })
- .EndUpdate();
- },
- (force) => App.Data.Contacts.Refresh(force),
- (items) => action?.Invoke(items.FirstOrDefault() as ContactShell)
- ) { }
- }
- }
|