没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
209页
Using MVVM Light with your Xamarin Apps 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
资源推荐
资源详情
资源评论
Using MVVM Light
with your
Xamarin Apps
—
Paul Johnson
Using MVVM Light with
your Xamarin Apps
Paul Johnson
Using MVVM Light with your Xamarin Apps
Paul Johnson
Merseyside, United Kingdom
ISBN-13 (pbk): 978-1-4842-2474-8 ISBN-13 (electronic): 978-1-4842-2475-5
https://doi.org/10.1007/978-1-4842-2475-5
Library of Congress Control Number: 2017962633
Copyright © 2018 by Paul Johnson
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.
Cover image designed by Freepik
Managing Director: Welmoed Spahr
Editorial Director: Todd Green
Acquisitions Editor: Todd Green
Development Editor: Laura Berendson
Technical Reviewer: Abhishek Sur
Coordinating Editor: Jill Balzano
Copy Editor: April Rondeau
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
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, email
orders-ny@springer-sbm.com, 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.
For information on translations, please email rights@apress.com or visit http://www.apress.com/
rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions
and licenses are also available for most titles. For more information, reference our Print and eBook Bulk
Sales web page at http://www.apress.com/bulk-sales.
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/9781484224748. For more
detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
iii
Contents
About the Author ����������������������������������������������������������������������������������������������������� ix
About the Technical Reviewer ��������������������������������������������������������������������������������� xi
Acknowledgments ������������������������������������������������������������������������������������������������� xiii
Foreword �����������������������������������������������������������������������������������������������������������������xv
Introduction �����������������������������������������������������������������������������������������������������������xvii
■Chapter 1: Installing MVVM Light �������������������������������������������������������������������������� 1
Creating Your Shell Project ����������������������������������������������������������������������������������������������� 1
Visual Studio 2015 & 2017 ��������������������������������������������������������������������������������������������������������������������� 1
VisualStudio for Mac ������������������������������������������������������������������������������������������������������������������������������� 3
Adding the MVVM Light Libraries ������������������������������������������������������������������������������������� 7
Adding MVVM Light to the Mac Project �������������������������������������������������������������������������������������������������� 7
Add MVVM Light to the Visual Studio Project ����������������������������������������������������������������������������������������� 9
Congratulations! ����������������������������������������������������������������������������������������������������������������������������������� 14
Conclusion ���������������������������������������������������������������������������������������������������������������������� 15
■Chapter 2: Your First MVVM Light Mobile App ����������������������������������������������������� 17
Welcome to Football Grounds ���������������������������������������������������������������������������������������� 17
How an MVVM Application Is Constructed �������������������������������������������������������������������������������������������� 17
Notifications ����������������������������������������������������������������������������������������������������������������������������������������� 18
Let’s Design the App ������������������������������������������������������������������������������������������������������� 19
Constructing the Model ������������������������������������������������������������������������������������������������������������������������ 19
Constructing the View Model ���������������������������������������������������������������������������������������������������������������� 20
Setting the ViewModelLocator �������������������������������������������������������������������������������������������������������������� 20
■ Contents
iv
Constructing the User Interface (View) ������������������������������������������������������������������������������������������������� 21
The View Model ������������������������������������������������������������������������������������������������������������������������������������ 22
The Platform User Interface ������������������������������������������������������������������������������������������� 24
1� Android ��������������������������������������������������������������������������������������������������������������������������������������������� 24
2� iOS ���������������������������������������������������������������������������������������������������������������������������������������������������� 28
3� Windows Mobile �������������������������������������������������������������������������������������������������������������������������������30
Accessing the ViewModelLocator ��������������������������������������������������������������������������������������������������������� 30
Compiling and Running the Apps ����������������������������������������������������������������������������������� 32
Extending Our Application ���������������������������������������������������������������������������������������������� 37
Adding the Navigation Service ������������������������������������������������������������������������������������������������������������� 38
Using the Navigation Service Within the View Model ��������������������������������������������������������������������������� 40
Adding Access to Maps: iOS �����������������������������������������������������������������������������������������������������������������41
Adding Access to Maps: Windows Mobile ��������������������������������������������������������������������������������������������41
Adding Access to Maps: Android ���������������������������������������������������������������������������������������������������������� 41
Putting Maps into the Apps: iOS �����������������������������������������������������������������������������������������������������������42
Putting Maps into the Apps: Android ����������������������������������������������������������������������������������������������������� 43
Putting Maps into the Apps: Windows Mobile ���������������������������������������������������������������������������������������44
Creating the Location from the View Model ������������������������������������������������������������������������������������������ 45
Plotting the Data ����������������������������������������������������������������������������������������������������������������������������������� 46
Conclusion ���������������������������������������������������������������������������������������������������������������������� 47
■Chapter 3: Inversion of Control (IoC) & Messaging ��������������������������������������������� 49
IoC Basics ����������������������������������������������������������������������������������������������������������������������� 50
IoC��������������������������������������������������������������������������������������������������������������������������������������������������������� 50
Using the Built-in IoC ������������������������������������������������������������������������������������������������������ 56
Dependency Injection ���������������������������������������������������������������������������������������������������������������������������57
Messaging �������������������������������������������������������������������������������������������������������������������������������������������� 60
Register ������������������������������������������������������������������������������������������������������������������������������������������������ 60
Unregister ��������������������������������������������������������������������������������������������������������������������������������������������� 61
Send ����������������������������������������������������������������������������������������������������������������������������������������������������� 61
剩余208页未读,继续阅读
资源评论
- xepher20082018-04-01可用,英文版pdf,多谢分享
- 圣域理想2020-08-12感谢分享,书中使用的是 MVVM Light 框架,学习了!
yinkaisheng-nj
- 粉丝: 763
- 资源: 6953
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功