NewFileMenuViewModel.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using PixiEditor.Helpers;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Diagnostics;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Input;
  10. namespace PixiEditor.ViewModels
  11. {
  12. class NewFileMenuViewModel : ViewModelBase
  13. {
  14. public RelayCommand OkCommand { get; set; }
  15. public RelayCommand CloseCommand { get; set; }
  16. public RelayCommand DragMoveCommand { get; set; }
  17. public NewFileMenuViewModel()
  18. {
  19. OkCommand = new RelayCommand(OkButton);
  20. CloseCommand = new RelayCommand(CloseWindow);
  21. DragMoveCommand = new RelayCommand(MoveWindow);
  22. }
  23. private void OkButton(object parameter)
  24. {
  25. ((Window)parameter).DialogResult = true;
  26. ((Window)parameter).Close();
  27. }
  28. private void CloseWindow(object parameter)
  29. {
  30. ((Window)parameter).DialogResult = false;
  31. base.CloseButton(parameter);
  32. }
  33. private void MoveWindow(object parameter)
  34. {
  35. base.DragMove(parameter);
  36. }
  37. }
  38. }