EDITED: included code snippet
MAUI with XAML being as verbose as it is, just curious if there is a way to write shorter syntax for converters with Generic Types. Take a look at screenshot below. I have to write that much (commented out) to achieve the desired result.
The XAML file will be very long if I use the commented out syntax for every item. And if I make the Converter class for a specific type, then I would have to write/repeat the same class multiple times for different types to achieve shorter XAML.
Current Syntax
<ImageButton.CommandParameter>
<Binding>
<Binding.Converter>
<conv:ItemToMenuItemConverter x:TypeArguments="model:Item" MyView="{x:Reference optionsLayout}" />
</Binding.Converter>
<Binding.ConverterParameter>
<x:Static>helpers:ListOption.TOGGLE</x:Static>
</Binding.ConverterParameter>
</Binding>
</ImageButton.CommandParameter>
Desired Syntax
<Image CommandParameter="{conv:ItemToMenuItemConverter Menu=TOGGLE, MyView="{x:Reference optionsLayout}"}" x:TypeArguments="model:Item" />
ItemToMenuItemConverter
is a Generic class, hence I am unable to achieve desired syntax. You can see the image now to see what the issue is.
7