C
Clive Dixon
Anybody any idea why RefreshPropertiesAttribute is not working in the
following scenario?:
class MyListView : ListView
{
// Reimplementation of OwnerDraw to allow for changing the OtherFlag
property
[DefaultValue(false)]
[RefreshProperties(RefreshProperties.All)]
public new bool OwnerDraw
{
get
{
return base.OwnerDraw;
}
set
{
base.OwnerDraw = value;
if (!value)
{
otherFlag = false;
}
}
}
// Some other flag which can only be true if OwnerDraw is true.
// Therefore if OwnerDraw is set to false we want to set this to false;
// conversely if we set this to true we want to set OwnerDraw to true.
[DefaultValue(false)]
[RefreshProperties(RefreshProperties.All)]
public bool OtherFlag
{
get
{
return otherFlag;
}
set
{
otherFlag = value;
if (value)
{
base.OwnerDraw = true;
}
}
}
private bool otherFlag;
}
following scenario?:
class MyListView : ListView
{
// Reimplementation of OwnerDraw to allow for changing the OtherFlag
property
[DefaultValue(false)]
[RefreshProperties(RefreshProperties.All)]
public new bool OwnerDraw
{
get
{
return base.OwnerDraw;
}
set
{
base.OwnerDraw = value;
if (!value)
{
otherFlag = false;
}
}
}
// Some other flag which can only be true if OwnerDraw is true.
// Therefore if OwnerDraw is set to false we want to set this to false;
// conversely if we set this to true we want to set OwnerDraw to true.
[DefaultValue(false)]
[RefreshProperties(RefreshProperties.All)]
public bool OtherFlag
{
get
{
return otherFlag;
}
set
{
otherFlag = value;
if (value)
{
base.OwnerDraw = true;
}
}
}
private bool otherFlag;
}