12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using System.Linq;
- using Comal.Classes;
- using Xamarin.Forms.Xaml;
- using SelectionChangedEventArgs = Syncfusion.XForms.Buttons.SelectionChangedEventArgs;
- namespace comal.timesheets
- {
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class SiteTasks : SitePage
- {
-
- public SiteTasks()
- {
- InitializeComponent();
- Tasks.Columns
- .BeginUpdate()
- .Add(new MobileGridIntegerColumn<JobKanbanShell>() { Column = x=>x.Number })
- .Add(new MobileGridTextColumn<JobKanbanShell>() { Column = x=>x.Title })
- .Add(new MobileGridTextColumn<JobKanbanShell>() { Column = x=>x.Type })
- .Add(new MobileGridDateColumn<JobKanbanShell>() { Column = x=>x.DueDate, Format = "dd MMM yy"})
- .Clear()
- .EndUpdate();
- }
-
- protected override void JobLoaded()
- {
- ReloadData(false);
- }
- private void ReloadData(bool force)
- {
- if (force)
- Job.Refresh(true, () => Dispatcher.BeginInvokeOnMainThread(KanbansLoaded));
- else
- KanbansLoaded();
- }
- private void KanbansLoaded()
- {
- Tasks.ItemsSource = Job.Kanbans.Where(kanban => kanban.Category == Kanban.ALL[TaskType.SelectedIndex]);
- }
- private void Tasks_OnRefreshRequested(object sender, MobileGridRefreshRequestArgs args)
- {
- ReloadData(true);
- }
- private void Tasks_OnSelectionChanged(object sender, MobileGridSelectionArgs args)
- {
- // Edit the Task Here (single)
- // Alternatively, assign to someone (bulk)
- }
- private void TaskType_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- ReloadData(false);
- }
- }
- }
|