Gerald Versluis

Xamarin.Forms Essentials

First Steps Toward Cross-Platform Mobile Apps

Gerald Versluis

Sittard, The Netherlands

Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www.​apress.​com/​9781484232392 . For more detailed information, please visit http://​www.​apress.​com/​source-code .

ISBN 978-1-4842-3239-2

e-ISBN 978-1-4842-3240-8

https://doi.org/10.1007/978-1-4842-3240-8

Library of Congress Control Number: 2017961816

© Gerald Versluis 2017

This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.

Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.

While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.

Printed on acid-free paper

Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.

Introduction

While I was planning on doing a second book, I didn’t plan on it to come this fast. My first book just came out earlier this year and I still have this magical smile whenever I hold a copy in my hand. And now there already is a second!

I wanted to do another book, mainly because I love help starting developers begin their journeys. With this book, I hope you will learn what Xamarin as a company is all about and why I love Xamarin.Forms as a technique.

By using a real-life app that is available in the app stores right now as an example, I hope I can make the concepts of Xamarin.Forms as clear as possible. What I have learned from writing this book is that it’s hard to put on paper what you mean by a certain piece of code. By referring to code in the sample app and being able to try the functionality yourself, I’ve made it as clear as possible.

If anything isn’t clear or you have any questions or comments, please don’t hesitate to reach out to me. I love to hear from my readers and see what they’ve created.

Have a blast reading this book; I know I have enjoyed writing it.

Acknowledgments

I want to thank Jonathan for his belief in me and for encouraging me to write another book this quickly. Also, Jill, again thanks for the great collaboration.

Also, thank you dear Laurie for (again) being patient and supportive and for believing in me while I put a lot of time and effort in this book.

And of course, I want to thank you, the reader holding this book right now, for reading! You are the ones I am doing this for, so I hope this book met your expectations and that you have found it useful to make you a better professional. May this book help you put together awesome apps!

Table of Contents

  1. Part I: What Is Xamarin.Forms?1
    1. Chapter 1:​ A Brief History of Xamarin
      1. How It All Started
      2. Xamarin Today
      3. Product Suite
        1. Xamarin Platform
        2. Xamarin.​Forms
        3. Xamarin Test Cloud
        4. Xamarin Studio/​Visual Studio for Mac
        5. Xamarin for Visual Studio
        6. Xamarin Workbooks
      4. The Xamarin Vision
      5. Summary
    2. Chapter 2:​ Introducing Xamarin.​Forms
      1. The Necessity of Xamarin.​Forms
      2. How to Construct the Layout
      3. Platform Renderers
      4. Summary
    3. Chapter 3:​ Xamarin.​Forms Contents
      1. Portable Class Library vs Shared Project
      2. The .​NET Standard
      3. Pages, Layouts, and Controls
      4. But There Is More…
        1. DependencyServic​e
        2. Navigation
        3. Animations API
        4. Messaging Center
      5. Summary
    4. Chapter 4:​ Xamarin.​Forms vs.​ Traditional Xamarin
      1. What Is Traditional Xamarin?​
      2. Which One Do You Choose?​
      3. Using Custom Renderers
      4. Summary
  2. Part II: Building an App61
    1. Chapter 5:​ Establishing the Architecture
      1. The “Been Pwned” App
      2. Setting Up the Project Structure
        1. Been Pwned Structure
      3. Using the MVVM Pattern
        1. What Is the MVVM Pattern?​
        2. Using MVVM With Xamarin.​Forms
        3. Using a MVVM Framework
      4. Summary
    2. Chapter 6:​ Building Screens
      1. The Main Entry Point
        1. Styling
        2. Cascading Resource Dictionaries
        3. Platform-Specific XAML or Code
        4. XAML Compilation
        5. Application Lifecycle Methods
        6. Wrapping Up the App Class
      2. The Been Pwned?​ Page
        1. NavigationPage
        2. Grid
        3. SearchBar
        4. StackLayout
        5. ListView
        6. Custom Views and Controls
      3. The PageModel
      4. Working with Resources and Metadata
        1. iOS
        2. Android
      5. Summary
    3. Chapter 7:​ Connecting to a REST Backend
      1. The Manual Way
      2. The Refit Way
      3. The Third-Party Way
      4. Summary
    4. Chapter 8:​ Using Good Libraries That Are Already Out There
      1. FreshMvvm
      2. Refit
      3. Polly
      4. Akavache
      5. Fusillade
      6. Settings
      7. Connectivity
      8. PropertyChanged.​Fody
      9. FFImageLoading
      10. UserDialogs
      11. FormsCommunityTo​olkit
      12. Other Tooling
        1. MFractor
        2. Third-Party XAML Previewers
        3. Xamarin Live Player
      13. Summary
  3. Part III: Future of Xamarin.Forms147
    1. Chapter 9:​ What to Expect in Xamarin.​Forms Version 3
      1. Improving Performance
        1. Fast Renderers
        2. Layout Compression
      2. XAML Standard
      3. More Styling Options
      4. Xamarin.​Forms Embedding
      5. More Supported Platforms
      6. Others
      7. Summary
    2. Chapter 10:​ Conclusion
  4. Index

About the Author

A459257_1_En_BookFrontmatter_Figb_HTML.jpg

Gerald Versluis is a full-stack software developer and Microsoft MVP from The Netherlands. He has many years of experience working with .NET technologies, Azure, and Xamarin. Gerald has been involved in a variety of roles in numerous projects. A great number of these projects involve developing Xamarin apps. Not only does Gerald like to code, but he also is keen on spreading his knowledge and gaining some in the bargain. Gerald speaks, records vlogs, provides training sessions, and writes blogs and articles in his spare time.

..................Content has been hidden....................

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