using System; using System.Collections.Generic; using System.Linq; using System.Text; 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.Shapes; using System.ComponentModel; namespace WpfApplication1 { /// /// Window5.xaml 的交互逻辑 /// public partial class Window5 : Window, INotifyPropertyChanged { private double percent=1; public double Percent { get { return percent; } set { if (percent != value) { percent = value; NotifyPropertyChanged("Percent"); } } } public Window5() { InitializeComponent(); this.DataContext = this; } protected void NotifyPropertyChanged(string propertyname) { if (PropertyChanged != null) { PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyname)); } } public event PropertyChangedEventHandler PropertyChanged; } }