UPDATE: I figured out the Picker on Android bug, it seems that the SelectedIndex attribute doesn't seem to be respected on Android when the view is created. I got around this issue by setting this.MyPickersName.SelectedIndex = 0 in the UserListDataInput constructor, forcing it to set selected index on page creation. Seems like a bug, I'll log it and see what they say. Thanks for watching! 🕘Timestamps: 00:00 - Video Start 00:47 - Code is in the Github Repo, do whatever you want with it! 01:31 - Guard from the CommunityToolkit.Diagnostic Package (Love it) 04:16 - My Hilariously Basic Sorting Algorithm 10:09 - One Weird Trick To Get CollectionView To Update 14:25 - A Bug With Picker And Android?
And i think in the xamarin community toolkit there is a event to command functionality for the xaml part, this really helped me out on my last project. And i think there are commands for the picker
For the list if i can remember correctly from my last xamarin forms app i wrote a check inside this if its a "init" call or something like that and only execute some code if its not init
And also if i can remember correctly the selected index of the picker should be a binding to a variable in the viewmodel so you can set it on load or stuff like that and also safe it
Yup, that's how I ended up getting around it, grabbing the picker in the view constructor and setting it there. I submitted a bug to the maui repo and so far they've accepted it, so it does sound like that it should work in the XAML without doing that, but hey, new framework, new bugs.
@@ProgrammingWithChris ok nice sounds also good. If it works it works. And yea i thinks just normal Microsoft stuff someday maybe it will work right but i think these pickers have a default text that can be shown and set individually like "select your model" or something and than the selected index gets safed and set again before showing the view again
UPDATE: I figured out the Picker on Android bug, it seems that the SelectedIndex attribute doesn't seem to be respected on Android when the view is created. I got around this issue by setting this.MyPickersName.SelectedIndex = 0 in the UserListDataInput constructor, forcing it to set selected index on page creation. Seems like a bug, I'll log it and see what they say. Thanks for watching!
🕘Timestamps:
00:00 - Video Start
00:47 - Code is in the Github Repo, do whatever you want with it!
01:31 - Guard from the CommunityToolkit.Diagnostic Package (Love it)
04:16 - My Hilariously Basic Sorting Algorithm
10:09 - One Weird Trick To Get CollectionView To Update
14:25 - A Bug With Picker And Android?
pin?
Thanks for taking us through this, been really helpful.
And i think in the xamarin community toolkit there is a event to command functionality for the xaml part, this really helped me out on my last project. And i think there are commands for the picker
For the list if i can remember correctly from my last xamarin forms app i wrote a check inside this if its a "init" call or something like that and only execute some code if its not init
And also if i can remember correctly the selected index of the picker should be a binding to a variable in the viewmodel so you can set it on load or stuff like that and also safe it
Yup, that's how I ended up getting around it, grabbing the picker in the view constructor and setting it there. I submitted a bug to the maui repo and so far they've accepted it, so it does sound like that it should work in the XAML without doing that, but hey, new framework, new bugs.
@@ProgrammingWithChris ok nice sounds also good. If it works it works. And yea i thinks just normal Microsoft stuff someday maybe it will work right but i think these pickers have a default text that can be shown and set individually like "select your model" or something and than the selected index gets safed and set again before showing the view again