WatermarkCreateFileContentViewModel.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using Prism.Commands;
  2. using Prism.Mvvm;
  3. using Prism.Regions;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. namespace PDF_Office.ViewModels.EditTools.Watermark
  8. {
  9. public class WatermarkCreateFileContentViewModel : BindableBase,INavigationAware
  10. {
  11. private List<string> _opacityList = new List<string>();
  12. public List<string> OpacityList
  13. {
  14. get { return _opacityList; }
  15. set
  16. {
  17. SetProperty(ref _opacityList, value);
  18. }
  19. }
  20. public WatermarkCreateFileContentViewModel()
  21. {
  22. }
  23. private void InitOpacityList()
  24. {
  25. OpacityList.Clear();
  26. for (int temp = 0; temp < 100; temp += 10)
  27. {
  28. OpacityList.Add(temp.ToString() + " %");
  29. }
  30. }
  31. public bool IsNavigationTarget(NavigationContext navigationContext)
  32. {
  33. return true;
  34. }
  35. public void OnNavigatedFrom(NavigationContext navigationContext)
  36. {
  37. }
  38. public void OnNavigatedTo(NavigationContext navigationContext)
  39. {
  40. InitOpacityList();
  41. }
  42. }
  43. }