-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved Binding Support #521
Conversation
Great and beautiful PR! I have few suggestions and request. Changing property names
Because I want to follow original Xamarin.Forms.Maps specification . Duplicate event and EventArg classSeems Do you need RequestCould you add the sample for this feature to XFGoogleMapSample ? |
Happy to add it to the sample. As for the other issues you brought up.
The naming was done to be consistent with other Xamarin.Forms API's such as the ListView and TabbedPage. Also it is only loosely tied to Pins, so naming it Pin{whatever} would get confusing as you would lead people to thinking it is an actual Pin. The items bound to the ItemsSource are not necessarily Pins. In fact if you're following an MVVM design they should never be Pins.
If you look at the Xamarin.Forms.Maps codebase you'll see that the most of the files haven't even been touched since the initial import 2 years ago, a few classes had some very minor tweaks around internals and what they're visible to. Beyond that there have been no changes making it stagnant. Point being the Xamarin.Forms.Maps API was done in an era when developers were writing all of their Pages in code. Today with XAML and MVVM design being the prominent design pattern developers have different needs.
These actually aren't duplicates. They are similar in concept, but not duplicate. The SelectedPinChanged raises the Pin, where the SelectedItemChanged as well as the ItemSelectedCommand are both focused on the Item. The item is a abstract concept that would be in the ItemsSource and used as the BindingContext of the Pin rather than the Pin itself. Whereas the SelectedPinChanged is all about providing the Pin itself. |
worth noting, if I add the sample it won't build given that you are referencing the published NuGet instead of the code. I'm still happy to add it if that's what you want. |
You can use Xamarin.Forms.GoogleMaps_with_sample.sln what is all projects contained solution (not using nuget) . I hope you add sample code to it. 😉 |
+1 I've also extended the GoogleMaps project to bind more items: So i can use this map component like:
So if your extending the bindings.. :) Please do Pins, Polylines and CameraPosition as well 👍 |
@amay077 are you good with the addition of Bindable Pins, Polylines, and CameraPosition? |
I have also extended this control to handle the same thing but I write the UI in C#. new Map {
Behaviors = {
new UpdateRegionBehavior {
Region = new Binding("Region")
},
new BindingPolylinesBehavior {
ItemSource = new Binding("TrackingInfo")
},
new BindingPinsBehavior {
ItemSource = new Binding("MapPins")
}
}
}, It would be neat to see something like this merged into master :) |
@dansiegel It's not clear to me how the
But
Could you please give some info on how it needs to work? Thanks! |
Sorry I'm very very late. |
Description
Adds ItemsSource with ItemTemplate and SelectedItemCommand/Event.
fixes #519