|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
-
- namespace WPFDemo
- {
- /// <summary>
- /// Silo.xaml 的交互逻辑
- /// </summary>
- public partial class Silo : UserControl, INotifyPropertyChanged
- {
-
-
- public string Index
- {
- get { return (string)GetValue(IndexProperty); }
- set { SetValue(IndexProperty, value);
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Index"));
- }
- }
-
- // Using a DependencyProperty as the backing store for Index. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty IndexProperty =
- DependencyProperty.Register("Index", typeof(string), typeof(Silo), new PropertyMetadata("Unkown"));
-
-
-
- public string Caption
- {
- get { return (string)GetValue(CaptionProperty); }
- set { SetValue(CaptionProperty, value);
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Caption"));
- }
- }
-
- // Using a DependencyProperty as the backing store for Caption. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty CaptionProperty =
- DependencyProperty.Register("Caption", typeof(string), typeof(Silo), new PropertyMetadata("Null"));
-
-
- public Silo()
- {
- InitializeComponent();
- }
-
- public event PropertyChangedEventHandler? PropertyChanged;
- }
- }
|