Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make some internal/private sdk classes public and extensible #4

Open
kirsan31 opened this issue Dec 10, 2022 · 4 comments
Open

Make some internal/private sdk classes public and extensible #4

kirsan31 opened this issue Dec 10, 2022 · 4 comments

Comments

@kirsan31
Copy link

  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.
@kirsan31
Copy link
Author

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 🤔😳

@kirsan31
Copy link
Author

kirsan31 commented Jun 13, 2023

Is there any hope this could happen? At least point 1? 🙏
/cc @KlausLoeffelmann

@KlausLoeffelmann
Copy link
Member

KlausLoeffelmann commented Sep 11, 2023

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.

@kirsan31
Copy link
Author

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants