FlowPipeValve.xaml.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. /// FlowPipeValve.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class FlowPipeValve : UserControl
  21. {
  22. public FlowPipeValve()
  23. {
  24. InitializeComponent();
  25. }
  26. public static readonly DependencyProperty RotateTransformValueProperty = DependencyProperty.Register(
  27. "RotateTransformValue", typeof(int), typeof(FlowPipeValve));
  28. public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register(
  29. "IsOpen", typeof(bool), typeof(FlowPipeValve));
  30. public int RotateTransformValue
  31. {
  32. get { return (int)this.GetValue(RotateTransformValueProperty); }
  33. set { this.SetValue(RotateTransformValueProperty, value); }
  34. }
  35. public bool IsOpen
  36. {
  37. get
  38. {
  39. return (bool)this.GetValue(IsOpenProperty);
  40. }
  41. set
  42. {
  43. this.SetValue(IsOpenProperty, value);
  44. }
  45. }
  46. private void FlowPipeValvaeControl_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
  47. {
  48. this.IsOpen = !this.IsOpen;
  49. }
  50. }
  51. }