private async void todayWOEvent_Tapped(object sender, EventArgs e) { await BeBusy(true); var source = imgcontainar.Source as FileImageSource; var filename = source.File; if (filename == "myWO.gif") { headerTitle.Text = "اوامر العمل الشخصية"; imgcontainar.Source = "allWO.gif"; var wovv = await rcs.getTodatWorkOrderViewByIDAsync(DataStore.getUserID()); if (wovv.Count > 0) { mainListView.ItemsSource = wovv; foreach (WorkOrderView wov in mainListView.ItemsSource) { wov.Duration = (DateTime.Today.Date - wov.startingDate).Value.Days; } searchList = (List <WorkOrderView>)mainListView.ItemsSource; Nothing.IsVisible = false; } else { Nothing.IsVisible = true; } } else if (filename == "allWO.gif") { headerTitle.Text = "جميع أوامر العمل"; imgcontainar.Source = "myWO.gif"; var wovv = await rcs.getWorkOrderViewByIDAsync(DataStore.getUserID()); if (wovv.Count > 0) { mainListView.ItemsSource = wovv; foreach (WorkOrderView wov in mainListView.ItemsSource) { wov.Duration = (DateTime.Today.Date - wov.startingDate).Value.Days; } searchList = (List <WorkOrderView>)mainListView.ItemsSource; Nothing.IsVisible = false; } else { Nothing.IsVisible = true; } } await BeBusy(false); }