Example #1
0
        public EditProdusVM(produse item)
        {
            Cancel = new RelayCommand(OnCancel);
            Save   = new RelayCommand(OnSave);

            Item = item;
        }
Example #2
0
        public EditProdus(produse item)
        {
            InitializeComponent();

            var vm = new EditProdusVM(item);

            vm.CloseAction = new Action <bool>((result) => this.DialogResult = result);

            this.DataContext = vm;
        }
Example #3
0
        private void OnAdd()
        {
            var item = new produse();
            var dlg  = new EditProdus(item);

            if (dlg.ShowDialog() == true)
            {
                Utils.Ctx.produses.Add(item);
                Utils.Ctx.SaveChanges();
                RaisePropertyChanged("Items");
            }
        }