Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Added x:DataType to views to use compiled bindings #136

Merged
merged 1 commit into from
Aug 16, 2019

Conversation

haavamoa
Copy link

x:DataType for all the views <3

Hi @jamesmontemagno , I dont know if you remember me from this stream, but I wanted to contribute to your app.

In these changes I have added x:DataType to all of your views. This is so the project uses the compiled bindings.

"Compiled bindings are resolved more quickly than classic bindings, therefore improving data binding performance in Xamarin.Forms applications."

It also gives you compile time errors when you have a binding that does not match the binding context. This should be helpful for future development.

Notes

  • Collection-controls that uses the DataTemplate also has to specify which x:DataType it is using, and this normally has to be set on the DataTemplate element.
  • Missing on PodcastEpisodePage because I did not understand where the IsBusy property belongs. It is not in the PodcastEpisodeViewModel, which is the binding context of the page.

Off topic
I also want to highlight this issue in the Xamarin/Forms github repository. It would be very interesting if the x:DataType could be further developed so we can get propper intellisense in the IDE when we are working with it. That would truly be amazing!

@jamesmontemagno
Copy link
Owner

This looks awesome! Thank you so much for the pull request! I will also comment on that issue that you posted in here. I will also do a nice little blog on this feature for the Xamarin blog in the next few weeks, because it is very helpful.

@jamesmontemagno jamesmontemagno merged commit 216b030 into jamesmontemagno:vnext Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants