ReserviorControl.xaml.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using MECF.Framework.Common.ProcessCell;
  2. using MECF.Framework.Common.Reservior;
  3. using PunkHPX8_Core;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Imaging;
  16. using System.Windows.Navigation;
  17. using System.Windows.Shapes;
  18. namespace PunkHPX8_Themes.UserControls
  19. {
  20. /// <summary>
  21. /// ReserviorControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class ReserviorControl : UserControl
  24. {
  25. public ReserviorControl()
  26. {
  27. InitializeComponent();
  28. }
  29. public static readonly DependencyProperty ReserviorWidthProperty = DependencyProperty.Register("ReserviorWidth", typeof(int), typeof(ReserviorControl));
  30. /// <summary>
  31. /// 宽度
  32. /// </summary>
  33. public int ReserviorWidth
  34. {
  35. get
  36. {
  37. return (int)this.GetValue(ReserviorWidthProperty);
  38. }
  39. set
  40. {
  41. this.SetValue(ReserviorWidthProperty, value);
  42. }
  43. }
  44. public static readonly DependencyProperty ReserviorNameProperty = DependencyProperty.Register("ReserviorName", typeof(string), typeof(ReserviorControl));
  45. /// <summary>
  46. /// 名称
  47. /// </summary>
  48. public string ReserviorName
  49. {
  50. get
  51. {
  52. return (string)this.GetValue(ReserviorNameProperty);
  53. }
  54. set
  55. {
  56. this.SetValue(ReserviorNameProperty, value);
  57. }
  58. }
  59. public static readonly DependencyProperty ReserviorInfoProperty = DependencyProperty.Register("ReserviorInfo", typeof(ReserviorInfo), typeof(ReserviorControl),
  60. new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
  61. /// <summary>
  62. /// Reservior对象
  63. /// </summary>
  64. public ReserviorInfo ReserviorInfo
  65. {
  66. get
  67. {
  68. return (ReserviorInfo)this.GetValue(ReserviorInfoProperty);
  69. }
  70. set
  71. {
  72. this.SetValue(ReserviorInfoProperty, value);
  73. }
  74. }
  75. private void Canvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  76. {
  77. GlobalEvents.OnSwitchFixedTabItem("HardWare", "Reservoirs", $"{ReserviorName}");
  78. }
  79. }
  80. }