I have CarouselView that has a Dictionary<string,ObservableCollection as its itemssource.
A Control is created for each string in the dictionary's keys. The Control takes in a viewmodel for the constructor.
I want to pass in the current key as a string for the constructor's argument of the view model being created. Is this possible to do with XAML and .Net MAUI?
I have tried several ways and I need to know if it is even possible.
Thank you.
Here is the XAML code
<CarouselView x:Name="lstModifierLists" x:DataType="local:SelectedItemViewModel" ItemsSource="{Binding OrderMenuItem.MenuModifierListNames.Keys}">
<CarouselView.ItemTemplate>
<DataTemplate>
<inclmod:ItemModiferCollectionControl BackgroundColor="AliceBlue" >
<x:Arguments>
<local:ItemModifierCollectionControlViewModel>
**<x:Arguments>
// I want to pass in the current item or Key of lstModifierLists Here
</x:Arguments>
** </local:ItemModifierCollectionControlViewModel>
</x:Arguments>
</inclmod:ItemModiferCollectionControl>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>