-
Notifications
You must be signed in to change notification settings - Fork 86
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
[DevTools] Copy Selector replace Clr Namespace with xmlns #448
Comments
Probably better to just ignore namespace, so IDE can autocomplete it. As otherwise we don't really have this information in runtime, I don't think so. |
IAvaloniaXamlIlXmlNamespaceInfoProvider can be used. But at the moment I haven't found a way to access the TopLevel's IServiceProvider through the DevTools. @maxkatz6 Do you have any idea how to do it? |
It will tell namespace information only for current XAML file. Not where this control was defined. |
I think that's right. I was thinking that instead of |
It would have to be saved for every single control, since devtools has no way to know where a control was defined. |
I would like to define an interface similar to this: interface IDevToolsNamespaceInfoProvider
{
string? GetXmlNamespaceFromType(Type type);
} The source generator will implement this interface for each When I just know it's not perfect. It cannot retrieve the namespace of second-level dependencies, but this solution is simple to implement. another possibility could be to using reference assemblies where there would be additional metadata with information on namspaces. This solution would also solve the problem of retrieving third-party control dependency information because the reference assemblies would be distributed in the nuget package. |
How would it help with situation, when selector is copied into another file with different namespaces? That's why I think it might be the easiest to skip them and allow IDE extension to handle that. |
Cecil task has some information, which could be aggregated and loosely used in devtools. I.e. emit an extra class that would return an enumerable of all IAvaloniaXamlIlXmlNamespaceInfoProvider in the assembly. Or you actually already can do it via reflection to get all types with IAvaloniaXamlIlXmlNamespaceInfoProvider. Since dev tools are usually used in Debug with no trimming. |
Can someone move this issue to Avalonia VS? |
@workgroupengineering transferred as requested |
Is your feature request related to a problem? Please describe.
Speed up writing a Style Selector.
When Copy Selector using [DevTools] treeview context menu, it put text like this in clipboard:
FluentAvalonia.UI.Controls.NavigationView#NavView.Store /template/ Avalonia.Controls.ScrollViewer#FooterItemsScrollViewer
Describe the solution you'd like
When Copy Selector using [DevTools] treeview context menu it put text like this in clipboard:
ui|NavigationView#NavView.Store /template/ ScrollViewer#FooterItemsScrollViewer
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: