Пример #1
0
        public ShowStockList()
        {
            InitializeComponent();
            ViewModel        = new ShowStockViewModel();
            this.DataContext = ViewModel;

            ObservableCollection <ItemModel> ListGrid = new ObservableCollection <ItemModel>();

            var ItemNameList = App.Current.Properties["AutoItemNameList"] as List <ItemNameAutoListModel>;

            foreach (var item in ItemNameList)
            {
                textBox2.AddItem(new ItemNameAutoListModel
                {
                    DisplayId   = item.DisplayId,
                    DisplayName = item.DisplayName
                });
            }

            ItemNameReff = textBox2;

            //ItemNameStock.Text = "";
            //ItemNameReff = ItemNameStock;
            ListGrid = App.Current.Properties["StockGrid"] as ObservableCollection <ItemModel>;



            ItemNaReff = ItemNAme;
            ItemNAme   = ItemNaReff;

            BarrcodeReff = Barcood;
            Barcood      = BarrcodeReff;

            SalepriceReff = SalePrice;
            SalePrice     = SalepriceReff;



            dataGrid1.ItemsSource = ListGrid;
            ListGridRefr          = dataGrid1;
        }
Пример #2
0
        protected void comboBox_KeyDown(object sender, KeyEventArgs e)

        {
            //MessageBox.Show(e.Key.ToString());
            //if ((e.Key.ToString() == "Tab"))
            if ((e.Key.ToString() == "Return"))
            {
                if (App.Current.Properties["StockGridList"] != null)
                {
                    ShowStockViewModel hgy = new ShowStockViewModel();
                    hgy.ShowStockGrid();
                    ShowStockList.ItemNameReff.Text = "";
                }
                else
                {
                    MainViewModel hgy = new MainViewModel();
                    hgy.GetSearchName(1);
                    // Main.NameRef1.Text = "";
                }

                //var gridItem = new ObservableCollection<ItemModel>();
                //gridItem = App.Current.Properties["DataGrid"] as ObservableCollection<ItemModel>;
            }
        }