MainWindowViewModel.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using B20UVLog.Models;
  2. using B20UVLog.Windows;
  3. using CommunityToolkit.Mvvm.ComponentModel;
  4. using CommunityToolkit.Mvvm.Input;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Collections.ObjectModel;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace B20UVLog.ViewModels
  12. {
  13. internal class MainWindowViewModel : ObservableObject
  14. {
  15. public MainWindowViewModel()
  16. {
  17. }
  18. public RelayCommand<object> MenuItemClickCommand
  19. {
  20. get => new(p => MenuItemClick(p));
  21. }
  22. private static void MenuItemClick(object p)
  23. {
  24. switch (p.ToString())
  25. {
  26. case "db":
  27. DBSet dBSet = new();
  28. dBSet.ShowDialog();
  29. break;
  30. case "plc":
  31. PLCSet pLCSet = new();
  32. pLCSet.ShowDialog();
  33. break;
  34. case "dict":
  35. DictionarySet dictSet = new();
  36. dictSet.ShowDialog();
  37. break;
  38. default:
  39. break;
  40. }
  41. }
  42. }
  43. }