Example #1
0
        public LibraryViewModel(List <Service.Product> products)
        {
            List <ModelProduct> modelProducts = new List <ModelProduct>();

            foreach (Service.Product product in products)
            {
                ModelProduct modelProduct = new ModelProduct();
                modelProducts.Add(modelProduct.MakeModelProduct(product));
            }
            LibraryItems        = CollectionViewSource.GetDefaultView(modelProducts);
            LibraryItems.Filter = FilterProductLibrary;
        }
Example #2
0
        public ProductViewModel()
        {
            List <ModelProduct>    modelProducts = new List <ModelProduct>();
            List <Service.Product> products      = ShopWindows.client.GetProductTable().ToList();

            foreach (Service.Product product in products)
            {
                ModelProduct modelProduct = new ModelProduct();
                modelProducts.Add(modelProduct.MakeModelProduct(product));
            }
            Items        = CollectionViewSource.GetDefaultView(modelProducts);
            Items.Filter = FilterProduct;
        }
Example #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            imagesmaets = Environment.CurrentDirectory + @"\Content\";
            searchproduct.Focus();
            foreach (Service.Product produc in products)
            {
                ModelProduct mp = new ModelProduct();
                mp = mp.MakeModelProduct(produc);
                Lvm.Items.Add(mp);
            }
            foreach (Service.Profile produc in profilesq)
            {
                ModelProfile mp = new ModelProfile();
                mp = mp.MakeModelProfile(produc);
                AllUser.Items.Add(mp);
            }

            Lvm.Visibility = Visibility.Hidden;
        }
Example #4
0
 private void FilterProductText_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (FilterProductText.Text != "")
     {
         Lvm.Items.Clear();
         w = client.GetProductByFilter(FilterProductText.Text).ToList();
         foreach (Service.Product produc in w)
         {
             ModelProduct mp = new ModelProduct();
             mp = mp.MakeModelProduct(produc);
             Lvm.Items.Add(mp);
         }
     }
     else
     {
         Lvm.Items.Clear();
         foreach (Service.Product produc in products)
         {
             ModelProduct mp = new ModelProduct();
             mp = mp.MakeModelProduct(produc);
             Lvm.Items.Add(mp);
         }
     }
 }