HouseInfoUserControl.xaml.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using ivf_tl_CustomControls;
  2. using ivf_tl_Entity.Entity.balance;
  3. using System;
  4. using System.Collections.Generic;
  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 ivf_tl_Manage.UserControls
  18. {
  19. /// <summary>
  20. /// HouseInfoUserControl.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class HouseInfoUserControl : UserControl
  23. {
  24. public HouseInfoUserControl()
  25. {
  26. InitializeComponent();
  27. IsEnabledChanged -= HouseInfoUserControl_IsEnabledChanged;
  28. IsEnabledChanged += HouseInfoUserControl_IsEnabledChanged;
  29. }
  30. private void HouseInfoUserControl_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
  31. {
  32. if (IsEnabled)
  33. {
  34. this.maskHouse.Opacity = 0;
  35. }
  36. else
  37. {
  38. this.maskHouse.Opacity = 0.2;
  39. }
  40. }
  41. public int HouseSn
  42. {
  43. get { return (int)GetValue(HouseSnProperty); }
  44. set { SetValue(HouseSnProperty, value); }
  45. }
  46. // Using a DependencyProperty as the backing store for HouseSn. This enables animation, styling, binding, etc...
  47. public static readonly DependencyProperty HouseSnProperty =
  48. DependencyProperty.Register("HouseSn", typeof(int), typeof(HouseInfoUserControl), new PropertyMetadata(1));
  49. /// <summary>
  50. /// 0离线 1在线 2解绑 3待初始化
  51. /// </summary>
  52. public int State
  53. {
  54. get { return (int)GetValue(StateProperty); }
  55. set { SetValue(StateProperty, value); }
  56. }
  57. // Using a DependencyProperty as the backing store for State. This enables animation, styling, binding, etc...
  58. public static readonly DependencyProperty StateProperty =
  59. DependencyProperty.Register("State", typeof(int), typeof(HouseInfoUserControl), new PropertyMetadata(1));
  60. public House HouseSource
  61. {
  62. get { return (House)GetValue(HouseSourceProperty); }
  63. set { SetValue(HouseSourceProperty, value); }
  64. }
  65. // Using a DependencyProperty as the backing store for HouseSource. This enables animation, styling, binding, etc...
  66. public static readonly DependencyProperty HouseSourceProperty =
  67. DependencyProperty.Register("HouseSource", typeof(House), typeof(HouseInfoUserControl), new PropertyMetadata(new House()));
  68. }
  69. }