WelcomeViewModel.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using System;
  2. using System.Net;
  3. using System.Windows;
  4. using System.Windows.Controls;
  5. using System.Windows.Documents;
  6. using System.Windows.Ink;
  7. using System.Windows.Input;
  8. using System.Windows.Media;
  9. using System.Windows.Media.Animation;
  10. using System.Windows.Shapes;
  11. using VocabManager.Command;
  12. namespace VocabManager.ViewModel
  13. {
  14. public class WelcomeViewModel : ViewModelBase
  15. {
  16. public string Title
  17. {
  18. get
  19. {
  20. return "Vocab Manager";
  21. }
  22. }
  23. #region Start App
  24. RelayCommand _startAppCommand;
  25. public ICommand StartAppCommand
  26. {
  27. get
  28. {
  29. if (_startAppCommand == null)
  30. {
  31. _startAppCommand = new RelayCommand(
  32. param => this.StartApp(),
  33. param => this.CanStart()
  34. );
  35. }
  36. return _startAppCommand;
  37. }
  38. }
  39. private bool CanStart()
  40. {
  41. return true;
  42. }
  43. private void StartApp()
  44. {
  45. App.Instance.MainPage.LoadDeckListView();
  46. }
  47. #endregion
  48. #region ShowHelp
  49. RelayCommand _showHelpCommand;
  50. public ICommand ShowHelpCommand
  51. {
  52. get
  53. {
  54. if (_showHelpCommand == null)
  55. {
  56. _showHelpCommand = new RelayCommand(
  57. param => this.ShowHelp(),
  58. param => this.CanShowHelp()
  59. );
  60. }
  61. return _showHelpCommand;
  62. }
  63. }
  64. private bool CanShowHelp()
  65. {
  66. return true;
  67. }
  68. private void ShowHelp()
  69. {
  70. App.Instance.MainPage.LoadHelpView();
  71. }
  72. #endregion
  73. #region ShowAbout
  74. RelayCommand _showAboutCommand;
  75. public ICommand ShowAboutCommand
  76. {
  77. get
  78. {
  79. if (_showAboutCommand == null)
  80. {
  81. _showAboutCommand = new RelayCommand(
  82. param => this.ShowAbout(),
  83. param => this.CanShowAbout()
  84. );
  85. }
  86. return _showAboutCommand;
  87. }
  88. }
  89. private bool CanShowAbout()
  90. {
  91. return true;
  92. }
  93. private void ShowAbout()
  94. {
  95. App.Instance.MainPage.LoadAboutView();
  96. }
  97. #endregion
  98. }
  99. }