ButterflyValve.xaml.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace CyberX8_Themes.UserControls
  16. {
  17. /// <summary>
  18. /// ButterflyValve.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class ButterflyValve : UserControl
  21. {
  22. public ButterflyValve()
  23. {
  24. InitializeComponent();
  25. }
  26. public static readonly DependencyProperty RotateTransformValueProperty = DependencyProperty.Register(
  27. "RotateTransformValue", typeof(int), typeof(ButterflyValve));
  28. public int RotateTransformValue
  29. {
  30. get { return (int)this.GetValue(RotateTransformValueProperty); }
  31. set { this.SetValue(RotateTransformValueProperty, value); }
  32. }
  33. public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register(
  34. "IsOpen", typeof(bool), typeof(ButterflyValve));
  35. public bool IsOpen
  36. {
  37. get
  38. {
  39. return (bool)this.GetValue(IsOpenProperty);
  40. }
  41. set
  42. {
  43. if (value == true)
  44. {
  45. border1.Background = Brushes.Gray;
  46. }
  47. else
  48. {
  49. border1.Background = Brushes.LimeGreen;
  50. }
  51. this.SetValue(IsOpenProperty, value);
  52. }
  53. }
  54. }
  55. }