I have a Collection view that needs to change a value called selectedQuantity.
This collectionview is in a Popup.
When I Tap on a number for select the quantity, the itemselected not change of color. But If I press the Save button, the quantity is saved perfectly…
I need to press two times de same number to see how the background of the selected number changes.
I dont have any style that needs two taps… Can anyone telle me why happen this?
<toolkit:Popup xmlns=”http://schemas.microsoft.com/dotnet/2021/maui”
xmlns:x=”http://schemas.microsoft.com/winfx/2009/xaml”
x:Class=”PedidosIDTShell.MVVM.Views.Popups.QuantityUpdatePopup”
xmlns:toolkit=”clr-namespace:CommunityToolkit.Maui.Views;assembly=CommunityToolkit.Maui”
CanBeDismissedByTappingOutsideOfPopup=”False”
Size=”300,400″>
<Grid
RowDefinitions=".8*,.2*"
ColumnDefinitions="*,*">
<CollectionView
Grid.ColumnSpan="2"
SelectionMode="Single"
SelectedItem="{Binding selectedQuantity}">
<CollectionView.ItemsSource>
<x:Array Type="{x:Type x:Int16}">
<x:Int16>1</x:Int16>
<x:Int16>2</x:Int16>
<x:Int16>3</x:Int16>
<x:Int16>4</x:Int16>
<x:Int16>5</x:Int16>
<x:Int16>6</x:Int16>
<x:Int16>7</x:Int16>
<x:Int16>8</x:Int16>
<x:Int16>9</x:Int16>
<x:Int16>10</x:Int16>
</x:Array>
</CollectionView.ItemsSource>
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid
RowDefinitions="50"
Style="{StaticResource QuantitySelectionStyle}">
<Label
Text="{Binding}"
FontSize="Title"/>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Button
Text="Cancelar"
Grid.Row="1"
TextColor="Red"
BackgroundColor="Transparent"
Command="{Binding CancelCommand}"/>
<Button
Text="Save"
Grid.Row="1"
Grid.Column="1"
TextColor="Green"
BackgroundColor="Transparent"
Command="{Binding AddOrUpdateProductCommand}"/>
</Grid>
</toolkit:Popup>
hugo vazquez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.