摘要:private bool _isBusy = false; public bool IsBusy { get { return _isBusy; } internal set { _isBusy = value; base.RaisePropertyChanged("IsBusy"); } }注意:在这里必须设定 internal set才可以。。测试可行XMAL:<my:BusyIndicator x:Name="busyindicator" IsBusy="{Binding IsBusy}" HorizontalAlignm
阅读全文
摘要:When building your Silverlight project fails with the error message “Whitespace is not allowed after end of Markup Extension.”, you’ve got a blank (or more) behind a databinding expression, like here:1<Button Content="{StaticResource ResText_SaveButton} "/>注意:引号前是没有空格的
阅读全文
摘要:public class VMInfoViewModel: INotifyPropertyChanged { private string strAccountName = ""; private string strVMName = "SSP"; private VMInfoContext _context; public event PropertyChangedEventHandler PropertyChanged; public void RaisePropertyChanged(string propertyName) { if (this.
阅读全文
摘要:c# An unhandled exception of type 'System.StackOverflowException' occurred in ClientPortal最近发现的一个bug,找了一下,发现原来是property set bug, //硬盘大小总和 public int Vm_TotalHardDisksQty { get { return vm_TotalHardDisksQty; } set { Vm_TotalHardDisksQty = value; } Vm_TotalHardDisksQty to vm_TotalHardDisksQty,
阅读全文
摘要:用于从派生类调用基类的方法:要编写base.<methodNam>()class customerAccout{public virtual decimal calculateprice(){//implementation}}class goldAccount:customerAccout{public override decimal calculatprice(){return ...
阅读全文
摘要:把一个基类函数声明为virtual,就可以在任何派生类中重写了:class MyBaseClass{public virtual string VitualMethod(){return "virtual Method and defind in MyBaseClass";}}派生类重写基类的函数时,要使用override关键字显式声明:class MyDerivedClass:MyBassCla...
阅读全文