摘要:
我们都知道,const和static readonly的确很像:通过类名而不是对象名进行访问,在程序中只读等等。在多数情况下可以混用。二者本质的区别在于,const的值是在编译期间确定的,因此只能在声明时通过常量表达式指定其值。而static readonly是在运行时计算出其值的,所以还可以通过静... 阅读全文
摘要:
1.添加托盘后发现托盘事件不能响应因此需要在主程序中添加一下代码 while (true) { Application.DoEvents(); }DoEvents会处理事件池中的事件,当然也可以另外开一个线程处理。2.查看任务... 阅读全文
摘要:
1 internal class NotifyIconHelper 2 { 3 public NotifyIconHelper() 4 { 5 NOTIFY_ICON.Icon = new Icon(Environment.Curr... 阅读全文
摘要:
1.导入dll [DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)] private static extern bool ShowWindow(IntPtr hWnd, uin... 阅读全文
摘要:
using System.ComponentModel;using System.Runtime.CompilerServices;namespace Test{ public abstract class BindableBase : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected bool SetProperty(ref T storage, T value, ... 阅读全文
摘要:
DependencyObject1.1 CLR properties are basicProperty Requirements:n Change Notificationsn Default Valuesn Type Coercionn Data Bindingn Attached Propertiesn Validationn Inheritancen Styling 1.2DependencyObject and DependencyProperty fill gaps1.3Base class of many WPF types1.4Metadatel Default valuel 阅读全文