microsoft/winforms-designer-extensibility

Make some internal/private sdk classes public and extensible

kirsan31 opened this issue ยท 4 comments

  1. We have two (may be more?) internal classes: Microsoft.DotNet.DesignTools.Client.Proxies.ProxyPropertyDescriptor and Microsoft.DotNet.DesignTools.Protocol.PropertyData. It would very useful to make them public, I will explain with a concrete example from chart control (I think it's all clear from comments and code). The code from protected override void ShowHelp(). GetPropValue is my extension method to get property value with reflection:
GridItem item = grid.SelectedGridItem;
// Original code:
//_helpTopic = item.PropertyDescriptor.ComponentType.ToString() + "." + item.PropertyDescriptor.Name;

// We have a proxy object (Microsoft.DotNet.DesignTools.Client.Proxies.ProxyPropertyDescriptor) here as PropertyDescriptor.
// So to get real type we need get PropertyData (Microsoft.DotNet.DesignTools.Protocol.PropertyData) from PropertyDescriptor and then ComponentType from it.
// Because Microsoft.DotNet.DesignTools.Client.Proxies.ProxyPropertyDescriptor and Microsoft.DotNet.DesignTools.Protocol.PropertyData are internal we need to use reflection...
if (item.PropertyDescriptor.GetPropValue("PropertyData")?.GetPropValue("ComponentType") is Microsoft.DotNet.DesignTools.Protocol.Types.TypeIdentity typeIdentity)
    _helpTopic = typeIdentity.TypeName + "." + item.PropertyDescriptor.Name;
  1. In Microsoft.DotNet.DesignTools.Client.Editors.CollectionEditor we have two private classes: DefaultCollectionForm and DefaultViewModel. I think it would helpful to make them public with ability to extend. This should make minor modifications to the default behavior easier. I find it very costly due to minimal modification to make your own dialog like in BaseUI\DesignableCollectionEditor example.

Any response on this?

@KlausLoeffelmann can you help with similar problem please? ๐Ÿ™ The code above from CollectionEditor where we have ShowHelp method to change opening link, but how to achieve same result on control properties itself? If we press F1 here:
image

I can't find any information about it ๐Ÿค”๐Ÿ˜ณ

Is there any hope this could happen? At least point 1? ๐Ÿ™
/cc @KlausLoeffelmann

Hey Kirsan,

sorry for the late reply.

I can't consider changing the scope for the APIs right now, but we can revisit them for the next part of the SDK we're currently working on the context of the Root Designer.

Hey Kirsan,

sorry for the late reply.

I can't consider changing the scope for the APIs right now, but we can revisit them for the next part of the SDK we're currently working on the context of the Root Designer.

Yea, I know that changing scope is something hard to change after release, so hope that this will be done during preview ๐Ÿ™
At least Point 1, will let to do stuff without reflection...