Working with the Razor Templating Engine

In the previous chapter, we learned how to work with the various Animation classes that come as part of the Xamarin.Forms platform, so that you can apply really cool animations and transition effects to your user interfaces and control elements. We learned how to work with and use simple animations within your XAML, as well as how to create the necessary C# code within your ContentPages to interact with your XAML control elements in order to apply various animation techniques to the controls that Rotate, Scale, Translate, and Fade.

We also learned about easing functions, and how you can implement these within your ContentPages using C# code by making use of the Easing class, which allows you to specify a transfer function that is able to control the speed of running animations by creating custom easing functions that are able to interact with your XAML control visual elements.

Lastly, you learned how to work with the different types of transition effects, which you can use to apply Fading to your views using the FadingEntrance class, as well as the SlidingEntrance and SwingingEntrance classes, which you can use to provide animations to your ContentPage (view) or XAML control elements whenever the ContentPage is displayed on the screen.

In this chapter, you will learn about the Razor templating engine, and how you can use it to create a hybrid mobile solution. You'll learn how to build a book library mobile solution using the power of Razor templates, as well as how to use and define BookItem database models within your application.

You'll learn how to incorporate the SQLite-net NuGet package that you will use in order to create a BookDatabase interface and class, which will include a number of class instance methods that will be used to communicate with our SQLite database so that you can create, update, retrieve, and delete book items. Finally, you will learn how to create the necessary Razor template pages that will integrate with our BookItem data model, as well as how to implement the necessary class instance methods within the WebViewController class.

This chapter will cover the following topics:

  • Understanding what exactly the Razor templating engine is
  • Building a Book Library app using the Razor templating engine
  • Incorporating the SQLite-net NuGet package to our solution
  • Creating and implementing a BookDatabase class using C#
  • Creating the BookLibrary database model for our Book Library app
  • Creating and implementing the BookLibaryListing Razor template page
  • Creating and implementing the BookLibaryAddEdit Razor template page
  • Updating the BookLibrary Cascading Style Sheet (CSS)
  • Implementing the necessary class instance methods within the WebViewController class
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.66.156