public void UpdateStockList() { try { Cordners.Clear(); List <SpecailOrders> selectedList = new List <SpecailOrders>(); IsBusy = true; Task.Factory.StartNew(() => { selectedList = _specailOrdersService.GetSaleStock(SelectedSupplier, SelectedCategory, SelectedSeasons, SelectedStyle, SelectedStockType, SelectedColour); }).ContinueWith((task) => { foreach (var o in selectedList.ToArray().Distinct()) { Cordners.Add(o); } IsBusy = false; }, TaskScheduler.FromCurrentSynchronizationContext()); } catch (Exception e) { new LogWriter().LogWrite(e.Message); new LogWriter().LogWrite(e.StackTrace); MessageBox.Show(e.Message); } }
public void RemoveSelectedListItems() { var selectedList = new ArrayList(SpecailSelected); foreach (var o in selectedList.ToArray()) { SpecailOrders.Remove(o as SpecailOrders); Cordners.Add(o as SpecailOrders); } }