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; } }
public void EditGood(object obj) { Edit_Goods editGood = new Edit_Goods(); editGood.ShowDialog(); }