RecipeConditionCheckConModeViewModel.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using FurnaceUI.Models;
  8. namespace FurnaceUI.Views.Editors
  9. {
  10. public class RecipeConditionCheckConModeViewModel : FurnaceUIViewModelBase
  11. {
  12. public string SelectControlMode { get; set; }
  13. public bool IsSave { get; set; } = false;
  14. public bool IsEnable => CGlobal.RecipeProcessEditViewEnable;//是否是View模式
  15. public bool IsInnerControlChecked { get; set; }
  16. public bool IsOutControlChecked { get; set; }
  17. protected override void OnInitialize()
  18. {
  19. base.OnInitialize();
  20. IsInnerControlChecked = SelectControlMode == "Inner Control";
  21. IsOutControlChecked = !IsInnerControlChecked;
  22. }
  23. public void SelectControlCmd(object cmdName)
  24. {
  25. SelectControlMode = cmdName.ToString();
  26. }
  27. public void Close()
  28. {
  29. IsSave = false;
  30. ((Window)GetView())?.Close();
  31. }
  32. public void Accept()
  33. {
  34. IsSave = true;
  35. ((Window)GetView())?.Close();
  36. }
  37. }
  38. }