终端一体化运控平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

60 rader
1.7 KiB

  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 BPASmartClient.CustomResource.UserControls
  16. {
  17. /// <summary>
  18. /// Pipeline.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class Pipeline : UserControl
  21. {
  22. public Pipeline()
  23. {
  24. InitializeComponent();
  25. }
  26. private int _direction = 1;
  27. /// <summary>
  28. /// 液体流向,接受1和2两个值
  29. /// </summary>
  30. public int Direction
  31. {
  32. get { return _direction; }
  33. set
  34. {
  35. _direction = value;
  36. VisualStateManager.GoToState(this, value == 1 ? "WEFlowState" : "EWFlowState", false);
  37. }
  38. }
  39. public Brush LiquidColor
  40. {
  41. get { return (Brush)GetValue(LiquidColorProperty); }
  42. set { SetValue(LiquidColorProperty, value); }
  43. }
  44. public static readonly DependencyProperty LiquidColorProperty =
  45. DependencyProperty.Register("LiquidColor", typeof(Brush), typeof(Pipeline), new PropertyMetadata(Brushes.Orange));
  46. public int CapRadius
  47. {
  48. get { return (int)GetValue(CapRadiusProperty); }
  49. set { SetValue(CapRadiusProperty, value); }
  50. }
  51. public static readonly DependencyProperty CapRadiusProperty =
  52. DependencyProperty.Register("CapRadius", typeof(int), typeof(Pipeline), new PropertyMetadata(5));
  53. }
  54. }