DialogWindowCommands.cs 820 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using GalaSoft.MvvmLight.Command;
  2. using System.Windows;
  3. namespace Muchinfo.MTPClient.Infrastructure.Windows
  4. {
  5. public class DialogWindowCommands
  6. {
  7. private static RelayCommand<Window> _closeCommand = new RelayCommand<Window>((w) =>
  8. {
  9. if (null == w) return;
  10. w.Close();
  11. });
  12. private static RelayCommand<Window> _dragMoveCommand = new RelayCommand<Window>((w) =>
  13. {
  14. if (null == w) return;
  15. try
  16. {
  17. w.DragMove();
  18. }
  19. catch { }
  20. });
  21. public static RelayCommand<Window> Close
  22. {
  23. get { return _closeCommand; }
  24. }
  25. public static RelayCommand<Window> DragMove
  26. {
  27. get { return _dragMoveCommand; }
  28. }
  29. }
  30. }