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; }
public Main() { string language = ConfigurationManager.AppSettings["Language"]; if (language.ToUpper() == "ENGLISH") { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); } else if (language.ToUpper() == "GERMAN") { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE"); } InitializeComponent(); ViewModel = new MainViewModel(); SetLanguageDictionary(); this.DataContext = ViewModel; ObservableCollection <ItemModel> ListGrid = new ObservableCollection <ItemModel>(); CashRegisterName = textBlock14; var ScrCodeList = App.Current.Properties["AutoScrCodeList"] as List <SearchCodeAutoListModel>; foreach (var item in ScrCodeList) { textBox9.AddItem(new SearchCodeAutoListModel { DisplayId = item.DisplayId, DisplayName = item.DisplayName }); } ScrRef = textBox9; var ItemNameList = App.Current.Properties["AutoItemNameList"] as List <ItemNameAutoListModel>; foreach (var item in ItemNameList) { textBox2.AddItem(new ItemNameAutoListModel { DisplayId = item.DisplayId, DisplayName = item.DisplayName }); } NameRef1 = textBox2; var CustNameList = App.Current.Properties["AutoCustList"] as List <CustomerAutoCompleteListModel>; foreach (var item in CustNameList) { textBox6.AddItem(new CustomerAutoCompleteListModel { DisplayId = item.DisplayId, DisplayName = item.DisplayName }); } CustomerMainReff = textBox6; var BussinessNameList = App.Current.Properties["BussLocList"] as List <AutoBussinessModel>; foreach (var item in BussinessNameList) { textBox8.AddItem(new AutoBussinessModel { DisplayId = item.DisplayId, DisplayName = item.DisplayName }); } BussLocationMainReff = textBox8; textBox4.Text = ""; ListQnt = textBox4; // Select_BarCodee.Text = ""; Grossamount.Text = ""; GrossamountReff = Grossamount; dataGrid1.ItemsSource = ListGrid; ListGridRef = dataGrid1; textBox7.Text = ""; CustomerMainReff = textBox6; textBox.Text = ""; VatMainReff = textBox; netamount.Text = ""; NetAmountMainReff = netamount; //textBox2.Text = ""; //ItemMainReff = textBox2; //textBox9.Text = ""; //ItemSearchMainReff = textBox9;ItemTotalMainReff textBox5.Text = ""; ItemTotalMainReff = textBox5; //textBox6.Text = ""; BussLocationMainReff = textBox8; textBox3.Text = ""; DiscountMainReff = textBox3; //textBox3_Copy1.Text = ""; //SaleUnitRef = textBox3_Copy1; textBlock3.Text = ""; BusinessLocName = textBlock3; textBlock21.Text = ""; BusinessAddress = textBlock21; timer.Interval = Interval; timer.Tick += timer_Tick; timer.Start(); }