RefreshPropertiesAttribute not working

  • Thread starter Thread starter Clive Dixon
  • Start date Start date
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;
}
 
I think there's a VS 2005 bug here where a property is reimplemented with
"new". If I rename my re-implemented property to OwnerDraw2 (without the
"new"), then the refresh behaviour between the two properties works as
expected.
 
Back
Top