public async void RefreshData() { BasicinformationDetails BID = new BasicinformationDetails(); Employee = await BID.GetCurentUserBasicinformationDetailsAsync(URLConfig.Currentuserapiurl); var employeeSch = Employee.EmployeeScheduels; var shc1 = employeeSch.Where(y => y.DayOfWeek == -1); ObservableCollection <EmployeeSchedule> castlist = new ObservableCollection <EmployeeSchedule>(shc1); MYschdeule2 = castlist; }
/* public Allspecialdays(INavigation nav) * { * this.Navigation = nav; * loadData(); * }*/ public async void loadData() { BasicinformationDetails BID = new BasicinformationDetails(); Employee = await BID.GetCurentUserBasicinformationDetailsAsync(URLConfig.Currentuserapiurl); var employeeSch = Employee.EmployeeScheduels; var shc1 = employeeSch.FirstOrDefault(y => y.DayOfWeek == -1); //uu.Clear(); //var z = employeeSch.Find(y => y.DayOfWeek == 0); var data = employeeSch.Where(y => y.DayOfWeek == -1); Device.BeginInvokeOnMainThread(() => { foreach (var item in employeeSch.Where(y => y.DayOfWeek == -1).ToList()) { //uu.Add(item); MYschdeule2.Add(item); } }); constants.datas = MYschdeule2; }