Exemplo n.º 1
0
        private void NewItemCommandProc(Object o)
        {
            NewItemWindow newItemWindow = WindowsUI.ShowWindowDialogEx <NewItemWindow>();

            if (newItemWindow.DialogResult == true)
            {
                ItemTypeExtended newItem = ItemTypeExtended.GetItemTypeAsItemClassExtended(
                    ((NewItemVM)(newItemWindow.DataContext)).Model.NewItem
                    );

                // Update item
                TestItems.Add(
                    newItem
                    );
            }
        }
Exemplo n.º 2
0
        private void ModifyItemCommandProc(Object selectedItems)
        {
            ItemTypeExtended selectedItem = (ItemTypeExtended)((ObservableCollection <object>)selectedItems).FirstOrDefault();

            if (selectedItem == null)
            {
                return;
            }

            // Show window
            EditItemWindow editItemWindow = WindowsUI.ShowWindowDialogEx <EditItemWindow>(selectedItem);

            if (editItemWindow.DialogResult == true)
            {
                ItemTypeExtended currentItem = ItemTypeExtended.GetItemTypeAsItemClassExtended(
                    ((EditItemVM)(editItemWindow.DataContext)).Model.CurrentItem
                    );

                // Update item
                TestItems.Update(selectedItem, currentItem);
            }
        }