Esempio n. 1
0
 private void client_GetProductsCompleted(object sender, GetProductsCompletedEventArgs e)
 {
     try
     {
         gridProducts.ItemsSource = e.Result;
     }
     catch (Exception err)
     {
         lblInfo.Text = "Failed to contact service.";
     }
 }
 private void client_GetProductsCompleted(object sender, GetProductsCompletedEventArgs e)
 {
     try
     {
         pivotViewer.ItemsSource = e.Result;
     }
     catch (Exception err)
     {
         MessageBox.Show("Failed to contact service.");
     }
 }
 private void client_GetProductsCompleted(object sender, GetProductsCompletedEventArgs e)
 {
     try
     {
         PagedCollectionView view = new PagedCollectionView(e.Result);
         view.GroupDescriptions.Add(new PropertyGroupDescription("CategoryName"));
         gridProducts.ItemsSource = view;
     }
     catch (Exception err)
     {
         lblInfo.Text = "Failed to contact service.";
     }
 }
        private void client_GetProductsCompleted(object sender, GetProductsCompletedEventArgs e)
        {
            try
            {
                products.Clear();
                IEnumerable <Product> matches = from product in e.Result
                                                where product.UnitCost >= minCost
                                                select product;

                lstProducts.ItemsSource = matches;
            }
            catch (Exception err)
            {
                lblError.Text = "Failed to contact service.";
            }
        }
Esempio n. 5
0
        private void client_GetProductsCompleted(object sender, GetProductsCompletedEventArgs e)
        {
            try
            {
                products.Clear();
                foreach (Product product in e.Result)
                {
                    products.Add(product);
                }

                lstProducts.ItemsSource = products;
            }
            catch (Exception err)
            {
                lblError.Text = "Failed to contact service.";
            }
        }
Esempio n. 6
0
        private void client_GetProductsCompleted(object sender, GetProductsCompletedEventArgs e)
        {
            try
            {
                PagedCollectionView view = new PagedCollectionView(e.Result);
                // Sort by category and price.
                view.SortDescriptions.Add(new SortDescription("CategoryName", ListSortDirection.Ascending));
                view.SortDescriptions.Add(new SortDescription("UnitCost", ListSortDirection.Ascending));

                gridProducts.ItemsSource = view;

                pager.Source = view;
            }
            catch (Exception err)
            {
                lblInfo.Text = "Failed to contact service.";
            }
        }