终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Silo.xaml.cs 1.8 KiB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace WPFDemo
  17. {
  18. /// <summary>
  19. /// Silo.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class Silo : UserControl, INotifyPropertyChanged
  22. {
  23. public string Index
  24. {
  25. get { return (string)GetValue(IndexProperty); }
  26. set { SetValue(IndexProperty, value);
  27. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Index"));
  28. }
  29. }
  30. // Using a DependencyProperty as the backing store for Index. This enables animation, styling, binding, etc...
  31. public static readonly DependencyProperty IndexProperty =
  32. DependencyProperty.Register("Index", typeof(string), typeof(Silo), new PropertyMetadata("Unkown"));
  33. public string Caption
  34. {
  35. get { return (string)GetValue(CaptionProperty); }
  36. set { SetValue(CaptionProperty, value);
  37. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Caption"));
  38. }
  39. }
  40. // Using a DependencyProperty as the backing store for Caption. This enables animation, styling, binding, etc...
  41. public static readonly DependencyProperty CaptionProperty =
  42. DependencyProperty.Register("Caption", typeof(string), typeof(Silo), new PropertyMetadata("Null"));
  43. public Silo()
  44. {
  45. InitializeComponent();
  46. }
  47. public event PropertyChangedEventHandler? PropertyChanged;
  48. }
  49. }