RecipeHeaderViewModel.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using FurnaceUI.Models;
  2. using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
  3. using System.Windows;
  4. namespace FurnaceUI.Views.Editors
  5. {
  6. public class RecipeHeaderViewModel : FurnaceUIViewModelBase
  7. {
  8. public bool IsSave { get; set; }
  9. public RecipeHeaderViewModel()
  10. {
  11. }
  12. public Combination CombinationData { get; set; } = new Combination();
  13. public bool IsEnable => CGlobal.RecipeProcessEditViewEnable;//是否是View模式
  14. public string RecipeType { get; set; }
  15. private string _cmbN2Purge;
  16. public string CmbN2Purge
  17. {
  18. get => _cmbN2Purge;
  19. set
  20. {
  21. _cmbN2Purge = value;
  22. NotifyOfPropertyChange(nameof(CmbN2Purge));
  23. }
  24. }
  25. protected override void OnViewLoaded(object view)
  26. {
  27. base.OnViewLoaded(view);
  28. LoadData();
  29. }
  30. private void LoadData()
  31. {
  32. if (CombinationData != null)
  33. {
  34. CmbN2Purge = CombinationData.N2PurgeMode;
  35. }
  36. }
  37. public void TempSetSave()
  38. {
  39. IsSave = true;
  40. if (CombinationData != null)
  41. {
  42. CombinationData.N2PurgeMode = CmbN2Purge;
  43. }
  44. ((Window)GetView()).DialogResult = true;
  45. }
  46. public void TempSetCancel()
  47. {
  48. IsSave = false;
  49. ((Window)GetView()).DialogResult = false;
  50. }
  51. }
  52. }