Exemplo n.º 1
0
 public MainViewModel(IMessageBoxService messageBoxService)
 {
     if (messageBoxService == null)
     {
         throw new ArgumentNullException(nameof(messageBoxService));
     }
     _messageBoxService = messageBoxService;
     _items             = new OrderedListViewModel <ItemViewModel>(
         //() => new ItemViewModel(),
         () => null,
         addedAction: item => Console.WriteLine($"Item '{item?.Text}' added"),
         deleted: item => _messageBoxService.Show($"Delete '{item.Text}'", button: MessageBoxButton.YesNo) == MessageBoxResult.Yes)
     {
         new ItemViewModel()
         {
             Value = 1, Text = "One"
         },
         new ItemViewModel()
         {
             Value = 2, Text = "Two"
         },
         new ItemViewModel()
         {
             Value = 3, Text = "Three"
         },
         new ItemViewModel()
         {
             Value = 4, Text = "Four"
         },
         new ItemViewModel()
         {
             Value = 5, Text = "Five"
         }
     };
 }
Exemplo n.º 2
0
        public ActionResult Orders(int id)
        {
            OrderedListViewModel model = new OrderedListViewModel()
            {
                Ordereds = _orderedService.GetAll().Where(x => x.CustomerID == id).OrderByDescending(x => x.OrderDate).ToList()
            };

            return(View(model));
        }
Exemplo n.º 3
0
 public MainViewModel(IMessageBoxService messageBoxService)
 {
     if (messageBoxService == null) throw new ArgumentNullException(nameof(messageBoxService));
     _messageBoxService = messageBoxService;
     _items = new OrderedListViewModel<ItemViewModel>(
         //() => new ItemViewModel(),
         () => null,
         addedAction: item => Console.WriteLine($"Item '{item?.Text}' added"),
         deleted: item => _messageBoxService.Show($"Delete '{item.Text}'", button:MessageBoxButton.YesNo) == MessageBoxResult.Yes)
     {
         new ItemViewModel() {Value = 1, Text = "One"},
         new ItemViewModel() {Value = 2, Text = "Two"},
         new ItemViewModel() {Value = 3, Text = "Three"},
         new ItemViewModel() {Value = 4, Text = "Four"},
         new ItemViewModel() {Value = 5, Text = "Five"}
     };
 }
Exemplo n.º 4
0
        public Function(IVplServiceContext context, Guid functionId)
        {
            if (context == null) throw new ArgumentNullException(nameof(context));

            _context = context;
            _functionId = functionId;

            _arguments = new OrderedListViewModel<IArgument>(
                CreateArgument,
                deleted: DeleteArgument,
                addedAction: ArgumentAdded);

            _elements = new Elements(this);

            UndoCommand = new RelayCommand(Undo, _undoService.CanUndo);
            RedoCommand = new RelayCommand(Redo, _undoService.CanRedo);
            CopyCommand = new RelayCommand(Copy, CanCopy);
            CutCommand = new RelayCommand(Cut, CanCut);
            PasteCommand = new RelayCommand(Paste, CanPaste);
            SelectAllCommand = new RelayCommand(SelectAll);
            
        }
Exemplo n.º 5
0
        public Function(IVplServiceContext context, Guid functionId)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            _context    = context;
            _functionId = functionId;

            _arguments = new OrderedListViewModel <IArgument>(
                CreateArgument,
                deleted: DeleteArgument,
                addedAction: ArgumentAdded);

            _elements = new Elements(this);

            UndoCommand      = new RelayCommand(Undo, _undoService.CanUndo);
            RedoCommand      = new RelayCommand(Redo, _undoService.CanRedo);
            CopyCommand      = new RelayCommand(Copy, CanCopy);
            CutCommand       = new RelayCommand(Cut, CanCut);
            PasteCommand     = new RelayCommand(Paste, CanPaste);
            SelectAllCommand = new RelayCommand(SelectAll);
        }