Closed RobertoGFilho closed 7 months ago
Hi @RobertoGFilho. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Hi @RobertoGFilho. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Hi ! You can reproduce the issue, with this sample project: https://github.com/RobertoGFilho/MAUITest
Any news on this issue! I am having the same situation!
I am also facing this issue. This is basic functionality but MAUI team not even acknowledging this issue is concerning.
I faced similar issue but found that it was due to incorrect SelectionChangedCommandParameter after reading this: Stackoverflow
After correcting it, it worked fine.
Same problem - Button in CollectionView not working
<Button Command="{Binding ScrollToCommand}"
CommandParameter="1" >
<CollectionView ItemsSource="{Binding GroupIds}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Button Text="{Binding .}"
Command="{Binding ScrollToCommand}"
CommandParameter="1" />
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
public ObservableCollection
[RelayCommand] async Task ScrollTo(string text) { WriteLine("help...") }
I think you have to use relative bindings
SelectedItem binding and SelectedChanged do not work ,I'm so depressed, is MAUI general available? too much bugs
I also ran into same problem. Why does such a basic function fail?
any news? I have same problem. My workaround was to set the SelectedItem property and then in VM make a variable to have the element selected:
<CollectionView
ItemsSource="{Binding Action}"
SelectionMode="Single"
SelectionChangedCommand="{Binding MissionsCommand}"
SelectedItem="{Binding SelectedMenuItem}"
thenin VM:
public HomePageAction selectedMenuItem{get; set;}
[RelayCommand]
private void Missions()
{
Console.WriteLine(selectedMenuItem.ActionName);
}
I think this issue now described a couple of different ones. With the limited information and code I see from the different people I think a couple of these are due to understanding how the data binding scope works. If you're inside of a CollectionView
(or ListView
) then the scope of the databinding changes to the object that is contained in the collection, not the full view model anymore. Maybe this video will help. Although this is about Xamarin, the exact same is true for .NET MAUI.
For the other ones, I can't really tell what might be going on. If you still have issues with this, please open a new issue with all the details for you and ideally a reproduction project attached.
Description
SelectionChangedCommand from CollectionView doesn't trigger associated command if you have a frame control into ItemTemplate
https://user-images.githubusercontent.com/68563526/179430772-956b41c0-ad10-4dc4-90c6-7f3c290663a5.mp4
Steps to Reproduce
Version with bug
6.0.408 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12
Did you find any workaround?
No response
Relevant log output
No response