使生效
INotifyPropertyChanged
界面,当应用程序的大小发生变化时,设置File属性值。
public PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = this.PropertyChanged;
if (handler != null)
{
var e = new PropertyChangedEventArgs(propertyName);
handler(this, e);
}
}
private String file;
public String File
{
get
{
return file;
}
set
{
file = value;
NotifyPropertyChanged("File");
}
}