class Book {
public string Name { get; set; }
public string Author { get; set; }
public decimal Price { get; set; }
public int YearPublished { get; set; }
}
平平淡淡才是真(1020684770) 9:02:02
<Button FontSize="20">
<local:Book Name="Windows Internals"
Author="Mark Russinovich" Price="40"
YearPublished="2009" />
</Button>
wpf 4.5 的新特性
public string Name { get; set; }
public string Author { get; set; }
public decimal Price { get; set; }
public int YearPublished { get; set; }
}
平平淡淡才是真(1020684770) 9:02:02
<Button FontSize="20">
<local:Book Name="Windows Internals"
Author="Mark Russinovich" Price="40"
YearPublished="2009" />
</Button>
wpf 4.5 的新特性
给book 类重写tostring()
public override string ToString() {
return string.Format("{0} by {1}\nPublished {2}", Name,
Author, YearPublished);
}
public override string ToString() {
return string.Format("{0} by {1}\nPublished {2}", Name,
Author, YearPublished);
}