static AddDatHang() { if (signleton == null) { signleton = new AddDatHang(); } }
public void add() { AddDatHang.Singleton.DatHang = this; AddDatHang.Singleton.dataGrid = dgContent; AddDatHang.Singleton.Hide(); AddDatHang.Singleton.Show(); AddDatHang.GetWindow(this).Closed += (o, ev) => { AddKho.Singleton.Close(); }; }
private AddDatHang() { InitializeComponent(); ViewModel viewModel = new ViewModel(); this.DataContext = viewModel; dgNhaCungCap.ItemsSource = Common.NhaCungCapDataTable; dgMatHang.ItemsSource = Common.MatHangDataTable; dgCTDH.ItemsSource = ctdh = new QLVTDataSet.CTDatHangDataTable(); EventHandler eventHandler = (o, i) => { signleton = new AddDatHang(); }; this.Closed += eventHandler; //viewModel.NhaCungCap = dgNhaCungCap.SelectedValue; //viewModel.ChiTietDatHang = dgCTDH.SelectedValue; }