Open workgroupengineering opened 1 year ago
Allow Intellisense displays only the elements related to the current context
CompletionEngine
parentType
Avalonia.Metadata.ContentAttribute
parentType.ItemsType
null
Note ItemsType is set to the type of the parameter of the first non-static public method named Add obtained by traversing the type hierarchy.
ItemsType
Add
ItemsControl.ItemsPanel
ItemsControl
ListBox
ListBoxItes
Depends on PR #383 , https://github.com/AvaloniaUI/Avalonia/pull/13104
Allow Intellisense displays only the elements related to the current context
Current behavior
Expected behavior
After PR https://github.com/AvaloniaUI/Avalonia/pull/13104
How does it work
CompletionEngine
get the parent element of the current element, retrieves its type and assigning it toparentType
parentType
has a property marked withAvalonia.Metadata.ContentAttribute
, assigned its return type toparentType
.parentType.ItemsType
orparentType
to filter candidate types if they are notnull
Current issue
If an Item Type has xmlns, xmlns is not entered.Future enhancement
ItemsControl.ItemsPanel
Autocompletion ofItemsControl
derived objects with the correctItemsType
, egListBox
must proposeListBoxItes
and its derivatives.Depends on PR #383 , https://github.com/AvaloniaUI/Avalonia/pull/13104