Group made of unrotatable shapes... is itself rotatable!

Oct 26, 2012 at 3:45 PM


In my application I have several custom shapes which are not rotatable:

public override bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability)
    if (controlPointId == 9 && (controlPointCapability & (ControlPointCapabilities.Rotate | ControlPointCapabilities.Connect)) != 0)
        return false;
        return base.HasControlPointCapability(controlPointId, controlPointCapability);

However, if I group such shapes together, the resulting group shape becomes rotatable! In my case, this is unacceptable. How can I fix this? I guess I should somehow substitute the standard group shape with a custom one and use the same code as above in the latter, but I'm not sure.

Oct 29, 2012 at 9:27 AM

Yes, correct. Derive a custom group shape and override the HasControlPointCapability method (and hide the angle property if needed).

As far as I know, you do not provide the standard context menu items for grouping hspaes to the user, correct? In this case, it should be enough to register the new shape type and use it in your code.