RecipeNameDialog.xaml.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using MECF.Framework.Common.CommonData;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  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. /// RecipeNameDialog.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class RecipeNameDialog : Window, INotifyPropertyChanged
  23. {
  24. #region 内部变量
  25. private string _recipeName;
  26. private string _recipeDescription;
  27. public event PropertyChangedEventHandler PropertyChanged;
  28. #endregion
  29. #region 属性
  30. public string RecipeName
  31. {
  32. get { return _recipeName; }
  33. set
  34. {
  35. _recipeName = value;
  36. InvokePropertyChanged(nameof(RecipeName));
  37. }
  38. }
  39. public string RecipeDescription
  40. {
  41. get { return _recipeDescription; }
  42. set
  43. {
  44. _recipeDescription = value;
  45. InvokePropertyChanged(nameof(RecipeDescription));
  46. }
  47. }
  48. #endregion
  49. public RecipeNameDialog()
  50. {
  51. InitializeComponent();
  52. }
  53. private void InvokePropertyChanged(string propertyName)
  54. {
  55. if (PropertyChanged != null)
  56. {
  57. PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  58. }
  59. }
  60. private void Button_Click(object sender, RoutedEventArgs e)
  61. {
  62. this.DialogResult = true;
  63. this.Close();
  64. }
  65. }
  66. }