Ejemplo n.º 1
0
        public Edit_GoodVM(Edit_Goods ownerEditGoods)
        {
            _good     = GoodVM.Instance;
            _edtGoods = ownerEditGoods;

            if (_good.SelectedGoods != null && _good.SelectedTypeOfGoods != null)
            {
                _edtGoods.Kategoria_tb.IsEnabled  = false;
                _edtGoods.Kategoria_btn.IsEnabled = false;

                _edtGoods.Price_tb.IsEnabled  = true;
                _edtGoods.Name_tb.IsEnabled   = true;
                _edtGoods.Count_tb.IsEnabled  = true;
                _edtGoods.Goods_btn.IsEnabled = true;

                GoodName  = _good.SelectedGoods.GoodName;
                GoodPrice = _good.SelectedGoods.GoodPrice;
                GoodCount = _good.SelectedGoods.Count;
            }
            else if (_good.SelectedTypeOfGoods != null)
            {
                _edtGoods.Price_tb.IsEnabled  = false;
                _edtGoods.Name_tb.IsEnabled   = false;
                _edtGoods.Count_tb.IsEnabled  = false;
                _edtGoods.Goods_btn.IsEnabled = false;

                _edtGoods.Kategoria_tb.IsEnabled  = true;
                _edtGoods.Kategoria_btn.IsEnabled = true;


                GoodKategoria = _good.SelectedTypeOfGoods.TypeGoods;
            }
        }
Ejemplo n.º 2
0
 public GoodVM()
 {
     Instance = this;
 }
Ejemplo n.º 3
0
 public Good()
 {
     InitializeComponent();
     goods       = new GoodVM();
     DataContext = goods;
 }