UserOutOKRegionViewModel.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using PDF_Master.Helper;
  2. using Prism.Commands;
  3. using Prism.Mvvm;
  4. using Prism.Regions;
  5. using Prism.Services.Dialogs;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows;
  12. using System.Windows.Threading;
  13. namespace PDF_Master.ViewModels.Dialog.ServiceDialog
  14. {
  15. public class UserOutOKRegionViewModel : BindableBase, INavigationAware
  16. {
  17. private UserDialogViewModel UserDialogViewModel;
  18. public IDialogService dialogs;
  19. #region 文案
  20. private string _Text_useroutok = "";
  21. public string Text_useroutok
  22. {
  23. get { return _Text_useroutok; }
  24. set
  25. {
  26. SetProperty(ref _Text_useroutok, value);
  27. }
  28. }
  29. private string _Text_useroutoktext = "";
  30. public string Text_useroutoktext
  31. {
  32. get { return _Text_useroutoktext; }
  33. set
  34. {
  35. SetProperty(ref _Text_useroutoktext, value);
  36. }
  37. }
  38. private string _Text_ok = "";
  39. public string Text_ok
  40. {
  41. get { return _Text_ok; }
  42. set
  43. {
  44. SetProperty(ref _Text_ok, value);
  45. }
  46. }
  47. private void InitString()
  48. {
  49. Text_useroutok = App.ServiceLoader.GetString("Text_useroutok");
  50. Text_useroutoktext = App.ServiceLoader.GetString("Text_useroutoktext");
  51. Text_ok = App.ServiceLoader.GetString("Text_ok");
  52. }
  53. #endregion
  54. public bool IsNavigationTarget(NavigationContext navigationContext)
  55. {
  56. return true;
  57. }
  58. public void OnNavigatedFrom(NavigationContext navigationContext)
  59. {
  60. }
  61. public void OnNavigatedTo(NavigationContext navigationContext)
  62. {
  63. navigationContext.Parameters.TryGetValue<UserDialogViewModel>("UserDialogViewModel", out UserDialogViewModel);
  64. }
  65. public DelegateCommand UserGetokCommand { get; set; }
  66. public UserOutOKRegionViewModel(IRegionManager regionManager, IDialogService dialogService)
  67. {
  68. dialogs = dialogService;
  69. UserGetokCommand = new DelegateCommand(UserGetok);
  70. InitString();
  71. }
  72. private void UserGetok()
  73. {
  74. UserDialogViewModel.Close();
  75. }
  76. }
  77. }