有关数据绑定有关问题的求教
有关数据绑定问题的求教
使用情景:存在一个32位的数据,且每一位可设,我使用如下数组
使用情景:存在一个32位的数据,且每一位可设,我使用如下数组
class IO_Value_32Bit :INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(string changedValue)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(changedValue));
}
}
public UInt32 io_value = 0;
private const UInt32 bit0 = 0x00000001;
private const UInt32 bit1 = 0x00000002;
private const UInt32 bit2 = 0x00000004;
private const UInt32 bit3 = 0x00000008;
private const UInt32 bit4 = 0x00000010;
private const UInt32 bit5 = 0x00000020;
private const UInt32 bit6 = 0x00000040;
private const UInt32 bit7 = 0x00000080;
private const UInt32 bit8 = 0x00000100;
private const UInt32 bit9 = 0x00000200;
private const UInt32 bit10 = 0x00000400;
private const UInt32 bit11 = 0x00000800;
private const UInt32 bit12 = 0x00001000;
private const UInt32 bit13 = 0x00002000;
private const UInt32 bit14 = 0x00004000;
private const UInt32 bit15 = 0x00008000;
private const UInt32 bit16 = 0x00010000;
private const UInt32 bit17 = 0x00020000;
private const UInt32 bit18 = 0x00040000;
private const UInt32 bit19 = 0x00080000;
private const UInt32 bit20 = 0x00100000;
private const UInt32 bit21 = 0x00200000;
private const UInt32 bit22 = 0x00400000;
private const UInt32 bit23 = 0x00800000;
private const UInt32 bit24 = 0x01000000;
private const UInt32 bit25 = 0x02000000;
private const UInt32 bit26 = 0x04000000;
private const UInt32 bit27 = 0x08000000;
private const UInt32 bit28 = 0x10000000;
private const UInt32 bit29 = 0x20000000;
private const UInt32 bit30 = 0x40000000;
private const UInt32 bit31 = 0x80000000;
public bool BIT0
{
set
{
if(value == true){io_value |= bit0 ;}
else {io_value &= ~bit0;}
NotifyPropertyChanged(value.ToString());
}
get
{
if((io_value & bit0) != 0) {return true;}