All tagged objective-c

How the heck does one do DataBinding with XAML

DataBinding is one of those things that once you learn, you have no idea how you lived without it before.

Being one of the most important things you can learn about XAML, this lecture builds on the example that we have been building in previous lecture to complete an introduction to the Xamarin platform. After this, you will be much more efficient when creating and linking your interfaces to your apps’s logic.

Using ListViews in Xamarin Forms

So now you have read the data from the SQLite table into a list of C# objects that are ready to be listed into the user interface.

Now it is time to learn how to use ListViews, which will be the go-to element when you need to display a collection of data to your users.

Reading a SQLite Database

Reading a database will be very straight forward, especially once you know how to establish the connection to the database, which you should already know thanks to our previous post.

All you have to make sure of now is that when reading, you get all that data in the correct format, not as a simple query to a database, but as an actual list of elements. So in this lecture I cover how to do exactly that.

Inserting to a SQLite Database

Well, now that the Model is ready, and the database is created for both Android and iOS scenarios, there is nothing left for us to do but to start adding the functionality for the necessary requests inside of our application.

In this video, I start by explaining how to insert to the database, and how a specific usage of the using keyword will be rather important for you to understand.

SQLite Xamarin Forms Tutorial - iOS Database Path

When using SQLite inside of your applications, you will need to set the location for the database file.

In this video I cover what you have to do for the iOS scenario, which indeed will be slightly different from the Android one, which means that we will have two versions of the same code -one per platform- and that we will need to code some functionality in the platform-specific projects.

SQLite Xamarin Forms Tutorial - Android Database Path

When using SQLite inside of your applications, you will need to set the location for the database file.

In this video I cover what you have to do for the Android scenario, which indeed will be slightly different from the iOS one, which means that we will have two versions of the same code -one per platform- and that we will need to code some functionality in the platform-specific projects.

Adding NuGet Packages to a Xamarin Forms (starting with SQLite)

So SQLite can be quite useful in a lot of scenarios. I believe most apps should use this light-weight version of a database, even when they rely on another cloud database for their information.

But before we learn how to implement SQLite into our apps, let’s first take a look at how can we add third-party functionality into our apps, so we don’t have to code SQLite functionality from the ground up.

Handling Landscape and Portrait Modes in Xamarin Forms

In the previous post, I showed you how you could handle multiple states for a specific element using the VisualStateManager and defining various groups and VisualStates.

In this post, we will use this same feature to change the UI of an example application so that it hides a title when the device is on portrait mode, so there is more space for the main component of the interface, which will be a ListView.

Handling Visual States in Xamarin Forms

If there is something that can take a good-looking app to an incredible-looking app that may very well be Visual States. By defining different Visual States you are able to define how a certain element must look depending on some interaction from the user. The simpler example is with buttons, with which you are able to see when someone hovers over them (perhaps they change color), someone presses them (maybe in addition to colors the scale also changes), maybe also when they lose focus.

New on Xamarin Forms 3.4 - ImageButtons

It could be a bit of a pain to try to use Images as buttons, for those scenarios when you needed to display a certain image but also needed the user to be able to click on it, with all that that implies. A nice animation, perhaps change of color, and of course the triggering of an event or the ability to bind a Command. As of Xamarin Forms 3.4, this is no longer a pain, now you can define an ImageButton like you would define any element in the interface, and use it similarly to how you would use an Image, and make it respond to how a Button would.