Course info
Aug 11, 2015
1h 25m

Every meaningful application works with data. In this course, you will learn both introductory and advanced techniques for managing data in Xamarin.Forms including data binding, collection presentation, persistence, and custom rendering.

About the author
About the author

Jesse Liberty is a Senior Consultant at Wintellect, where he specializes in Xamarin, Azure and Web development. He is a Certified Xamarin Developer, a Xamarin MVP and a Microsoft MVP.

More from the author
Visual Studio for Mac
1h 19m
Apr 16, 2018
More courses by Jesse Liberty
Section Introduction Transcripts
Section Introduction Transcripts

Hi this is Jesse Liberty from Pluralsight, and this is Xamarin. Forms and Data. This module is an introduction to this topic. Virtually, any application for Xamarin. Forms is going to interact with data. And Xamarin. Forms is specifically designed for handling interaction with data. Let's take a look as to whether this video is right for you. First of all, you're going to need a licensed or possibly a review copy of Xamarin Studio or of Visual Studio with Xamarin. You're also going to need a background or at least have taken introductory classes in C#, as well as Xamarin. Forms with XAML.

Understanding Data Binding
Hi this is Jesse Liberty from Pluralsight, and this module is on the crucial topic of data binding. Before data binding we had to manually connect the data to whatever was going to display it. That led to a great deal of complexity, which led to bugs. It was also very, very hard to test. Data binding is truly key to everything else we're going to be doing in this course. The essence of data binding is that you start with a source object and you have a target object. The source can be any object, a POCO, plain old CLR object, while the target object must be bindable. Between them is the data binding infrastructure. Now the source object might be a contact whereas the bindable object might be a label. And the data from contact might be displayed in that label. Let's take a look at a couple demos that will illustrate these points.

Separating Data and Presentation with MVVM
Hi this is Jesse Liberty for Pluralsight, and this module is the critical issue of the pattern MVVM. MVVM stands for Model-view-viewmodel where the model is your data, the view is your presentation layer and the view model is where you put the logic for your program. Martin Fowler, renowned in the industry, suggests that the view, that is the presentation, be clearly separated from the logic, which we put in the view model, and the data, which we put in the model. MVVM helps very much with this kind of separation of concerns, but it also helps with testability, and it's terrific for managing larger applications. The approach to the general design of MVVM is that you have a view, which can talk to your view model, and your view model can talk to your model. However, I like to say don't look up. The view model is not visible to the model and the view is not visible to the view model. So it's a very specific direction. The presentation layer and the view model interact to handle events. And all of your testing is directed to the view model where the logic is. Let's take a look at a couple quick demos on MVVM. First, we'll refactor our contact list into MVVM. And then we'll take a look at the topic of data triggers.

Persisting Data with SQLite
Hi this is Jesse Liberty for Pluralsight, and this module is Persisting Data with SQLite. There are a number of ways to persist your data, but the most popular is to persist it to a database. And by far the most popular database for mobile applications is SQLite. SQLite supports all of the CRUD operations, that is create, retrieve, update, and delete. We begin by creating an interface, which I'm calling here ISQLite, that has just one method, GetConnection. We then go into the iOS application and we wire up and implement that interface, specifically for a path on iOS. Once that's in place, we're able to call that database and use that database by going through our DependencyService and getting the appropriate object and then getting the connection. So this reaches into iOS or Android as is appropriate. All of this will become clear when we take a look at this demo.

Extending Xamarin.Forms with Custom Renderers
Hi this is Jesse Liberty from Pluralsight, and this is Extending Xamarin. Forms with Custom Renderers. Custom Renderers are one of the most advanced topics in Xamarin. Forms, but also one of the most powerful because sometimes the controls that are built into Xamarin. Forms are just not quite enough for what you want to accomplish. You accomplish custom rendering by declaring the type that you want in the PCL and then implementing that type on each platform with platform-specific code. Let's take a look at how this is done in a demo on custom renderers.

Resources and Next Steps
Hi this is Jesse Liberty for Pluralsight, and this is our final module, Resources and Next Steps. There are a number of resources available to you. I suggest beginning with the Pluralsight catalog, as we have many courses on Xamarin and extending your knowledge of Xamarin data. You will also find a number of articles on my blog. And of course, xamarin. com has the APIs, documentation, and a wealth of other information. The best advice is to build an application and as soon as you finish that build another application. Thank you very much, and I look forward to talking with you again very soon.