RecipeFileLoadControl.xaml.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. using MECF.Framework.Common.RecipeCenter;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace CyberX8_Themes.UserControls
  18. {
  19. /// <summary>
  20. /// RecipeFileLoadControl.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class RecipeFileLoadControl : UserControl
  23. {
  24. #region 属性
  25. public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(string), typeof(RecipeFileLoadControl),
  26. new FrameworkPropertyMetadata("Recipe", FrameworkPropertyMetadataOptions.AffectsRender));
  27. /// <summary>
  28. /// 标题
  29. /// </summary>
  30. public string Title
  31. {
  32. get
  33. {
  34. return (string)this.GetValue(TitleProperty);
  35. }
  36. set
  37. {
  38. this.SetValue(TitleProperty, value);
  39. }
  40. }
  41. public static readonly DependencyProperty RecipeLocationProperty = DependencyProperty.Register("RecipeLocation", typeof(string), typeof(RecipeFileLoadControl),
  42. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  43. public string RecipeLocation
  44. {
  45. get { return (string)this.GetValue(RecipeLocationProperty); }
  46. set { this.SetValue(RecipeLocationProperty, value); }
  47. }
  48. public static readonly DependencyProperty RecipeFileNameProperty = DependencyProperty.Register("RecipeFileName", typeof(string), typeof(RecipeFileLoadControl),
  49. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  50. public string RecipeFileName
  51. {
  52. get { return (string)this.GetValue(RecipeFileNameProperty); }
  53. set { this.SetValue(RecipeFileNameProperty, value); }
  54. }
  55. public static readonly DependencyProperty RecipeNodesProperty = DependencyProperty.Register("RecipeNodes", typeof(ObservableCollection<RecipeNode>),typeof(RecipeFileLoadControl));
  56. public ObservableCollection<RecipeNode> RecipeNodes
  57. {
  58. get { return (ObservableCollection<RecipeNode>)this.GetValue(RecipeNodesProperty); }
  59. set { this.SetValue(RecipeNodesProperty, value); }
  60. }
  61. public static readonly DependencyProperty CommandProperty = DependencyProperty.Register("OperationCommand", typeof(ICommand), typeof(RecipeFileLoadControl),
  62. new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
  63. public ICommand OperationCommand
  64. {
  65. get
  66. {
  67. return (ICommand)this.GetValue(CommandProperty);
  68. }
  69. set
  70. {
  71. this.SetValue(CommandProperty, value);
  72. }
  73. }
  74. public static readonly DependencyProperty CreateCommandProperty = DependencyProperty.Register("CreateCommand", typeof(ICommand), typeof(RecipeFileLoadControl),
  75. new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
  76. public ICommand CreateCommand
  77. {
  78. get
  79. {
  80. return (ICommand)this.GetValue(CreateCommandProperty);
  81. }
  82. set
  83. {
  84. this.SetValue(CreateCommandProperty, value);
  85. }
  86. }
  87. public static readonly DependencyProperty EditCommandProperty = DependencyProperty.Register("EditCommand", typeof(ICommand), typeof(RecipeFileLoadControl),
  88. new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
  89. public ICommand EditCommand
  90. {
  91. get
  92. {
  93. return (ICommand)this.GetValue(EditCommandProperty);
  94. }
  95. set
  96. {
  97. this.SetValue(EditCommandProperty, value);
  98. }
  99. }
  100. public static readonly DependencyProperty CreateEnableProperty = DependencyProperty.Register("CreateEnable", typeof(bool), typeof(RecipeFileLoadControl),
  101. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  102. public bool CreateEnable
  103. {
  104. get
  105. {
  106. return (bool)this.GetValue(CreateEnableProperty);
  107. }
  108. set
  109. {
  110. this.SetValue(CreateEnableProperty, value);
  111. }
  112. }
  113. public static readonly DependencyProperty EditEnableProperty = DependencyProperty.Register("EditEnable", typeof(bool), typeof(RecipeFileLoadControl),
  114. new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
  115. public bool EditEnable
  116. {
  117. get
  118. {
  119. return (bool)this.GetValue(EditEnableProperty);
  120. }
  121. set
  122. {
  123. this.SetValue(EditEnableProperty, value);
  124. }
  125. }
  126. #endregion
  127. /// <summary>
  128. /// 构造函数
  129. /// </summary>
  130. public RecipeFileLoadControl()
  131. {
  132. InitializeComponent();
  133. }
  134. }
  135. }