NewFileMenuViewModel.cs 1.2 KB

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