<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Intersoft Solutions Corporate Blog &#187; Crosslight</title>
	<atom:link href="http://blog.intersoftsolutions.com/tag/crosslight/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.intersoftsolutions.com</link>
	<description>All about development productivity – ASP.NET, Silverlight, WPF, iOS, Android, Windows Phone, Windows 8</description>
	<lastBuildDate>Sat, 21 Apr 2018 06:57:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.33</generator>
	<item>
		<title>Using Crosslight Location Service in iOS 8</title>
		<link>http://blog.intersoftsolutions.com/2016/08/using-crosslight-location-service-in-ios-8/</link>
		<comments>http://blog.intersoftsolutions.com/2016/08/using-crosslight-location-service-in-ios-8/#comments</comments>
		<pubDate>Mon, 15 Aug 2016 06:05:56 +0000</pubDate>
		<dc:creator><![CDATA[Yudhiy Ariawan]]></dc:creator>
				<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Location Service]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=8204</guid>
		<description><![CDATA[Using Crosslight Location Service Location service provides a streamlined way to access location API that conforms to each the device’s platform. In order to get the current location of the device, we use following snippet code: This method translate to, get the current location of [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/08/IMG_0221-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="NSLocationWhenInUseUsageDescription" style="float:right; margin:0 0 10px 10px;" /><div id="full-height-container">
<div id="splitter">
<div id="splitter-content">
<div id="main" class="aui-page-panel">
<div id="content" class="page view">
<div class="wiki-content">
<div class="contentLayout2">
<div class="columnLayout two-right-sidebar" data-layout="two-right-sidebar">
<div class="cell normal" data-type="normal">
<div class="innerCell">
<h1>Using Crosslight Location Service</h1>
<p>Location service provides a streamlined way to access location API that conforms to each the device’s platform. In order to get the current location of the device, we use following snippet code:</p><pre class="crayon-plain-tag">this.MobileService.Location.GetCurrentLocation(LocationAccuracy.Best,
    (locationResult) =&gt;
    {
        if (locationResult.Error == null)
		{
		}
        else
		{
		}
    });</pre><p>This method translate to, get the current location of the device, with best accuracy.</p>
</div>
<div class="innerCell">
<div id="full-height-container">
<div id="splitter">
<div id="splitter-content">
<div id="main" class="aui-page-panel">
<div id="content" class="page view">
<div class="wiki-content">
<div class="contentLayout2">
<div class="columnLayout single" data-layout="single">
<div class="cell normal" data-type="normal">
<div class="innerCell">
<h1>Problem: My app doesn&#8217;t returns current location. Why?</h1>
<p>Some of you might found out that the code fails silently. You will get no error or warning, but it will never get a location update. The app will never even ask for permission to use location.</p>
<p>It took me a while until I found that we need to add a key to Info.plist and request authorization from the location manager asking it to start. It&#8217;s an iOS 8 (and later) related issue. The key, <em>NSLocationWhenInUseUsageDescription</em>, is required when you request authorization for location services. If this key is not present, the system ignores your request and prevents your app from using location services.</p>
<h1>Solution: Asking user&#8217;s permission to access their location</h1>
<p>So we&#8217;ll need to add the key to the Info.plist file. It takes a string which is a description of why the app need location services. We can enter a string like &#8220;Location is required to find out where you are&#8221;.</p><pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
	...
	&lt;key&gt;NSLocationWhenInUseUsageDescription&lt;/key&gt;
	&lt;string&gt;Location is required to find out where you are.&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;</pre><p>Save the changes and re-run the app. Your app will now requesting permission by showing a popup.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/08/IMG_0221.png"><img class="alignnone size-medium wp-image-8205" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/08/IMG_0221-169x300.png" alt="NSLocationWhenInUseUsageDescription" width="169" height="300" /></a></p>
<p>Hopefully this post may helps developers using location services on iOS 8 (or later). If you have questions or feedback please feel free to submit in the comments section below.</p>
<p>Regards,<br />
Yudi</p>
<p>&nbsp;</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2016/08/using-crosslight-location-service-in-ios-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crosslight Essential Walkthroughs</title>
		<link>http://blog.intersoftsolutions.com/2016/05/crosslight-essential-walkthroughs/</link>
		<comments>http://blog.intersoftsolutions.com/2016/05/crosslight-essential-walkthroughs/#comments</comments>
		<pubDate>Thu, 12 May 2016 02:06:50 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Getting Started Guide]]></category>
		<category><![CDATA[kb-how-to-article]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[MVVM]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=8049</guid>
		<description><![CDATA[Based on your valuable feedbacks, we&#8217;ve compiled a list of Crosslight essential walkthroughs that will help you get started with Crosslight in no time. These topics cover a wide range of development scenarios, such as creating your first Crosslight app from a Xamarin template, performing [...]]]></description>
				<content:encoded><![CDATA[<img width="499" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/getting-started-499x270.png" class="attachment-post-thumbnail wp-post-image" alt="getting-started" style="float:right; margin:0 0 10px 10px;" /><p>Based on your valuable feedbacks, we&#8217;ve compiled a list of Crosslight essential walkthroughs that will help you get started with Crosslight in no time. These topics cover a wide range of development scenarios, such as creating your first Crosslight app from a Xamarin template, performing navigation from the ViewModel, executing commands, and much more. This blog post aims to give you a rough overview on each walkthrough has to offer.</p>
<p>You can find these walkthroughs under <a href="http://developer.intersoftsolutions.com/display/crosslight/Getting+Started+with+Crosslight" target="_blank">Getting Started with Crosslight</a> section in the Developer Center. Without further ado, let&#8217;s get started.</p>
<p><img class="alignnone size-full wp-image-8066" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/getting-started.png" alt="getting-started.png" width="300" height="1136" /></p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Introduction+to+Crosslight+NuGet+Packages" target="_blank">Introduction to Crosslight NuGet Packages</a></h1>
<p>Starting from Crosslight 5, all Crosslight dependencies are now streamlined to NuGet package manager for a more streamlined dependency management and allows for more timely Crosslight updates and hotfixes.</p>
<p><img class="alignnone size-full wp-image-8089" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/introduction-to-crosslight-nuget-packages.png" alt="introduction-to-crosslight-nuget-packages.png" width="2000" height="1260" /></p>
<p>Now you no longer have to deal with tedious references when working with Crosslight. This guide provides a comprehensive overview on how to work with the NuGet packages on both Xamarin Studio Mac as well as Visual Studio Windows, such as installing, updating and restoring NuGet packages.</p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Working+with+Crosslight+NuGet+Packages" target="_blank">Working with Crosslight NuGet Packages</a></h1>
<p>Similar to the previous guide, this walkthrough provides a more hands-on approach to working with NuGet packages with step-by-step guidances and rich visual walkthrough.</p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Creating+Your+First+Crosslight+App" target="_blank">Creating Your First Crosslight App</a></h1>
<p>This guide will walk you through the process of converting a simple Xamarin template that uses shared PCL project and transform it into a working Crosslight project.</p>
<p><img class="alignnone size-full wp-image-8099" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/creating-your-first-crosslight-app.png" alt="creating-your-first-crosslight-app.png" width="1255" height="1080" /></p>
<p>It is highly recommended to follow this walkthrough if you&#8217;re coming from a Xamarin background. After you&#8217;ve finished this project, you&#8217;ll get a rough idea of how Crosslight works and its excellent design pattern.</p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Creating+New+Project+with+Crosslight+Project+Wizard" target="_blank">Creating New Project with Crosslight Project Wizard</a></h1>
<p>If you&#8217;re using Visual Studio for mobile development, then this guide will help you create your first Crosslight app in no time with the Crosslight Project Wizard.</p>
<p><img class="alignnone size-full wp-image-8111" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/Screen-Shot-2016-02-26-at-8.55.54-AM.png" alt="Screen Shot 2016-02-26 at 8.55.54 AM.png" width="1280" height="922" /></p>
<p>With Crosslight Project Wizard, you can easily create various quick-start projects easily such as the Blank template, Master-Detail template, Navigation Drawer template, Business template, Localizable Business template as well as the Multi-Page template.</p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Creating+a+Simple+Tip+Calculator" target="_blank">Creating a Simple Tip Calculator</a></h1>
<p>Once you&#8217;ve finished creating a starter Crosslight app, it&#8217;s best to start working with simplest data binding capabilities available in Crosslight, and there&#8217;s no better app to learn it from other than building a simple tip calculator.</p>
<p><img class="alignnone size-full wp-image-8117" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/simple-tip-calculator.png" alt="simple-tip-calculator.png" width="1260" height="1080" /></p>
<p>This simple app will help you understanding how to perform a centralized data binding in the PCL project, and process your app&#8217;s business processes from the ViewModel, making it more centralized than ever.</p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Performing+Navigation" target="_blank">Performing Navigation</a></h1>
<p>In this guide, you&#8217;ll learn how to perform various screen navigation by utilizing Crosslight&#8217;s built-in navigation service, which will be invoked directly from the ViewModel. This is one of the essential knowledge needed to build a mobile app with Crosslight.</p>
<p><img class="alignnone size-full wp-image-8129" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/Screen-Shot-2016-02-11-at-11.28.13-AM.png" alt="Screen Shot 2016-02-11 at 11.28.13 AM.png" width="1518" height="1224" /></p>
<p>You&#8217;ll also learn how to perform various types of navigation, such as push navigation, modal navigation, push navigation and modal navigation with parameters, modal navigation with callback, and navigating to a new ViewModel with Identifier.</p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Executing+Commands" target="_blank">Executing Commands</a></h1>
<p>This walkthrough will help you learn how to execute commands with parameters on buttons and bar items.</p>
<p class="p1"><img class="alignnone size-full wp-image-8135" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/result.png" alt="result.png" width="984" height="808" /></p>
<p class="p1"><span class="s1">With Crosslight&#8217;s solid MVVM data binding, you&#8217;ll learn how to update a button&#8217;s state with a flick of a switch, which will update the invalidate the CanExecute state of all commands.</span></p>
<h1 class="p1"><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Getting+Started+with+MVVM+Data+Binding" target="_blank">Getting Started with MVVM Data Binding</a></h1>
<p class="p1"><span class="s1">In this tutorial, you&#8217;re going to learn how to perform simple data binding, in MVVM-fashion with Crosslight, such as:</span></p>
<ul class="ul1">
<li class="li1"><span class="s1">Binding text to labels and text boxes</span></li>
<li class="li1"><span class="s1">Binding numeric values to slider, text boxes and stepper</span></li>
<li class="li1"><span class="s1">Binding boolean values to switch</span></li>
<li class="li1"><span class="s1">Binding DateTime values to DateTime picker</span></li>
<li class="li1"><span class="s1">Binding image to image view</span></li>
<li class="li1"><span class="s1">Binding simple list of data to a list</span></li>
</ul>
<p><img class="alignnone size-full wp-image-8139" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/result-2.png" alt="result-2.png" width="949" height="808" /></p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Showing+Presenters" target="_blank">Showing Presenters</a></h1>
<p class="p1"><span class="s1">In this tutorial, you&#8217;re going to learn how to use Crosslight Presenters that are built-in to the Crosslight ViewModels, which consists of Action Presenter, Message Presenter, Toast Presenter, Dialog Presenter and Action Toast Presenter. </span></p>
<p class="p1"><img class="alignnone size-full wp-image-8143" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/result-3.png" alt="result-3.png" width="981" height="808" /></p>
<p class="p1">These presenters will surely help you display actions and messages to your users without any further hassles.</p>
<h1 class="p1"><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Accessing+Crosslight+Mobile+Services" target="_blank">Accessing Crosslight Mobile Services</a></h1>
<p>Crosslight ViewModels comes with built-in mobile services that are very handy to achieve various native functions of the devices.</p>
<p><img class="alignnone size-full wp-image-8145" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/result-4.png" alt="result-4.png" width="1423" height="1136" /></p>
<p>In this walkthrough, you&#8217;ll learn how to use the following mobile services:</p>
<ul>
<li>Browser Service</li>
<li>Camera Service</li>
<li>Contact Service</li>
<li>Local Notification Service</li>
<li>Location Service</li>
<li>Mail Service</li>
<li>Map Service</li>
<li>Media Library Service</li>
<li>Media Service</li>
<li>Messaging Service</li>
<li>Reachability Service</li>
<li>Social Service</li>
<li>Telephony Service</li>
</ul>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Getting+Started+with+Crosslight+Form+Builder" target="_blank">Getting Started with Crosslight Form Builder</a></h1>
<p>When building enterprise mobile apps, you&#8217;ll inevitably come across mobile forms. Although it may look simple, building forms that works and render beautifully across platforms often requires tremendous efforts, especially ones that also includes client-side validation support.</p>
<p><img class="alignnone size-full wp-image-8159" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/FormBuilder.001.jpeg" alt="FormBuilder.001.jpeg" width="1024" height="768" /></p>
<p>Crosslight Form Builder makes this process very easily and seamless, thanks to the intuitive Form Metadata that allows you to build forms in minutes, not days.</p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Getting+Started+with+Crosslight+Charting" target="_blank">Getting Started with Crosslight Charting</a></h1>
<p>Starting with Crosslght 4, Crosslight comes with a handy UI component that is very much sought after by mobile developers, which is mobile charting capabilities.</p>
<p><img class="alignnone size-full wp-image-8167" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/crosslight-charting.png" alt="crosslight-charting.png" width="1147" height="966" /></p>
<p>With Crosslight Charting, you can now easily build cross-platform mobile charts quickly and easily, with full MVVM capabilities. Just bind your data right within the ViewModela, and voila, your mobile chart is done.</p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Create+CRM+App+with+Crosslight+AppFramework+and+WebApi" target="_blank">Create CRM App with Crosslight AppFramework and WebApi</a></h1>
<p>Now that you&#8217;ve managed to build basic mobile apps, now it&#8217;s time to take it up a notch. In this tutorial, you&#8217;ll learn how to create a simple mobile CRM app that works with Microsoft WebAPI.</p>
<p><img class="alignnone size-full wp-image-8174" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/simple-crm.png" alt="simple-crm.png" width="1063" height="816" /></p>
<p>Thanks to Crosslight&#8217;s built-in tooling support, the process of creating shared models between client and server is made seamless. Simply save your EDMX file from Visual Studio and let the code generator works its wonders.</p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Create+a+To-Do+App+with+SQLite+Storage" target="_blank">Create a To-Do App with SQLite Storage</a></h1>
<p>Now that you&#8217;ve managed to create a simple CRM app, in this tutorial you&#8217;ll learn how to create a simple, working to-do app that you can use on a daily basis.</p>
<p><img class="alignnone size-full wp-image-8179" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/result-5.png" alt="result-5.png" width="948" height="808" /></p>
<p>This To-Do app will allow you add and complete tasks and saves right into SQLite mobile database. With Crosslight, you&#8217;ll learn how to achieve this scenario effortlessly.</p>
<h1><a href="http://developer.intersoftsolutions.com/display/crosslight/Walkthrough%3A+Create+a+To-Do+App+with+Data+Synchronization" target="_blank">Create a To-Do app with Data Synchronization</a></h1>
<p>Next, you&#8217;ll upgrade this project to include cross-platform data synchronization with WebAPI. With this tutorial, you&#8217;ll learn how to create a cross-platform to-do app that syncs data to each other.</p>
<p><img class="alignnone size-full wp-image-8186" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/05/result-6.png" alt="result-6.png" width="960" height="808" /></p>
<p>This app also comes with pull-to-refresh support to directly refresh and syncs the data.</p>
<h1>Wrapping Up</h1>
<p>Not stopping here, these list of walkthroughs will continue to grow and hopefully will become a very valuable resources for Crosslight developers who are just starting with the framework.</p>
<p>Till next post,<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2016/05/crosslight-essential-walkthroughs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redesigning Xamarin Field Service Sample with Crosslight &#8211; Part 2</title>
		<link>http://blog.intersoftsolutions.com/2016/04/redesigning-xamarin-field-service-sample-with-crosslight-part-2/</link>
		<comments>http://blog.intersoftsolutions.com/2016/04/redesigning-xamarin-field-service-sample-with-crosslight-part-2/#comments</comments>
		<pubDate>Fri, 08 Apr 2016 04:03:36 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2016 R1]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Reference Samples]]></category>
		<category><![CDATA[Crosslight 5]]></category>
		<category><![CDATA[Samples]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=7614</guid>
		<description><![CDATA[Back in November 2015 I wrote a blog post on Redesigning Xamarin Field Service Sample &#8211; Part 1. Well, in that post I&#8217;ve discussed various design quirks and what improvements can be made to made the overall Xamarin Field Service sample better. First of all, we&#8217;re glad to receive many [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/assignment-detail1-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="assignment-detail" style="float:right; margin:0 0 10px 10px;" /><p>Back in November 2015 I wrote a blog post on <a href="http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/" target="_blank">Redesigning Xamarin Field Service Sample &#8211; Part 1</a>. Well, in that post I&#8217;ve discussed various design quirks and what improvements can be made to made the overall <a href="https://blog.xamarin.com/the-xamarin-field-service-app-a-cross-platform-starter-kit/" target="_blank">Xamarin Field Service</a> sample better. First of all, we&#8217;re glad to receive many positive responses towards that post and very happy to see many Crosslight developers are taking UI and UX very seriously in designing their cross-platform apps.</p>
<p>Many of you have asked when will the blogpost see the light of day. Well, now it is. We&#8217;re very excited to announce that the sample is now available for you guys to check out and experiment for yourself. It is available here: <a href="http://git.intersoftsolutions.com/projects/CS/repos/app-fieldservice/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/app-fieldservice/browse</a>. Before I can delve into the technical aspects of this sample, in this second part of the post, I would like to re-highlight what we&#8217;ve promised in the first post and see it in action, in the form of shots and videos, with codes if possible. We tried to retain the business logic as much as we can to adhere to the original sample.</p>
<h1>Better Device Compatibility</h1>
<p>When you try to run the original sample, you won&#8217;t be able to run the sample on phone devices, which is kind of disappointing. But not with Crosslight. You can definitely deploy the sample on phones and tablet devices.</p>
<p><img class="alignnone size-full wp-image-7634" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/device-compatibility.png" alt="device-compatibility.png" width="1790" height="768" /></p>
<p>With this, you can easily target more devices as phone devices are greater in number when compared to tablets. One note: we&#8217;re discarding Windows-based platforms for now due to low market receptivity. Once it has gained more traction amongst cross-platform mobile developers, we&#8217;ll definitely revive the Windows lineup.</p>
<h1>The Login Screen</h1>
<p>First, let&#8217;s take a look at the original sample login screen experience.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/FZr02qsNqHU?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>One thing&#8217;s for sure: I can&#8217;t definitely use this screen on landscape orientation. When I try to focus on the username text box, the login box just flies away from the screen up to the point I can&#8217;t see where the text box is and input my username. You can still use this screen on portrait orientation though. Which is weird. Let&#8217;s take a look at Crosslight&#8217;s login screen.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/qMsxGoHeo4Y?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>No matter how you rotate it, it works consistently on both portrait and landscape orientation, on phones as well.</p>
<p>&nbsp;</p>
<p><img class="alignnone size-full wp-image-7707" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/android-login.png" alt="android-login.png" width="2000" height="716" /></p>
<p>&nbsp;</p>
<h1>The Assignment List Screen</h1>
<p>The assignment screen is pretty much the same, except for a few changes:</p>
<p><img class="alignnone size-full wp-image-7714" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/assignment-list.png" alt="assignment-list.png" width="2000" height="992" /></p>
<ol>
<li>We don&#8217;t feel that the &#8220;sticky&#8221; header feels common in modern mobile apps, therefore we opted for &#8220;grouped&#8221; assignments instead. Sticky headers tend to take too much space, obstructing the user&#8217;s view and may cause confusion. Active assignments are put on the top of the list, followed by Completed assignments and Pending assignments. On iOS, you can easily tap the status bar to get to the topmost part of the TableView (this is the default behavior of the TableView) to see the Active Assignment quickly.</li>
<li>We removed the the button click behavior from the &#8220;assignment status&#8221;. Instead, we opted for swipe gesture, as this is more commonly used in mobile apps. If the assignment is On Hold, you can only see Active and Complete as options (as shown in the shot above). It feels counter-intuitive to have two clickable UI elements inside an assignment. The user might wonder if there&#8217;s any additional UI elements that can be clicked in addition to the &#8220;Play&#8221; button.</li>
<li>Also notice that you can&#8217;t perform the swipe gesture if the assignment isn&#8217;t accepted yet, or is currently the running assignment. The secret lies in the <strong>AssignmentListViewModel.cs</strong> inside <strong>FieldService.Core/ViewModels</strong> folder.<span style="font-family: Menlo;"> <span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> Determines whether the edit command can be executed.</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">remarks</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> Allow users to perform swipe actions only when:</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> 1. The item status is Active or Pending</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> 2. The active assignment is not currently running.</span><br />
<span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">remarks</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">bool</span><span style="color: #333333;"> </span><span style="color: #333333;">CanExecuteEdit</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;"> </span><span style="color: #009695;">is</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EditingParameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #3364a4;">EditingParameter</span><span style="color: #333333;"> </span><span style="color: #333333;">editingParameter</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;"> </span><span style="color: #009695;">as</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EditingParameter</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">editingParameter</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;"> </span><span style="color: #009695;">is</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Assignment</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #3364a4;">Assignment</span><span style="color: #333333;"> </span><span style="color: #333333;">item</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #333333;">editingParameter</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;"> </span><span style="color: #009695;">as</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Assignment</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">item</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AssignmentViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;"> </span><span style="color: #333333;">&amp;&amp;</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AssignmentViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">IsStarted</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">item</span><span style="color: #333333;">.</span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Active</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;"> || </span><span style="color: #333333;">item</span><span style="color: #333333;">.</span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Pending</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span></span><span style="color: #333333;">    </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></li>
</ol>
<h1>The Assignment Detail Screen</h1>
<p>This is where things get pretty interesting.</p>
<p><img class="alignnone size-full wp-image-7748" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/assignment-detail.png" alt="assignment-detail.png" width="2000" height="649" /></p>
<p>&nbsp;</p>
<p>As promised, on tablets, we&#8217;ve used the new Dialog Presenter that will slide from the right hand side that will cover at least 3/4 of the screen. You can easily dismiss the detail by hitting the back button on Android or tapping on the area outside the dialog. On phones, normal push navigation is used. To use the Dialog Presenter on iPad, at the TabViewController&#8217;s constructor, simply use this code:</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AssignmentDetailTabViewController</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">var</span><span style="color: #333333;"> </span><span style="color: #333333;">isPad</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIDevice</span><span style="color: #333333;">.</span><span style="color: #333333;">CurrentDevice</span><span style="color: #333333;">.</span><span style="color: #333333;">UserInterfaceIdiom</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIUserInterfaceIdiom</span><span style="color: #333333;">.</span><span style="color: #333333;">Pad</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ConfigurePresenter</span><span style="color: #333333;">(</span><span style="color: #333333;">o</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">PreferredContentSize</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">CGSize</span><span style="color: #333333;">(</span><span style="color: #f57d00;">640</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">768</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">PreferredContentSizeLandscape</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">CGSize</span><span style="color: #333333;">(</span><span style="color: #f57d00;">704</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">768</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">DismissOnTap</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">isPad</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">PresentationStyle</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ContentPresentationStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">Edge</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">EdgePresentationPosition</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EdgePresentationPosition</span><span style="color: #333333;">.</span><span style="color: #333333;">Right</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">EntryTransition</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">SlideFromRightTransition</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                FadeOutSource </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">ContentShadowRadius</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">10</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">})</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></p>
<p>And when navigating, you can do something similar as follows:</p>
<p><span style="font-family: Menlo;"> <span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">on</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">phone</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">perform</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">standard</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">navigation</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">while</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">on</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">tablet</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">show</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">dialog</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">presenter</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">for</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">better</span><span style="font-style: italic; color: #888888;"> experience</span><br />
<span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">GetService</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">IApplicationService</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">.</span><span style="color: #333333;">GetContext</span><span style="color: #333333;">()</span><span style="color: #333333;">.</span><span style="color: #333333;">Device</span><span style="color: #333333;">.</span><span style="color: #333333;">Kind</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DeviceKind</span><span style="color: #333333;">.</span><span style="color: #333333;">Phone</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ActiveViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">NavigationService</span><span style="color: #333333;">.</span><span style="color: #333333;">Navigate</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentDetailTabViewModel</span><span style="color: #333333;">&gt;(</span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationParameter</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">))</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span><br />
<span style="color: #009695;">else</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ActiveViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">DialogPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">ShowAsync</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentDetailTabViewModel</span><span style="color: #333333;">&gt;(</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationParameter</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DialogOptions</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        HideButtons </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">})</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<p>You can see more detail on that inside the <strong>FieldService.Core/ViewModels/AssignmentViewModel.cs</strong> file.</p>
<p><strong>Special and very important note for iOS</strong>: When using the TabViewController after push navigation, you must hide the root navigation controller in order for many correct UX to work properly, for example, the navigation controller transitions, search bar controller, and much more. This needs to be done because the TabViewController has its own NavigationController. It is simply done by calling the following code in the <strong>AssignmentDetailTabViewController</strong>.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">bool</span><span style="color: #333333;"> </span><span style="color: #333333;">EnsureNavigationContext</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<p><span style="font-family: Menlo;"><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">InitializeView</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">base</span><span style="color: #333333;">.</span><span style="color: #333333;">InitializeView</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">Important</span><span style="font-style: italic; color: #888888;">:</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">Hide</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">root</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">navigation</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">bar</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">since</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">tab</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">will</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">have</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">its</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">own</span><span style="font-style: italic; color: #888888;">.</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">NavigationController</span><span style="color: #333333;">.</span><span style="color: #333333;">SetNavigationBarHidden</span><span style="color: #333333;">(</span><span style="color: #009695;">true</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></p>
<p>We also added a little touch.</p>
<p><img class="alignnone size-full wp-image-7856" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/call-map-ios.png" alt="call-map-ios.png" width="300" height="1136" /></p>
<p>You can click the call button to immediately call the specified number, or click on the address to launch Maps with immediate directions to the specified location. If you try to click any of the documents below, the report will be displayed in a modal ViewController.</p>
<p><img class="alignnone size-full wp-image-7866" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/report-ios.png" alt="report-ios.png" width="1388" height="1136" /></p>
<p>To launch the report on Android devices, you&#8217;ll need a PDF viewer installed to the emulator or device.</p>
<p><img class="alignnone size-full wp-image-7869" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/report-android.png" alt="report-android.png" width="1388" height="1136" /></p>
<p>&nbsp;</p>
<h1>The Footer View Template</h1>
<p>On iOS, notice that the new FooterViewTemplate is used, which resembles Apple-music style view template. On Android, since the tabs are placed on the top, the view template is used at the bottom of the screen.</p>
<p><img class="alignnone size-full wp-image-7817" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/footer-view-template.png" alt="footer-view-template.png" width="1519" height="918" /></p>
<p>The FooterViewTemplate is a new feature added in Crosslight 5.1. In iOS, to use thew new <strong>FotoerViewTemplate</strong>, simply override the property in the TabViewController and return the Nib file.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIViewTemplate</span><span style="color: #333333;"> </span><span style="color: #333333;">FooterViewTemplate</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIViewTemplate</span><span style="color: #333333;">(</span><span style="color: #3364a4;">AssignmentDetailTabFooter</span><span style="color: #333333;">.</span><span style="color: #333333;">Nib</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<p>If you&#8217;d like, you can also apply the translucent blur effect to the FooterViewTemplate by providing a <strong>Visual Effect View</strong> element using Xcode.</p>
<p><img class="alignnone size-full wp-image-7824" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/Screen-Shot-2016-03-29-at-4.15.07-PM.png" alt="Screen Shot 2016-03-29 at 4.15.07 PM.png" width="2264" height="1204" /></p>
<p>Here&#8217;s the result when applied.</p>
<p><video style="width: 300px; height: 100%;" src="http://developer.intersoftsolutions.com/download/attachments/24805642/blur-footer.mp4?api=v2" preload="metadata" controls="controls" width="700" height="150"><source type="video/mp4" src="http://developer.intersoftsolutions.com/download/attachments/24805642/blur-footer.mp4?api=v2" /><a href="http://developer.intersoftsolutions.com/download/attachments/24805642/blur-footer.mp4?api=v2"> http://developer.intersoftsolutions.com/download/attachments/24805642/blur-footer.mp4?api=v2 </a></video></p>
<p>Also note that when you use the <strong>FooterViewTemplate</strong>, Crosslight.iOS automatically calculates the height of the <strong>FooterViewTemplate</strong> and readjusts the content bounds above it, so that the contents not &#8220;overlayed&#8221; and obscured by the <strong>FooterViewTemplate</strong>. Very nifty.</p>
<p>On Android, you would simply override the <strong>ContentLayoutId</strong> of the <strong>AssignmentDetailTabFragment</strong> and return the layout you would like to use.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">&lt;?</span><span style="color: #333333;">xml</span><span style="color: #333333;"> </span><span style="color: #333333;">version</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">0</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;"> </span><span style="color: #333333;">encoding</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">utf</span><span style="color: #f57d00;">&#8211;</span><span style="color: #f57d00;">8</span><span style="color: #f57d00;">&#8220;</span><span style="color: #009695;">?&gt;</span><br />
<span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #3364a4;"> </span><span style="color: #333333;">xmlns:android</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">http</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">schemas</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">com</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">apk</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">res</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">xmlns:app</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">http</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">schemas</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">com</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">apk</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">res</span><span style="color: #f57d00;">&#8211;</span><span style="color: #f57d00;">auto</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">vertical</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">android</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">support</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">design</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">widget</span><span style="color: #3364a4;">.TabLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">tab_layout</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">app:tabTextAppearance</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@style</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">CustomTabText</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">FrameLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">fragment_container</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">FooterLayout</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">50dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:paddingLeft</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">10dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:paddingRight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">10dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:background</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">DADADA</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">50dp</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">FrameLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">StartButtonLayout</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">30dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">ImageButton</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">StartButton</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:scaleType</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">fitCenter</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:background</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">00000000</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:src</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@drawable</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">Start</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">FrameLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">TextView</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">FooterElapsedTimeLabel</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_marginLeft</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">10dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ElapsedTime</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">000000</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center_horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">TextView</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">FooterNameLabel</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Name</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textStyle</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">bold</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:singleLine</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">true</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">000000</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">TextView</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">FooterContactPersonLabel</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ContactPerson</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:singleLine</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">true</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">000000</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">FrameLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">right</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">ActivePendingLayout</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">70dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">right</span><span style="color: #f57d00;">|</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">30dp</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Button</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">ActivePendingButton</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ACTIVE</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">3BD606</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textSize</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">10sp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">right</span><span style="color: #f57d00;">|</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">70dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">30dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:background</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@drawable</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">circularTextViewGreen</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">AcceptRejectLayout</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">horizontal</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">80dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">right</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Button</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">✓</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">ffffff</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textSize</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">22sp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">32dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">32dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:background</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@drawable</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">circularButtonBlue</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">AcceptButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">0dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_weight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Button</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">X</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textColor</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">ffffff</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textSize</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">22sp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">32dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">32dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:background</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@drawable</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">circularButtonRed</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">RejectButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">FrameLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span></span></p>
<p>One thing to note is the middle FrameLayout with the ID <strong>fragment_container</strong>. You&#8217;ll need to provide this or the fragment transaction would not work properly.</p>
<h1>Single-Responsibility Principle</h1>
<p>Before we proceed, I want you to think about this problem for a second: since an assignment can be manipulated from so many places: the list screen, the detail screen and the map screen, what design approach is best used to &#8220;sync&#8221; the assignment state from any screens, but in an elegant way? For example, the user can start an assignment from the list screen, then from the detail screen, the user pauses, changes the assignment status, then go back to the map screen, plays the assignment once more, change the assignment status to Active, and so on.</p>
<p>We need to access the assignment from various ViewModels across the app, but we must ensure that the assignment states are correct whenever it is accessed anywhere. In this sample, we&#8217;ve used the <a href="https://en.wikipedia.org/wiki/Single_responsibility_principle" target="_blank">Single-Responsibility Principle</a> to address this problem, exhibited by <strong>AssignmentViewModel.cs</strong> located inside <strong>FieldService.Core/ViewModels</strong> folder. This single class holds a unified information for the Active Assignment as well as any other commands that can interact with the assignment, such as accepting, rejecting, starting, changing status, etc.</p>
<p>Crosslight provides an elegant solution to this problem with the IoC (Inversion of Control) pattern. By registering the ViewModel once in the Container class, you can easily resolve and use this ViewModel anywhere. To begin with, open the <strong>AppService.cs</strong> file inside <strong>FieldService.Core/Infrastructure</strong> folder where you&#8217;ll an entry that looks similar to the following.</p>
<p><span style="font-family: Menlo;"> <span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">assignment</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">view</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">model</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">streamlines</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">all</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">assignment</span><span style="font-style: italic; color: #888888;">&#8211;</span><span style="font-style: italic; color: #888888;">related</span><span style="font-style: italic; color: #888888;"> logics</span><br />
<span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">which</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">is</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">resolved</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">in</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">numerous</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">ViewModels</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">such</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">as</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">list</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">map</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">and</span><span style="font-style: italic; color: #888888;"> detail</span><br />
<span style="color: #3364a4;">Container</span><span style="color: #333333;">.</span><span style="color: #333333;">Current</span><span style="color: #333333;">.</span><span style="color: #333333;">Register</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentViewModel</span><span style="color: #333333;">&gt;(</span><span style="color: #333333;">c</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AssignmentViewModel</span><span style="color: #333333;">())</span><span style="color: #333333;">.</span><span style="color: #333333;">WithLifetimeManager</span><span style="color: #333333;">(</span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ContainerLifetime</span><span style="color: #333333;">())</span><span style="color: #333333;">;</span></span></p>
<p>To resolve the registered ViewModel anyhwere, all you need to do is create a getter-only property that resolves the ViewModel from the Container. For example, as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AssignmentViewModel</span><span style="color: #333333;"> </span><span style="color: #333333;">AssignmentViewModel</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Container</span><span style="color: #333333;">.</span><span style="color: #333333;">Current</span><span style="color: #333333;">.</span><span style="color: #333333;">Resolve</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentViewModel</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<p>Once this is done, you can easily use the object inside your BindingProvider and ensure that the data bindings work flawlessly across screens.</p>
<p><span style="font-family: Menlo;"> <span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">Command</span><span style="font-style: italic; color: #888888;"> bindings</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ActivePendingButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AssignmentViewModel</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">ChangeStatusCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ActivePendingButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandParameterProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Assignment</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">RejectButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AssignmentViewModel</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">RejectCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">RejectButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandParameterProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Assignment</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AcceptButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AssignmentViewModel</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">AcceptCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AcceptButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandParameterProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Assignment</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">StartButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AssignmentViewModel</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">StartCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></span></p>
<p>Very simple and elegant.</p>
<h1>The Items Screen</h1>
<p>Let&#8217;s take a brief look at the Items screen.</p>
<p><img class="alignnone size-full wp-image-7876" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/items-screen.png" alt="items-screen.png" width="1332" height="1136" /></p>
<p>At a first glance, there&#8217;s nothing quite special in the Items screen. Until you try to swipe down.</p>
<p><img class="alignnone size-full wp-image-7881" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/search.png" alt="search.png" width="1416" height="1136" /></p>
<p>&nbsp;</p>
<p>Notice that when you hit on the search bar, the status bar color changes according to the overridden <strong>PreferredStatusBarStyle.</strong></p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIStatusBarStyle</span><span style="color: #333333;"> </span><span style="color: #333333;">PreferredStatusBarStyle</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SearchDisplayController</span><span style="color: #333333;"> !</span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">null</span><span style="color: #333333;"> </span><span style="color: #333333;">&amp;&amp;</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SearchDisplayController</span><span style="color: #333333;">.</span><span style="color: #333333;">Active</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIStatusBarStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">Default</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIAppearanceSettings</span><span style="color: #333333;">.</span><span style="color: #333333;">StatusBarStyle</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<p>When you try to run this project on an iPad, you&#8217;ll get a popover controller when you try to add an item, and when you edit an item, you&#8217;ll get a nice modal ViewController that is displayed in the middle of the screen.</p>
<p><img class="alignnone size-full wp-image-7887" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/items-ipad.png" alt="items-ipad.png" width="2000" height="756" /></p>
<p>This corresponds to the BindingProvider defined for this view.</p>
<p><span style="font-family: Menlo;"><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">isTablet</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">TableView</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">SelectedCommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">NavigateToEditorCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">else</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">TableView</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">DetailNavigationTargetProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationTarget</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #3364a4;">AssignmentExpenseEditorViewModel</span><span style="color: #333333;">))</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></span></p>
<p>And in the ViewModel, the <strong>NavigateToEditorCommand</strong> invokes the following method.</p>
<p><span style="font-family: Menlo;"><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteNavigateToEditor</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">DialogPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">ShowAsync</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentItemsEditorViewModel</span><span style="color: #333333;">&gt;(</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationParameter</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DialogOptions</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            NeutralButtonStyle </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DialogButtonStyle</span><span style="color: #333333;">(</span><span style="color: #3364a4;">Colors</span><span style="color: #333333;">.</span><span style="color: #333333;">Red</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">})</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<p>When executing the Add command:</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteAdd</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">     </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">NavigationService</span><span style="color: #333333;">.</span><span style="color: #333333;">Navigate</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">AssignmentItemsEditorViewModel</span><span style="color: #333333;">&gt;(</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationParameter</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">TabViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            NavigationMode </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">NavigationMode</span><span style="color: #333333;">.</span><span style="color: #333333;">Modal</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">            EnsureNavigationContext </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">            ModalPresentationStyle </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ModalPresentationStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">FormSheet</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">            PreferPopover </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">            CommandId </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Add</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">})</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<h1>The Labor Hours Screen</h1>
<p>In the Labor Hours screen, the experience is pretty similar when adding or editing an item.</p>
<p><img class="alignnone size-full wp-image-7902" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/labor-hours-ipad.png" alt="labor-hours-ipad.png" width="2000" height="730" /></p>
<p>Perhaps one particular interesting technique is how to update the footer total Labor Hours at runtime. If you notice closely, when you edit any of the labor hours or add a new entry with a specified Labor Hours, the total labor hours sums up automatically.</p>
<p><img class="alignnone size-full wp-image-7926" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/labor-hours.png" alt="labor-hours.png" width="2000" height="618" /></p>
<p>To achieve that effect, we provide the <strong>FooterViewTemplate</strong> for the Labor Hours screen.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIViewTemplate</span><span style="color: #333333;"> </span><span style="color: #333333;">FooterViewTemplate</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIViewTemplate</span><span style="color: #333333;">(</span><span style="color: #3364a4;">DetailFooterLayout</span><span style="color: #333333;">.</span><span style="color: #333333;">Nib</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<p>And here&#8217;s the <strong>DetailFooterLayout</strong>.</p>
<p><img class="alignnone size-full wp-image-7916" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/status-label-ios.png" alt="status-label-ios.png" width="1822" height="1080" /></p>
<p>Then in the BindingProvider, we bind the label to.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">StatusLabel</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">TextProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindingDescription</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">TabViewModel</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">Assignment</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">TotalLaborHours</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> StringFormat </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Labor</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">Hours</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">(</span><span style="color: #f57d00;">{</span><span style="color: #f57d00;">0</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">0</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">}</span><span style="color: #f57d00;">)</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;"> </span><span style="color: #333333;">})</span><span style="color: #333333;">;</span></span></p>
<p>Which corresponds to the parent ViewModel (TabViewModel) property&#8217;s active Assignment with its <strong>TotalLaborHours</strong> property.</p>
<p><span style="font-family: Menlo;"> <span style="color: #333333;">[</span><span style="color: #3364a4;">IgnoreDataMember</span><span style="color: #333333;">]</span><br />
<span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">double</span><span style="color: #333333;"> </span><span style="color: #333333;">TotalLaborHours</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">TimeSpan</span><span style="color: #333333;">.</span><span style="color: #333333;">FromTicks</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Labors</span><span style="color: #333333;">.</span><span style="color: #333333;">Sum</span><span style="color: #333333;">(</span><span style="color: #333333;">o</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">Ticks</span><span style="color: #333333;">))</span><span style="color: #333333;">.</span><span style="color: #333333;">TotalHours</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<p>This way, we should be able to centralize the labor hours binding to the same property, eliminating unnecessary workarounds to elegantly achieve this effect.</p>
<h1>Validating Input Using Form Validation Metadata</h1>
<p>When you input a new labor hour entry, or edit an existing one. If you open the <strong>FieldServiceModel.Metadata.cs</strong> file inside <strong>FieldService.Core/DomainModels</strong> folder, you&#8217;ll see the following.</p>
<p><img class="alignnone size-full wp-image-7937" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/validation-metadata.png" alt="validation-metadata.png" width="1976" height="960" /></p>
<p>If you notice there, there are two validation metadata, one is for the Expense entry and one is for the Labor entry. In this example, we&#8217;ve ensured that the Ticks property is a Required Entry and the minimum number for the ticks is 1. Once these conditions are satisfied, then the form is considered a vaild entry and the changes will be saved. Similar to the Expense entry, we&#8217;ve enforced that the Price should be greater than 1.</p>
<p><img class="alignnone size-full wp-image-7944" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/labor-hours-validation.png" alt="labor-hours-validation.png" width="1496" height="1136" /></p>
<p>The important thing to ensure that the validation metadata works properly is that you create a partial class from the model that you want to validate, and decorate it with the <strong>EntityMetadataAttribute</strong>.</p>
<p><span style="font-family: Menlo;"> <span style="color: #333333;">[</span><span style="color: #3364a4;">EntityMetadata</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #3364a4;">Labor</span><span style="color: #333333;">.</span><span style="color: #3364a4;">LaborValidationMetadata</span><span style="color: #333333;">))]</span><br />
<span style="color: #009695;">partial</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Labor</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LaborValidationMetadata</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Required</span><span style="color: #333333;">]</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Min</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #009695;">long</span><span style="color: #333333;">)</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> ErrorMessage </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Hours</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">must</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">be</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">greater</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">than</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">0</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">long</span><span style="color: #333333;"> </span><span style="color: #333333;">Ticks</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">get</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #009695;">set</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<h1>The Expense Screen</h1>
<p>The Expense screen also uses pretty much the same technique with the Items and Labor Hours screen, which uses popover for adding new items and modal ViewController for the editing screen.</p>
<p><img class="alignnone size-full wp-image-7959" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/expense-screen-ios.png" alt="expense-screen-ios.png" width="1938" height="1458" /></p>
<p>When you go to the editor screen, we improved on the Form Builder experience a bit to support the image editor detail scenario as follows.</p>
<p><img class="alignnone size-full wp-image-7964" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/edit-image-form-builder.png" alt="edit-image-form-builder.png" width="2000" height="1417" /></p>
<p>And in Android,</p>
<p><img class="alignnone size-full wp-image-7966" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/image-editor-android.png" alt="image-editor-android.png" width="2000" height="1239" /></p>
<p>The FormMetadata is as simply as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ImageSection</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #333333;">Editor</span><span style="color: #333333;">(</span><span style="color: #333333;">EditorType</span><span style="color: #333333;">.</span><span style="color: #333333;">Image</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #333333;">Layout</span><span style="color: #333333;">(</span><span style="color: #333333;">Style </span><span style="color: #333333;">=</span><span style="color: #333333;"> LayoutStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">DetailOnly</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #333333;">Image</span><span style="color: #333333;">(</span><span style="color: #333333;">Height </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">200</span><span style="color: #333333;">,</span><span style="color: #333333;"> Placeholder </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">photo</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">png</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> Padding </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">8</span><span style="color: #333333;">,</span><span style="color: #333333;"> ScaleMode </span><span style="color: #333333;">=</span><span style="color: #333333;"> ImageScaleMode</span><span style="color: #333333;">.</span><span style="color: #333333;">ScaleAspectFill</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #333333;">ImagePicker</span><span style="color: #333333;">(</span><span style="color: #333333;">ImageResultMode </span><span style="color: #333333;">=</span><span style="color: #333333;"> ImageResultMode</span><span style="color: #333333;">.</span><span style="color: #333333;">Both</span><span style="color: #333333;">,</span><span style="color: #333333;"> UseThumbnailResult </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">,</span><span style="color: #333333;"> PickerResultCommand </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">FinishImagePickerCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #009695;">byte</span><span style="color: #333333;">[]</span><span style="color: #333333;"> </span><span style="color: #333333;">Image</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<h1>Jump to Complete Screen</h1>
<p>Another interesting interaction in this app is how you can directly jump to the Complete screen when you decide Complete the assignment, either from the List screen, Map screen, or from the assignment detail.</p>
<p><img class="alignnone size-full wp-image-7970" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/jump-complete-android.png" alt="jump-complete-android.png" width="2000" height="620" /></p>
<p>Due to the Single Responsibility principle that we&#8217;ve used in this application, achieving this scenario is very easy. In the <strong>AssignmentViewModel</strong>, simply navigate to the Confirmation screen.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteComplete</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">bool</span><span style="color: #333333;"> </span><span style="color: #333333;">isFromConfirmationPage</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">isFromConfirmationPage</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ExecutePendingOrComplete</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Complete</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ActiveViewModel</span><span style="color: #333333;"> </span><span style="color: #009695;">is</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AssignmentDetailTabViewModel</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">already</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">in</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">detail</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">view</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">focus</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">to</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">confirmation</span><span style="font-style: italic; color: #888888;"> screen</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SetDetailSelectedIndex</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">we</span><span style="font-style: italic; color: #888888;">&#8216;</span><span style="font-style: italic; color: #888888;">re</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">in</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">main</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">view</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">perform</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">navigation</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">to</span><span style="font-style: italic; color: #888888;"> detail</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AutoFocusToConfirmation</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ExecuteNavigateToDetail</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></span></p>
<h1>The Completion Screen</h1>
<p>In the Completion screen, you&#8217;ll be greeted with two major UI elements: the Photos Grid/Collection View and a Signature Pad. If you try to complete the assignment immediately without entering any signature, you&#8217;ll get a toast message as follows.</p>
<p><img class="alignnone size-full wp-image-7989" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/android-completion.png" alt="android-completion.png" width="1783" height="1136" /></p>
<p>You can add additional photos when completing the assignment for extra information.</p>
<p><img class="alignnone size-full wp-image-7992" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/04/add-photo-completion.png" alt="add-photo-completion.png" width="1784" height="1136" /></p>
<p>The code to execute the completion of an assignment is pretty straightforward.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteComplete</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">.</span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Complete</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ToastPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">Show</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">This</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">assignment</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">already</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">completed</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">else</span><span style="color: #333333;"> </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">.</span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Active</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Signature</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #009695;">null</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ToastPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">Show</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">To</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">complete</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">this</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">assignment</span><span style="color: #f57d00;">,</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">please</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">draw</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">your</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">sign</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">in</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">the</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">signature</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">pad</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">return</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">.</span><span style="color: #333333;">Signature</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Signature</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">TabViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">AssignmentViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">ExecuteComplete</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">IsSignatureImageViewVisible</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">IsSignatureCanvasVisible</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">CompleteCommand</span><span style="color: #333333;">.</span><span style="color: #333333;">RaiseCanExecuteChanged</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddPhotoCommand</span><span style="color: #333333;">.</span><span style="color: #333333;">RaiseCanExecuteChanged</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ClearSignatureCommand</span><span style="color: #333333;">.</span><span style="color: #333333;">RaiseCanExecuteChanged</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ToastPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">Show</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Assignment</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">completed</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ToastPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">Show</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">You</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">need</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">to</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">activate</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">the</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">assignment</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">first</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>You can also clear the signature you&#8217;ve entered by hitting the Clear button above the Signature Pad.</p>
<h1>Disable Editing After Completed</h1>
<p>After you&#8217;ve completed an assignment, you won&#8217;t be able to make any changes to any of the items available in the Assignment Detail. This includes Items, Labor Hours, Expenses, Photos and Signature. This is possible because we simply need to check for the current Assignment&#8217;s Status and see if an operation can be completed.</p>
<p><span style="font-family: Menlo;"> <span style="color: #333333;">[</span><span style="color: #3364a4;">MaxLength</span><span style="color: #333333;">(</span><span style="color: #f57d00;">255</span><span style="color: #333333;">)]</span><br />
<span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><br />
<span style="color: #333333;">{</span><span style="color: #333333;"> </span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">string</span><span style="color: #333333;">)</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">GetValue</span><span style="color: #333333;">(</span><span style="color: #333333;">StatusPropertyMetadata</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><span style="color: #333333;"> </span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">set</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SetValue</span><span style="color: #333333;">(</span><span style="color: #333333;">StatusPropertyMetadata</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">value</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><span style="color: #333333;"> </span><br />
<span style="color: #333333;">}</span></span></p>
<p>In the ViewModel, you would simply override the CanExecute method and see if the assignment is completed before executing your method.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">bool</span><span style="color: #333333;"> </span><span style="color: #333333;">CanExecuteSave</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">!</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">IsNewItem</span><span style="color: #333333;"> </span><span style="color: #333333;">&amp;&amp;</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;">.</span><span style="color: #333333;">Assignment</span><span style="color: #333333;">.</span><span style="color: #333333;">Status</span><span style="color: #333333;"> </span><span style="color: #333333;">==</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Complete</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">false</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">    </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">base</span><span style="color: #333333;">.</span><span style="color: #333333;">CanExecuteSave</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<p>This is done so elegantly that you don&#8217;t have to access any of the platform-specific views to accomplish this.</p>
<h1>Wrapping Up</h1>
<p>Hopefully this post provides you with even more insights on what&#8217;s happening behind the scenes with the new Crosslight Field Service sample. If you&#8217;d like to see more Xamarin samples to be converted to Crosslight, please do let us know in the comments section below.</p>
<p>Till next post,<br />
Nicholas Lie</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2016/04/redesigning-xamarin-field-service-sample-with-crosslight-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://developer.intersoftsolutions.com/download/attachments/24805642/blur-footer.mp4?api=v2" length="406271" type="video/mp4" />
		</item>
		<item>
		<title>Crosslight Field Service is now available!</title>
		<link>http://blog.intersoftsolutions.com/2016/04/crosslight-field-service-is-now-available/</link>
		<comments>http://blog.intersoftsolutions.com/2016/04/crosslight-field-service-is-now-available/#comments</comments>
		<pubDate>Fri, 01 Apr 2016 10:28:22 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2016 R1]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Reference Samples]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Crosslight 5]]></category>
		<category><![CDATA[Samples]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=7586</guid>
		<description><![CDATA[Good news! For those of you who&#8217;ve waited for so long for Crosslight Field Service sample, it&#8217;s now available here. This sample highlights many of the best practices found when developing Crosslight applications with no tedious workarounds whatsoever. Works on iPhone, iPad, Android phones and tablets, this sample sets a new standard for Crosslight [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/banner-fieldservice2-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="banner-fieldservice" style="float:right; margin:0 0 10px 10px;" /><p>Good news! For those of you who&#8217;ve waited for so long for Crosslight Field Service sample, it&#8217;s now available <a href="http://git.intersoftsolutions.com/projects/CS/repos/app-fieldservice/browse" target="_blank">here</a>. This sample highlights many of the best practices found when developing Crosslight applications with no tedious workarounds whatsoever. Works on iPhone, iPad, Android phones and tablets, this sample sets a new standard for Crosslight app development.</p>
<p><img class="alignnone size-full wp-image-7612" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/banner-fieldservice2.png" alt="banner-fieldservice.png" width="2560" height="1005" /></p>
<p class="p1"><span class="s1">Features highlight:</span></p>
<ul class="ul1">
<li class="li1"><span class="s1">Works on iOS and Android, on both phones and tablets devices.</span></li>
<li class="li1"><span class="s1">Showcases best coding practices when using Crosslight.</span></li>
<li class="li1"><span class="s1">Supports Dialog Presenter on tablet mode.</span></li>
<li class="li1"><span class="s1">True data binding capabilities with UI live updates.</span></li>
<li class="li1"><span class="s1">Saving and loading data through SQLite.</span></li>
<li class="li1"><span class="s1">Crosslight Form Builder to create a truly versatile form that works consistently on iOS and Android.</span></li>
<li class="li1"><span class="s1">FooterViewTemplate on iOS that mimics Apple-style app.</span></li>
<li class="li1"><span class="s1">The use of Crosslight Signature Pad to obtain customer&#8217;s signature upon assignment completion.</span></li>
<li class="li1"><span class="s1">Deep navigation to the completion screen when attempting to complete an assignment.</span></li>
<li class="li1"><span class="s1">Full iOS storyboard support.</span></li>
<li class="li1"><span class="s1">Use of CollectionView/GridView for photos.</span></li>
<li class="li1"><span class="s1">Supports changing ViewController&#8217;s Status Bar Style at runtime.</span></li>
<li class="li1">Showing directions with the Crosslight Location Service.</li>
</ul>
<p>If you haven&#8217;t figured out why we made this sample, I highly recommend you to check out the my previous <a href="http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/" target="_blank">blog post</a> where I highlight many parts of the sample that can be fixed and enhanced to produce a better app with Crosslight.</p>
<p>In the next blogpost, I&#8217;m going to elaborate more on the interesting scenarios found in this sample and the code behind to achieve each scenarios gracefully, which will hopefully be of great tips for seasoned and pro Crosslight developers alike.</p>
<p>Stay tuned,<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2016/04/crosslight-field-service-is-now-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performing Data Binding to Native Views with Crosslight</title>
		<link>http://blog.intersoftsolutions.com/2016/03/performing-data-binding-to-native-views-with-crosslight/</link>
		<comments>http://blog.intersoftsolutions.com/2016/03/performing-data-binding-to-native-views-with-crosslight/#comments</comments>
		<pubDate>Tue, 22 Mar 2016 09:58:28 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Getting Started Guide]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Materials]]></category>
		<category><![CDATA[form builder]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Xamarin Forms]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=7327</guid>
		<description><![CDATA[In my last post, I wrote an in-depth, step-by-step tutorial on how to create you can migrate a Xamarin.Forms sample and turn it into a Crosslight solution. The process might seem intricate at first, but once you understood the basics of Crosslight and its design pattern, you&#8217;ll be able to [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/login-view-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="login-view" style="float:right; margin:0 0 10px 10px;" /><p>In my <a href="http://blog.intersoftsolutions.com/2016/03/migrating-from-xamarin-forms-to-crosslight-app" target="_blank">last post</a>, I wrote an in-depth, step-by-step tutorial on how to create you can migrate a Xamarin.Forms sample and turn it into a Crosslight solution. The process might seem intricate at first, but once you understood the basics of Crosslight and its design pattern, you&#8217;ll be able to do things very quickly. That&#8217;s made possible as Crosslight enforces clear separation-of-concerns and strong and extensible design patterns.</p>
<p>In this post, I&#8217;m going to modify the login screen from the finished sample in the previous blog post to use the native UI views instead of Crosslight Form Builder. Hopefully at the end of tutorial you&#8217;ll have rough ideas how to bind data to native UI views with Crosslight, and gain insights how to take advantage of many different Crosslight features to achieve a goal in the most efficient way.</p>
<p><img class="alignnone size-full wp-image-7350" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/login-view.png" alt="login-view.png" width="2000" height="867" /></p>
<h1>Starting Off</h1>
<p>To follow this tutorial perfectly, you&#8217;ll need clone <a href="http://git.intersoftpt.com/projects/CT/repos/crosslightxamarinformsbuilder/browse" target="_blank">this repository</a>. This is the finished sample from the previous blog post. To run this sample, you&#8217;ll need to restore the necessary NuGet packages. After you&#8217;ve managed to clone and run this sample, you&#8217;re ready to begin. If you have any trouble in restoring the NuGet packages, consult <a href="http://developer.intersoftsolutions.com/display/crosslight/Introduction+to+Crosslight+NuGet+Packages" target="_blank">the documentation</a>.</p>
<h1>Modifying the Android Login View</h1>
<p>First, open up the <strong>LoginFragment.cs</strong> located inside the <strong>XamarinFormsSample.Android/Fragments</strong> folder. Replace the contents with this code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Runtime</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">BindingProviders</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">v7</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Fragments</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     The main Fragment contained inside LoginActivity.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     This class is decorated with the ImportBindingAttribute that indicates</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     the binding provider to be used with this Activity.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">ImportBinding</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #3364a4;">LoginBindingProvider</span><span style="color: #333333;">))]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginFragment</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Fragment</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LoginViewModel</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes a new instance of the </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">see</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">LoginFragment</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;"> class.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginFragment</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes a new instance of the </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">see</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">LoginFragment</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;"> class.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">javaReference</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The java reference.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">transfer</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The transfer.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginFragment</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IntPtr</span><span style="color: #333333;"> </span><span style="color: #333333;">javaReference</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">JniHandleOwnership</span><span style="color: #333333;"> </span><span style="color: #333333;">transfer</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #009695;">base</span><span style="color: #333333;">(</span><span style="color: #333333;">javaReference</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #333333;">transfer</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Properties</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Gets the content layout identifier.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">value</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The content layout identifier.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">value</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">int</span><span style="color: #333333;"> </span><span style="color: #333333;">ContentLayoutId</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Resource</span><span style="color: #333333;">.</span><span style="color: #3364a4;">Layout</span><span style="color: #333333;">.</span><span style="color: #333333;">main</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Methods</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes this instance.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">Initialize</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">base</span><span style="color: #333333;">.</span><span style="color: #333333;">Initialize</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">IconId</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Resource</span><span style="color: #333333;">.</span><span style="color: #3364a4;">Drawable</span><span style="color: #333333;">.</span><span style="color: #333333;">ic_toolbar</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>The FormFragment requires 2 default constructors, which is becoming the new standard for Fragment initialization when using the new Material library. The <strong>ContentLayoutId</strong> defines the layout file that will be used to render this screen. Then the <strong>IconId</strong> is provided for the Toolbar icon that will be used with this view. Then create the <strong>main.axml</strong> layout inside the <strong>XamarinFormsSample.Android/Resources/layout</strong> folder. Use the following layout.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">&lt;?</span><span style="color: #333333;">xml</span><span style="color: #333333;"> </span><span style="color: #333333;">version</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">0</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;"> </span><span style="color: #333333;">encoding</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">utf</span><span style="color: #f57d00;">&#8211;</span><span style="color: #f57d00;">8</span><span style="color: #f57d00;">&#8220;</span><span style="color: #009695;">?&gt;</span><br />
<span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #3364a4;"> </span><span style="color: #333333;">xmlns:android</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">http</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">schemas</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">com</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">apk</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">res</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_marginLeft</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">30dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_marginRight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">30dp</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">android</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">support</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">design</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">widget</span><span style="color: #3364a4;">.TextInputLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">EditText</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">TxtUserName</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:singleLine</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">true</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:hint</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@string</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">hint_username</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">android</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">support</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">design</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">widget</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">TextInputLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">android</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">support</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">design</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">widget</span><span style="color: #3364a4;">.TextInputLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">EditText</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">TxtPassword</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:singleLine</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">true</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:hint</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@string</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">hint_password</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">android</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">support</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">design</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">widget</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">TextInputLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Button</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">BtnLogin</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:text</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@string</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">login</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span></span></p>
<p>Similar to previous login form, this screen contains two <strong>EditText</strong>s, with the ID <strong>TxtUserName</strong> and <strong>TxtPassword</strong> respectively. These two <strong>EditText</strong>s are wrapped in inside a <strong>TextInputLayout</strong>. This is a relatively new layout available in Material Design that provides intuitive hinting when used inside a <strong>EditText</strong>. Next, we&#8217;re going bind these textboxes to the ViewModel using the <strong>BindingProvider</strong>.</p>
<p>Create a new BindingProvider inside the <strong>XamarinFormsSample/BindingProviders</strong> folder and call it <strong>LoginBindingProvider</strong>. Use the following code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">BindingProviders</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginBindingProvider</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindingProvider</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginBindingProvider</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">TxtUserName</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">TextProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">LoginInfo</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">UserName</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindingMode</span><span style="color: #333333;">.</span><span style="color: #333333;">TwoWay</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">TxtPassword</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">TextProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">LoginInfo</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">Password</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindingMode</span><span style="color: #333333;">.</span><span style="color: #333333;">TwoWay</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">BtnLogin</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">LoginCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>This is the BindingProvider that provides data binding definitions between the View and the ViewModel. We&#8217;re basically binding both of the views with ID <strong>TxtUserName</strong> and <strong>TxtPassword</strong>, bind their Text property to the <strong>LoginInfo.UserName</strong> in the ViewModel. Then we also bind the view with ID <strong>BtnLogin</strong> to the <strong>LoginCommand</strong>.</p>
<blockquote><p>One question we often heard is, why the binding provider is not needed when using Crosslight Form Builder while it&#8217;s needed in native views binding? That&#8217;s because the form metadata automatically map the defined property to the underlying model, and a binding is created behind the scene as the Form Builder generates the views at runtime.</p></blockquote>
<p>Since we&#8217;re no longer using Form Builder for the login screen, you can safely delete the <strong>LoginInfo.FormMetadata</strong> file found inside the <strong>XamarinFormsSample/Forms</strong> folder.</p>
<p><img class="alignnone size-full wp-image-7393" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/form-metadata.png" alt="form-metadata.png" width="250" height="344" /></p>
<p>Next, we need to modify the <strong>LoginViewModel</strong> a bit. Open up the <strong>LoginViewModel.cs</strong> file inside the <strong>XamarinFormsSample/ViewModels</strong> folder and modify the <strong>ExecuteLogin</strong> method. Replace it with the following snippet.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">private</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteLogin</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">!</span><span style="color: #009695;">string</span><span style="color: #333333;">.</span><span style="color: #333333;">IsNullOrEmpty</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">LoginInfo</span><span style="color: #333333;">.</span><span style="color: #333333;">UserName</span><span style="color: #333333;">)</span><span style="color: #333333;"> </span><span style="color: #333333;">&amp;&amp;</span><span style="color: #333333;"> !</span><span style="color: #009695;">string</span><span style="color: #333333;">.</span><span style="color: #333333;">IsNullOrEmpty</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">LoginInfo</span><span style="color: #333333;">.</span><span style="color: #333333;">Password</span><span style="color: #333333;">))</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">NavigationService</span><span style="color: #333333;">.</span><span style="color: #333333;">Navigate</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">EmployeeListViewModel</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ToastPresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">Show</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Please</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">enter</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">any</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">username</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">and</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">password</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></span></p>
<p>Also, change the base class of this ViewModel to <strong>ViewModelBase</strong> instead of <strong>EditorViewModelBase</strong>. <strong>EditorViewModelBase</strong> is used when you&#8217;re taking advantage of Crosslight Form Builder&#8217;s capabilities. To learn more about suitable ViewModels to use when designing Crosslight applications, see <a href="http://developer.intersoftsolutions.com/display/crosslight/Selecting+a+ViewModel+Base+Class+to+Get+Started?src=search" target="_blank">Selecting a ViewModelBase Class to Get Started</a>.</p>
<p>This is a similar, but a more manual validation that you can use to validate whether the user has entered any username or password before performing login. One more thing, you can now remove the <strong>Validate</strong> method inside the <strong>Login.cs</strong> located inside the <strong>XamarinFormsSample/Models</strong> folder, since we&#8217;re not using any built-in validation methods.</p>
<p><img class="alignnone size-full wp-image-7406" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/validate.png" alt="validate.png" width="1172" height="400" /></p>
<p>Now you&#8217;re ready to see this feature in action. When you run the project, you should get the following result.</p>
<p><img class="alignnone size-full wp-image-7410" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/login-android.png" alt="login-android.png" width="400" height="1136" /></p>
<p>Now that you&#8217;ve finished the Android sample, let&#8217;s move on to iOS.</p>
<h1>Modifying the iOS Login View</h1>
<p>To modify the iOS sample, let&#8217;s begin by modifying the <strong>LoginViewController </strong>located inside <strong>XamarinFormsSample.iOS/ViewControllers</strong> folder. Use the following code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">BindingProviders</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">iOS</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">iOS</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Storyboard</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">MainStoryboard</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">ImportBinding</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #3364a4;">LoginBindingProvider</span><span style="color: #333333;">))]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">partial</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginViewController</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIViewController</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LoginViewModel</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes a new instance of the </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">see</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">LoginViewController</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;"> class.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">intPtr</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The int PTR.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginViewController</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IntPtr</span><span style="color: #333333;"> </span><span style="color: #333333;">intPtr</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #009695;">base</span><span style="color: #333333;">(</span><span style="color: #333333;">intPtr</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Properties</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">bool</span><span style="color: #333333;"> </span><span style="color: #333333;">HideKeyboardOnTap</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>As you can see, for the <strong>LoginViewController</strong>, all you need to do is provide a default constructor that takes in one <strong>IntPtr</strong> object, then decorate the ViewController with the <strong>StoryboardAttribute</strong>. The <strong>&#8220;MainStoryboard&#8221;</strong> string inside the <strong>StoryboardAttribute</strong> indicates the name of the storyboard file that this ViewController will use.</p>
<p>Also notice that we longer subclass from the <strong>UIFormViewController</strong>, but from a simpler <strong>UIViewController</strong> instead. Since we already have the ViewModel and BindingProviders ready, all you need to is create the Storyboard file for this view. Begin by creating a new folder called <strong>Views</strong> inside the iOS project. Then inside the newly created folder, create a new <strong>Storyboard</strong> file called <strong>MainStoryboard.storyboard</strong>. Follow this video to learn how to create a Storyboard file.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/67_daaEbJTc?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>Basically, we&#8217;re creating two <strong>UITextField</strong>s with outlets set to <strong>TxtUserName</strong> and <strong>TxtPassword</strong>. Then we&#8217;re placing a <strong>UIButton</strong> underneath the textboxes, with outlet set to <strong>BtnLogin</strong>, all stacked inside a <strong>StackView</strong>. If you prefer to use the finished storyboard file, you can simply use the file <a href="http://git.intersoftsolutions.com/projects/CT/repos/crosslightxamarinforms/browse/XamarinFormsSample.iOS/Views/MainStoryboard.storyboard" target="_blank">here</a> and replace it onto your project.</p>
<p>Before you can run this project, you have to make several adjustments, such as ensuring the <strong>Target Deployment</strong> for this project is set at least to <strong>iOS 9 </strong>or higher, this is the due to the usage of the <strong>StackView</strong>. To do this, simply open the <strong>Info.plist</strong> file inside the <strong>XamarinFormsSample.iOS</strong> project.</p>
<p><img class="alignnone size-full wp-image-7445" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/info-plist.png" alt="info-plist.png" width="400" height="400" /></p>
<p>After you&#8217;ve made these adjustments, you should be ready to go. Also, if you try to run this project and it suddenly closes on its own, that means you haven&#8217;t set the compatibility mode to 64-bit for this project. To do this, simply double-click the iOS project and go to <strong>iOS Build</strong> and ensure that the build configuration for <strong>Debug | iPhone Simulator</strong> has been set to the following.</p>
<p><img class="alignnone size-full wp-image-7451" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-22-at-4.59.58-PM.png" alt="Screen Shot 2016-03-22 at 4.59.58 PM.png" width="1848" height="1461" /></p>
<p>After running the sample, you should get the following result.</p>
<p><img class="alignnone size-full wp-image-7454" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/login-ios.png" alt="login-ios.png" width="400" height="1136" /></p>
<h1>Samples</h1>
<p>You can find the finished sample to this tutorial <a href="http://git.intersoftsolutions.com/projects/CT/repos/crosslightxamarinforms/browse" target="_blank">here</a>. Simply restore the NuGet packages and you&#8217;re ready to go.</p>
<h1>Wrapping Up</h1>
<p>Hopefully this tutorial gives you a brief idea on how data binding works in Crosslight, especially when you&#8217;re binding to native views. By using the native views, you have greater flexibility on how to layout your screen while continue enjoying 100% UI logic sharing.</p>
<p>At this point, you&#8217;ve learned two approaches to build data-bound views in Crosslight. The first is through Form Builder, and the other is through native views. Thankfully, you don&#8217;t have to choose, as you can always mix both of them in your Crosslight project. However, you might be wondering which one does better than the other, and when to use them. <strong>The rule of thumb is</strong>, use Form Builder when you need to rapidly build complex data entry screen such as search screens and editing screens. As for native views, it&#8217;s best for non editable screens such as detail screen which typically require custom layout and design. Native views can also be considered for input screens with fairly few text input such as login screen which is usually highly customized to represent the app&#8217;s branding and styles.</p>
<p class="p1"><span class="s1">If you&#8217;d like to explore further, I highly recommend you to go through each of these topics to quench your thirst:</span></p>
<ul>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Building+Rich+Data+Entry+Form" target="_blank">Building Rich Data Entry Form</a>
<ul>
<li>If you&#8217;d like to get started with the Form Builder, I highly recommend you to look at the two-part blogpost series I wrote up: <a href="http://blog.intersoftsolutions.com/2015/11/getting-started-with-crosslight-form-builder/" target="_blank">Getting Started with Crosslight Form Builder</a> and <a href="http://blog.intersoftsolutions.com/2015/11/extending-crosslight-form-builder-2/" target="_blank">Extending Crosslight Form Builder</a>.</li>
</ul>
</li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Working+with+iOS+Universal+Storyboards" target="_blank">Working with iOS Universal Storyboards</a></li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Crosslight+Android+Material+Development" target="_blank">Crosslight Android Material Development</a></li>
</ul>
<p>Don&#8217;t hesitate to explore the child pages on the documentation as well, as it contains more detailed information on each particular subject. Hopefully this tutorial helps you on grasping the concepts used in Crosslight development and accelerate in building gorgeous cross-platform apps, without sacrificing any user experiences along the way.</p>
<p>Cheers,<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2016/03/performing-data-binding-to-native-views-with-crosslight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating from Xamarin.Forms to Crosslight App</title>
		<link>http://blog.intersoftsolutions.com/2016/03/migrating-from-xamarin-forms-to-crosslight-app/</link>
		<comments>http://blog.intersoftsolutions.com/2016/03/migrating-from-xamarin-forms-to-crosslight-app/#comments</comments>
		<pubDate>Tue, 22 Mar 2016 07:52:56 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2016 R1]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Getting Started Guide]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Material]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iOS 9]]></category>
		<category><![CDATA[Xamarin]]></category>
		<category><![CDATA[Xamarin Forms]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=6735</guid>
		<description><![CDATA[Many mobile developers who are just starting out with Crosslight often asked us with this question: I have an existing Xamarin.Forms app and would like to get started with Crosslight. How can I do that? This post aims to provide the answer to that question. However, I&#8217;d [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/xamarin-vs-crosslight-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="xamarin-vs-crosslight" style="float:right; margin:0 0 10px 10px;" /><p><img class="alignnone size-full wp-image-6831" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/xamarin-forms-vs-crosslight.png" alt="xamarin-forms-vs-crosslight.png" width="1902" height="986" /></p>
<p>Many mobile developers who are just starting out with Crosslight often asked us with this question: I have an existing Xamarin.Forms app and would like to get started with Crosslight. How can I do that? This post aims to provide the answer to that question. However, I&#8217;d have to be straightforward to you. There&#8217;s no easy way, since Xamarin.Forms isn&#8217;t compatible with Crosslight at all.</p>
<h1>Xamarin.Forms vs. Crosslight</h1>
<p>When should you build with Xamarin.Forms? According to <a href="https://xamarin.com/forms" target="_blank">Xamarin&#8217;s site</a>:</p>
<p><img class="alignnone size-full wp-image-6755" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/xamarin-native-vs-xamarin-forms.png" alt="xamarin-native-vs-xamarin-forms.png" width="1910" height="1136" /></p>
<p>Well, in our opinion, the best time to use Xamarin.Forms is never to use it all. Why? There are two reasons: user experience and design pattern.</p>
<h2>The User Experience</h2>
<p>Sure, with Xamarin.Forms you can create an app that works. Even though you&#8217;re building a simple app that works, developers should at least pay attention to user experience. If the user experience is bad, prepare to receive 4-or-less-stars all over the App Store and Play Store. How bad is the user experience with Xamarin.Forms? Here&#8217;s two quick videos taken when running the XamarinFormsSample from Xamarin&#8217;s <a href="https://developer.xamarin.com/samples/xamarin-forms/GettingStarted/" target="_blank">Introduction to Xamarin.Forms</a>. One for Android:</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/90xky2TPQoA?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>And another for iOS:</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/4bzhqZo5RS0?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>What do you think? I&#8217;m not even sure where to begin. Xamarin.Forms tries to generalize the user experience for all platforms, which is not a good idea. When the app is first launched, a blank table view is shown. And then when the + button is tapped, a login form is shown. Why not display a login form at the beginning instead? On iOS, I&#8217;m not quite sure I&#8217;ve seen an app that places the Save button side-by-side with the Delete button.  Typically, they&#8217;re placed on the navigation controller as bar items. What&#8217;s worse, when I try to rotate the iOS sample, the bottom section below the image is practically unusable. In Android, when I rotate the device, I&#8217;m automatically kicked back out to the ListView screen and the list seems to be corrupted. Magic. Let&#8217;s compare them with the converted sample to Crosslight.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/SiL5bgiMoCc?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>And here&#8217;s on the one on Android.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/jChXcOtMTmE?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>I&#8217;ll let you be the judge. Take a look with the forms created with Crosslight Form Builder.</p>
<p><img class="alignnone size-full wp-image-7324" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/xamarin-forms-rotation.png" alt="xamarin-forms-rotation.png" width="2000" height="709" /></p>
<p>With the Form Builder, you can easily create beautiful forms that complies with each platform&#8217;s user experience guidelines. And they&#8217;re all working correctly without any annoying user experience found in Xamarin.Forms. Buttons are correctly placed and rotation works perfectly. This is what a &#8220;minimal-working&#8221; app should look like.</p>
<h2>The Design Pattern</h2>
<p>Let&#8217;s take a brief look at the Xamarin.Forms code for the editor screen. Click on the image to see the large version.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/xamarin-forms-code.png"><img class="alignnone size-full wp-image-7323" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/xamarin-forms-code.png" alt="xamarin-forms-code.png" width="1603" height="2000" /></a></p>
<p>As you can see, Crosslight Form Builder showcases a better pattern where you design a form focused more on the model, rather than the View, as the View approach will not produce native-looking forms when used in cross-platform fashion. With Crosslight, developers are focused on models, making the View loosely-coupled. This will also lead in better long-term extensibility and clearer separation of concerns. Also, you&#8217;ll notice that the code to build forms are much lighter and shorter.</p>
<blockquote><p>It&#8217;s important to note that Form Builder is only one of many features available in Crosslight. In addition to Form Builder, developers can use Crosslight&#8217;s advanced data binding features to bind native views to a shared ViewModel and enjoy 100% UI logic reuse. However, this post specifically highlights the Form Builder feature to provide a comparable approach to Xamarin Forms.</p></blockquote>
<p>In this tutorial, I&#8217;m going to convert the existing sample XamarinFormsSample to Crosslight. In high-level overview, here&#8217;s what we&#8217;re going to accomplish:</p>
<ul>
<li>Add bootstrapper files for Android.</li>
<li>Remove Xamarin.Forms references.</li>
<li>Begin creating the views and ViewModels</li>
<li>Add bootstrapper files and views for Android.</li>
<li>Add bootstrapper files and views for iOS.</li>
</ul>
<p>Sounds good? Let&#8217;s begin.</p>
<h1>What You&#8217;ll Need</h1>
<p>To accomplish this tutorial perfectly, you&#8217;ll need to download the initial project from Xamarin&#8217;s website. Grab it <a href="https://developer.xamarin.com/samples/xamarin-forms/GettingStarted/GettingStarted.zip" target="_blank">here</a>. Extract the files and use only the <strong>XamarinFormsSample</strong> project.</p>
<p><img class="alignnone size-full wp-image-6865" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-18-at-9.37.20-AM.png" alt="Screen Shot 2016-03-18 at 9.37.20 AM.png" width="1764" height="1096" /></p>
<p>Open the .sln file and we&#8217;ll start from there. If you&#8217;re on Mac, you&#8217;ll need to have your Mobile Studio 2016 or higher installed on your Mac, since we&#8217;re going to be installing NuGet references via Xamarin Studio.</p>
<p>If you&#8217;re on Windows with Visual Studio, you should be able to follow this tutorial through without any hassles, since NuGet package management is built-in right into Visual Studio. You&#8217;ll also need to use at least Crosslight 5.0.5000.569 or higher. This package is available in the NuGet repository. We&#8217;ll add this package in the next step.</p>
<h1>Install Crosslight Packages</h1>
<p>Let&#8217;s begin by installing the necessary Crosslight references to these projects. If you&#8217;re on Mac, start by opening the <strong>Intersoft Package Console Extension</strong> from Xamarin Studio.</p>
<p><img class="alignnone size-full wp-image-6887" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/intersoft-package-console-extension.png" alt="intersoft-package-console-extension.png" width="1550" height="1028" /></p>
<ul>
<li>Install Intersoft.Crosslight package to all of your projects.<br />
<img class="alignnone size-full wp-image-6889" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/install-crosslight.png" alt="install-crosslight.png" width="1362" height="484" /></li>
<li>Install Intersoft.Crosslight.Android.v7 to the Android project.<br />
<img class="alignnone size-full wp-image-6891" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/install-crosslight-android-v7.png" alt="install-crosslight-android-v7.png" width="1468" height="480" /></li>
</ul>
<p>If you&#8217;re unfamiliar with installing Crosslight NuGet packages, it is highly recommended to check out the docs: <a href="http://developer.intersoftsolutions.com/display/crosslight/Introduction+to+Crosslight+NuGet+Packages" target="_blank">Introduction to Crosslight NuGet Packages</a>.</p>
<h1>Remove Xamarin.Forms References</h1>
<p>As radical as it seems, Crosslight is not designed to work with Xamarin.Forms, and therefore all Xamarin.Forms references have to be removed. Remove these highlighted references from your project.</p>
<p><img class="alignnone size-full wp-image-6897" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/remove-xamarin-forms.png" alt="remove-xamarin-forms.png" width="1588" height="734" /></p>
<p>After you&#8217;ve removed these references, make sure to double check the References folder once more, because there might be additional references such as these, which you need to remove as well.</p>
<p><img class="alignnone size-full wp-image-6903" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/xamarin-forms-references.png" alt="xamarin-forms-references.png" width="250" height="262" /></p>
<p>Also, remove the <strong>Views</strong> folder from the <strong>XamarinFormsSample</strong> (PCL) project entirely and including the <strong>Colours.cs</strong> and <strong>Fonts.cs</strong>.</p>
<p><img class="alignnone size-full wp-image-6957" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/remove-unnecessary-files-pcl.png" alt="remove-unnecessary-files-pcl.png" width="250" height="660" /></p>
<p>Also, you might want to remove references to <strong>Xamarin.Forms</strong> inside the <strong>packages.config</strong> that exists in each project, so you can easily update Crosslight assemblies for this project without the Xamarin.Forms references re-appearing each time.</p>
<p>&nbsp;</p>
<h1>Bootstrapping the PCL Project</h1>
<p>Add a new folder called <strong>Infrastructure</strong> inside the <strong>XamarinFormsSample</strong> (PCL) project and an empty class called <strong>AppService.cs.</strong></p>
<p><img class="alignnone size-full wp-image-6921" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/app-service.png" alt="app-service.png" width="250" height="264" /></p>
<p>Then replace the contents as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #c44c57;">Core</span><span style="color: #333333;">.</span><span style="color: #c44c57;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Infrastructure</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Crosslight&#8217;s shared application initializer.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     This is the perfect place to register repositories, custom services, and other dependencies via IoC.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">seealso</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">Intersoft</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">Crosslight</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">ApplicationServiceBase</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">sealed</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">CrosslightAppAppService</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ApplicationServiceBase</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes a new instance of the </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">see</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">CrosslightAppAppService</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;"> class.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">context</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     The application context that implements </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">see</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">T</span><span style="font-style: italic; color: #888888;">:</span><span style="font-style: italic; color: #888888;">Intersoft</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">Crosslight</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">IApplicationContext</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">CrosslightAppAppService</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IApplicationContext</span><span style="color: #333333;"> </span><span style="color: #333333;">context</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #009695;">base</span><span style="color: #333333;">(</span><span style="color: #333333;">context</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Methods</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Called when the application is starting.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">parameter</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The startup parameters.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">OnStart</span><span style="color: #333333;">(</span><span style="color: #3364a4;">StartParameter</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">base</span><span style="color: #333333;">.</span><span style="color: #333333;">OnStart</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;">Specify</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">first</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">ViewModel</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">to</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">use</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">when</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">launching</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">application</span><span style="font-style: italic; color: #888888;">.</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SetRootViewModel</span><span style="color: #333333;">&lt;</span><span style="color: #c44c57;">LoginViewModel</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>This is the application service for the Core project, which is the perfect place to register custom services and additional dependencies via IoC. In this project, we won&#8217;t add anything except for just simple constructor that takes in one <strong>IApplicationContext</strong> parameter. This is the default constructor for this class. Also, in the overridden OnStart method, we&#8217;ve defined the root ViewModel as <strong>LoginViewModel</strong>, which we will create in just a moment.</p>
<p>Next, add another empty class inside the <strong>Models</strong> folder and give it a name of <strong>ModelBase.cs</strong>.</p>
<p><img class="alignnone size-full wp-image-6929" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/model-base.png" alt="model-base.png" width="250" height="414" /></p>
<p>Replace the content as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">Collections</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">Collections</span><span style="color: #333333;">.</span><span style="color: #333333;">Generic</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">ComponentModel</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">Linq</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Models</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     A handy model class that conforms to Crosslight lifecycle.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Most of the time you will only need to subclass this class when introducing a new domain model.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Includes validation features as well.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">seealso</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">System</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">ComponentModel</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">INotifyPropertyChanged</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">seealso</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">System</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">ComponentModel</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">INotifyDataErrorInfo</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">seealso</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">Intersoft</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">Crosslight</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">IDataValidation</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ModelBase</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">INotifyPropertyChanged</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">INotifyDataErrorInfo</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">IDataValidation</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Fields</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">private</span><span style="color: #333333;"> </span><span style="color: #009695;">readonly</span><span style="color: #333333;"> </span><span style="color: #3364a4;">List</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">ValidationResult</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #333333;">_validationResultList</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">List</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">ValidationResult</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Properties</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Gets a value that indicates whether the entity has validation errors.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">virtual</span><span style="color: #333333;"> </span><span style="color: #009695;">bool</span><span style="color: #333333;"> </span><span style="color: #333333;">HasErrors</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">_validationResultList</span><span style="color: #333333;">.</span><span style="color: #333333;">Count</span><span style="color: #333333;">(</span><span style="color: #333333;">o</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> !</span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">IsSuccess</span><span style="color: #333333;">)</span><span style="color: #333333;"> </span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #f57d00;">0</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Methods</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Clears all errors.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ClearAllErrors</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #3364a4;">List</span><span style="color: #333333;">&lt;</span><span style="color: #009695;">string</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #333333;">properties</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">List</span><span style="color: #333333;">&lt;</span><span style="color: #009695;">string</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">foreach</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">var</span><span style="color: #333333;"> result </span><span style="color: #009695;">in</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">_validationResultList</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">foreach</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">var</span><span style="color: #333333;"> member </span><span style="color: #009695;">in</span><span style="color: #333333;"> </span><span style="color: #333333;">result</span><span style="color: #333333;">.</span><span style="color: #333333;">MemberNames</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">!</span><span style="color: #333333;">properties</span><span style="color: #333333;">.</span><span style="color: #333333;">Contains</span><span style="color: #333333;">(</span><span style="color: #333333;">member</span><span style="color: #333333;">))</span><br />
<span style="color: #333333;">                        </span><span style="color: #333333;">properties</span><span style="color: #333333;">.</span><span style="color: #333333;">Add</span><span style="color: #333333;">(</span><span style="color: #333333;">member</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">            </span><span style="color: #333333;">_validationResultList</span><span style="color: #333333;">.</span><span style="color: #333333;">Clear</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnErrorsChanged</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">foreach</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">string</span><span style="color: #333333;"> property </span><span style="color: #009695;">in</span><span style="color: #333333;"> </span><span style="color: #333333;">properties</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #333333;">property</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Clears the error.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">propertyName</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">Name of the property.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ClearError</span><span style="color: #333333;">(</span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">var</span><span style="color: #333333;"> </span><span style="color: #333333;">emptyValidationResult</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">List</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">ValidationResult</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">foreach</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">var</span><span style="color: #333333;"> result </span><span style="color: #009695;">in</span><span style="color: #333333;"> </span><span style="color: #333333;">_validationResultList</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">result</span><span style="color: #333333;">.</span><span style="color: #333333;">MemberNames</span><span style="color: #333333;">.</span><span style="color: #333333;">Contains</span><span style="color: #333333;">(</span><span style="color: #333333;">propertyName</span><span style="color: #333333;">))</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">((</span><span style="color: #3364a4;">IList</span><span style="color: #333333;">)</span><span style="color: #333333;"> </span><span style="color: #333333;">result</span><span style="color: #333333;">.</span><span style="color: #333333;">MemberNames</span><span style="color: #333333;">)</span><span style="color: #333333;">.</span><span style="color: #333333;">Remove</span><span style="color: #333333;">(</span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">                    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">!</span><span style="color: #333333;">result</span><span style="color: #333333;">.</span><span style="color: #333333;">MemberNames</span><span style="color: #333333;">.</span><span style="color: #333333;">Any</span><span style="color: #333333;">())</span><br />
<span style="color: #333333;">                        </span><span style="color: #333333;">emptyValidationResult</span><span style="color: #333333;">.</span><span style="color: #333333;">Add</span><span style="color: #333333;">(</span><span style="color: #333333;">result</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">foreach</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">var</span><span style="color: #333333;"> result </span><span style="color: #009695;">in</span><span style="color: #333333;"> </span><span style="color: #333333;">emptyValidationResult</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">_validationResultList</span><span style="color: #333333;">.</span><span style="color: #333333;">Remove</span><span style="color: #333333;">(</span><span style="color: #333333;">result</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnErrorsChanged</span><span style="color: #333333;">(</span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Gets all errors.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">returns</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">returns</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">IEnumerable</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">ValidationResult</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #333333;">GetAllErrors</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">_validationResultList</span><span style="color: #333333;">.</span><span style="color: #333333;">Where</span><span style="color: #333333;">(</span><span style="color: #333333;">o</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> !</span><span style="color: #333333;">o</span><span style="color: #333333;">.</span><span style="color: #333333;">IsSuccess</span><span style="color: #333333;">)</span><span style="color: #333333;">.</span><span style="color: #333333;">ToList</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Gets the validation errors for a specified property or for the entire entity.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">propertyName</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     The name of the property to retrieve validation errors for; or null or</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">see</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">F</span><span style="font-style: italic; color: #888888;">:</span><span style="font-style: italic; color: #888888;">System</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">String</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">Empty</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">, to retrieve entity-level errors.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">returns</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     The validation errors for the property or entity.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">returns</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">IEnumerable</span><span style="color: #333333;"> </span><span style="color: #333333;">GetErrors</span><span style="color: #333333;">(</span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">var</span><span style="color: #333333;"> </span><span style="color: #333333;">validationResult</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">List</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">ValidationResult</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">foreach</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">var</span><span style="color: #333333;"> result </span><span style="color: #009695;">in</span><span style="color: #333333;"> </span><span style="color: #333333;">_validationResultList</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">((</span><span style="color: #009695;">string</span><span style="color: #333333;">.</span><span style="color: #333333;">IsNullOrEmpty</span><span style="color: #333333;">(</span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><span style="color: #333333;"> || </span><span style="color: #333333;">result</span><span style="color: #333333;">.</span><span style="color: #333333;">MemberNames</span><span style="color: #333333;">.</span><span style="color: #333333;">Contains</span><span style="color: #333333;">(</span><span style="color: #333333;">propertyName</span><span style="color: #333333;">))</span><span style="color: #333333;"> </span><span style="color: #333333;">&amp;&amp;</span><span style="color: #333333;"> !</span><span style="color: #333333;">result</span><span style="color: #333333;">.</span><span style="color: #333333;">IsSuccess</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">validationResult</span><span style="color: #333333;">.</span><span style="color: #333333;">Add</span><span style="color: #333333;">(</span><span style="color: #333333;">result</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">validationResult</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Called when [errors changed].</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">propertyName</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">Name of the property.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">virtual</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">OnErrorsChanged</span><span style="color: #333333;">(</span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnErrorsChanged</span><span style="color: #333333;">(</span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DataErrorsChangedEventArgs</span><span style="color: #333333;">(</span><span style="color: #333333;">propertyName</span><span style="color: #333333;">))</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Raises the </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">see</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">E</span><span style="font-style: italic; color: #888888;">:</span><span style="font-style: italic; color: #888888;">ErrorsChanged</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;"> event.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">e</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">see</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">DataErrorsChangedEventArgs</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;"> instance containing the event data.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">private</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">OnErrorsChanged</span><span style="color: #333333;">(</span><span style="color: #3364a4;">DataErrorsChangedEventArgs</span><span style="color: #333333;"> </span><span style="color: #333333;">e</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">var</span><span style="color: #333333;"> </span><span style="color: #333333;">handler</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ErrorsChanged</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">handler</span><span style="color: #333333;"> !</span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">null</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">handler</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #333333;">e</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Called when [property changed].</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">propertyName</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">Name of the property.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">virtual</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">PropertyChangedEventArgs</span><span style="color: #333333;">(</span><span style="color: #333333;">propertyName</span><span style="color: #333333;">))</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Raises the </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">see</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">E</span><span style="font-style: italic; color: #888888;">:</span><span style="font-style: italic; color: #888888;">PropertyChanged</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;"> event.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">e</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">see</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">PropertyChangedEventArgs</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;"> instance containing the event data.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">private</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #3364a4;">PropertyChangedEventArgs</span><span style="color: #333333;"> </span><span style="color: #333333;">e</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">var</span><span style="color: #333333;"> </span><span style="color: #333333;">propertyChanged</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">PropertyChanged</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">propertyChanged</span><span style="color: #333333;"> !</span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">null</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">propertyChanged</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #333333;">e</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Raises the property changed.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">propertyName</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">Name of the property.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">RaisePropertyChanged</span><span style="color: #333333;">(</span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Sets the error.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">errorMessage</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The error message.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">propertyName</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">Name of the property.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">SetError</span><span style="color: #333333;">(</span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">errorMessage</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">_validationResultList</span><span style="color: #333333;">.</span><span style="color: #333333;">Add</span><span style="color: #333333;">(</span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ValidationResult</span><span style="color: #333333;">(</span><span style="color: #333333;">errorMessage</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #333333;">propertyName</span><span style="color: #333333;">))</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnErrorsChanged</span><span style="color: #333333;">(</span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #333333;">propertyName</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Validate this instance.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">virtual</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">Validate</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">INotifyDataErrorInfo</span><span style="color: #c12dac;"> Members</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Occurs when the validation errors have changed for a property or for the entire entity.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">event</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EventHandler</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">DataErrorsChangedEventArgs</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #333333;">ErrorsChanged</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">INotifyPropertyChanged</span><span style="color: #c12dac;"> Members</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Occurs when a property value changes.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">event</span><span style="color: #333333;"> </span><span style="color: #3364a4;">PropertyChangedEventHandler</span><span style="color: #333333;"> </span><span style="color: #333333;">PropertyChanged</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>This is the base class used for domain models used with Crosslight projects that supports <strong>INotifyPropertyChanged</strong> for data binding and also data validation. It is highly recommended that the models used in the project subclasses this <strong>ModelBase</strong> class. Let&#8217;s modify the existing models now and do that. Open up <strong>Employee.cs</strong> and replace the contents as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Models</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Model</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     This is a domain object that holds information about a given employee.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">partial</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Employee</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ModelBase</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Employee</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">ImageUri</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">VC</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Fields</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">_firstName</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">_imageUri</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">_lastName</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">_twitter</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Properties</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">DisplayName</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;">.</span><span style="color: #333333;">Format</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #ff0000;">{</span><span style="color: #ff0000;">0</span><span style="color: #ff0000;">}</span><span style="color: #f57d00;">,</span><span style="color: #f57d00;"> </span><span style="color: #ff0000;">{</span><span style="color: #ff0000;">1</span><span style="color: #ff0000;">}</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #333333;">_lastName</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #333333;">_firstName</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">FirstName</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">_firstName</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">set</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">value</span><span style="color: #333333;">.</span><span style="color: #333333;">Equals</span><span style="color: #333333;">(</span><span style="color: #333333;">_firstName</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">StringComparison</span><span style="color: #333333;">.</span><span style="color: #333333;">Ordinal</span><span style="color: #333333;">))</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">return</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">_firstName</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">value</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">DisplayName</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">ImageUri</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">_imageUri</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">set</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">value</span><span style="color: #333333;">.</span><span style="color: #333333;">Equals</span><span style="color: #333333;">(</span><span style="color: #333333;">_imageUri</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">StringComparison</span><span style="color: #333333;">.</span><span style="color: #333333;">Ordinal</span><span style="color: #333333;">))</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">return</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">_imageUri</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">value</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ImageUri</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">LastName</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">_lastName</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">set</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">value</span><span style="color: #333333;">.</span><span style="color: #333333;">Equals</span><span style="color: #333333;">(</span><span style="color: #333333;">_lastName</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">StringComparison</span><span style="color: #333333;">.</span><span style="color: #333333;">Ordinal</span><span style="color: #333333;">))</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">return</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">_lastName</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">value</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">DisplayName</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">Twitter</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">_twitter</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">set</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">value</span><span style="color: #333333;">.</span><span style="color: #333333;">Equals</span><span style="color: #333333;">(</span><span style="color: #333333;">_twitter</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">StringComparison</span><span style="color: #333333;">.</span><span style="color: #333333;">Ordinal</span><span style="color: #333333;">))</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">return</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">_twitter</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">value</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Twitter</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>In this code, note the <strong>partial</strong> modifier for this class. This is needed for the Crosslight Form Builder metadata, which we&#8217;ll create much later in the tutorial. Then modify <strong>LoginInfo.cs</strong> as well.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">ComponentModel</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">Runtime</span><span style="color: #333333;">.</span><span style="color: #333333;">CompilerServices</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Models</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Model</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">   This class is used to capture login credentials and to perform very simple authentication.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">partial</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginInfo</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ModelBase</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">_password</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;">.</span><span style="color: #333333;">Empty</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">_username</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;">.</span><span style="color: #333333;">Empty</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">UserName</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">_username</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">set</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">_username</span><span style="color: #333333;">.</span><span style="color: #333333;">Equals</span><span style="color: #333333;">(</span><span style="color: #009695;">value</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">StringComparison</span><span style="color: #333333;">.</span><span style="color: #333333;">Ordinal</span><span style="color: #333333;">))</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">return</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">_username</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">value</span><span style="color: #333333;"> </span><span style="color: #333333;">??</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;">.</span><span style="color: #333333;">Empty</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">UserName</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">Password</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">_password</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">set</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">_password</span><span style="color: #333333;">.</span><span style="color: #333333;">Equals</span><span style="color: #333333;">(</span><span style="color: #009695;">value</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">StringComparison</span><span style="color: #333333;">.</span><span style="color: #333333;">Ordinal</span><span style="color: #333333;">))</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">return</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">_password</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">value</span><span style="color: #333333;"> </span><span style="color: #333333;">??</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;">.</span><span style="color: #333333;">Empty</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Password</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">Validate</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ClearAllErrors</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">string</span><span style="color: #333333;">.</span><span style="color: #333333;">IsNullOrEmpty</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">UserName</span><span style="color: #333333;">))</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SetError</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Please</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">enter</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">any</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">username</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">UserName</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">string</span><span style="color: #333333;">.</span><span style="color: #333333;">IsNullOrEmpty</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Password</span><span style="color: #333333;">))</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SetError</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Please</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">enter</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">any</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">password</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Password</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>The Validate method shown in the above snippet code is one of the examples how you can perform validation in Crosslight Form Builder. Here, we set the error message when user did not enter any username or password in the form upon login. Although, there is a more advanced version of form validation with the Crosslight Form Builder, that is to use the <strong>EntityMetadataAttribute. </strong>However, it will be covered in a separate blog post.</p>
<h1>Creating the Login Screen</h1>
<p>If you notice from the original sample, user can&#8217;t perform any operation unless they&#8217;ve performed login. Let&#8217;s modify the sample a bit to show the login screen at the initial state. So we&#8217;ll prepare the login screen first, then try to create the login screen on the Android platform. We&#8217;ll also bootstrap the Android project along the way.</p>
<p>Create a new folder in the <strong>XamarinFormsSample</strong> (PCL) project and give it a name of <strong>ViewModels</strong>. Then create a new <strong>Crosslight View Model</strong> in the folder, called <strong>LoginViewModel</strong>.</p>
<p><img class="alignnone size-full wp-image-6967" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/add-loginviewmodel.png" alt="add-loginviewmodel.png" width="250" height="458" /></p>
<p>Replace the entire contents as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Input</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Model</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginViewModel</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EditorViewModelBase</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LoginInfo</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginViewModel</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginInfo</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">LoginCommand</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DelegateCommand</span><span style="color: #333333;">(</span><span style="color: #333333;">ExecuteLogin</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Fields</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">private</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginInfo</span><span style="color: #333333;"> </span><span style="color: #333333;">_loginInfo</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Properties</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DelegateCommand</span><span style="color: #333333;"> </span><span style="color: #333333;">LoginCommand</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">get</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #009695;">set</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginInfo</span><span style="color: #333333;"> </span><span style="color: #333333;">LoginInfo</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">_loginInfo</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">set</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">_loginInfo</span><span style="color: #333333;"> !</span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">value</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">_loginInfo</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">value</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">OnPropertyChanged</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">LoginInfo</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Methods</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">private</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteLogin</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>In the constructor of this ViewModel, we&#8217;ve just simply instantiated a new <strong>LoginInfo</strong> object model, a new <strong>DelegateCommand</strong> <strong>LoginCommand</strong> and the <strong>Title</strong> for the ViewModel. We&#8217;ll leave the ExecuteLogin method as empty for now, all we want to accomplish now is displaying the Login screen perfectly. We&#8217;ll modify this method later on. Save this file and rebuild try to rebuild the <strong>XamarinFormsSample</strong> (PCL) project.</p>
<p><img class="alignnone size-full wp-image-6979" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-18-at-11.40.16-AM.png" alt="Screen Shot 2016-03-18 at 11.40.16 AM.png" width="3104" height="1842" /></p>
<p>You&#8217;ll get the error as shown in the shot above. This is because we&#8217;ve removed all references to Xamarin.Forms. We can completely remove this file, however, you might want to keep the <strong>Employees</strong> property in this file somewhere, perhaps in a separate notepad file for now. We&#8217;re going to need this for the list of employees later after we&#8217;ve successfully created the login module.</p>
<p><img class="alignnone size-full wp-image-6984" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-18-at-11.42.20-AM.png" alt="Screen Shot 2016-03-18 at 11.42.20 AM.png" width="2282" height="1342" /></p>
<p>Delete <strong>App.cs</strong> when you&#8217;re done. Rebuild the <strong>XamarinFormsSample</strong> (PCL) project one more time and you should be able to build it now.</p>
<p><img class="alignnone size-full wp-image-6989" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/pcl-build-successful.png" alt="pcl-build-successful.png" width="1976" height="266" /></p>
<p>Great! Let&#8217;s create the Android login view for this ViewModel.</p>
<h1>Bootstrapping the Android Project</h1>
<p>Before we can use this project, we need to &#8220;upgrade&#8221; this project to use new project standards. Let&#8217;s go through each step carefully, one step at a time.</p>
<p>Download this <a href="http://developer.intersoftsolutions.com/display/crosslight/Migrating+from+Crosslight+Android+Classic?preview=%2F23702119%2F24309664%2Fmipmap.zip" target="_blank">mipmap.zip</a> file and extract it. These files will be used as the launcher icons for our Android project. Import them into the <strong>Resources</strong> folder by using <strong>Add Existing Folder</strong> menu. What these mipmap icons do is provide a better high-res icons for the app launchers. For example, if your device is on the hdpi-display scale, then it will use the xhdpi icons for the icon launchers so that it will look crisp.</p>
<p><img class="alignnone size-full wp-image-7017" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/add-existing-folder.png" alt="add-existing-folder.png" width="1240" height="316" /></p>
<p>Select each mipmap folder so that your project looks as follows.</p>
<p><img class="alignnone size-full wp-image-7019" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/mipmap.png" alt="mipmap.png" width="250" height="656" /></p>
<p>Start by opening the <strong>Android</strong> project Options. To do this, right-click on the Android project and choose <strong>Options</strong>.</p>
<p><img class="alignnone size-full wp-image-6997" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/android-project-options.png" alt="android-project-options.png" width="500" height="1050" /></p>
<p>In the dialog that appears, choose <strong>Main Settings</strong> and change the <strong>Default Namespace</strong> to <strong>XamarinFormsSample.Android</strong>.</p>
<p><img class="alignnone size-full wp-image-7108" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-18-at-5.08.51-PM.png" alt="Screen Shot 2016-03-18 at 5.08.51 PM.png" width="1794" height="1292" /></p>
<p>Then choose <strong>General</strong>, ensure that the <strong>Target Framework</strong> has been set to <strong>Android 5.0 (Lollipop)</strong>.</p>
<p><img class="alignnone size-full wp-image-7003" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-18-at-11.50.17-AM.png" alt="Screen Shot 2016-03-18 at 11.50.17 AM.png" width="1779" height="1378" /></p>
<p>Next, in the <strong>Android Build</strong> menu, the <strong>Advanced</strong> tab, ensure that the all <strong>Supported ABIs</strong> are ticked for both <strong>Debug</strong> and <strong>Release</strong> configurations.</p>
<p><img class="alignnone size-full wp-image-7005" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-18-at-11.51.31-AM.png" alt="Screen Shot 2016-03-18 at 11.51.31 AM.png" width="1814" height="1413" /></p>
<p>In the next menu, change the <strong>Application icon</strong> to <strong>@mipmap/Icon</strong>. This corresponds to the mipmap folders that we&#8217;ve just imported.</p>
<p><img class="alignnone size-full wp-image-7023" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-18-at-3.50.17-PM.png" alt="Screen Shot 2016-03-18 at 3.50.17 PM.png" width="1744" height="1373" /></p>
<p>You can also ensure that the <strong>Target Android</strong> version is set to <strong>Android 5.0 </strong>or higher. Next, open up <strong>AndroidManifest.xml</strong> located inside <strong>Properties</strong> folder. Change the current theme to <strong>@style/Theme.Crosslight.Material.Light</strong>.</p>
<p><img class="alignnone size-full wp-image-7136" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/android-theme-material.png" alt="android-theme-material.png" width="1174" height="294" /></p>
<p>Next, create a new <strong>Activities</strong> folder inside the Android project and move the <strong>MainActivity.cs</strong> there.</p>
<p><img class="alignnone size-full wp-image-7036" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/main-activity.png" alt="main-activity.png" width="250" height="460" /></p>
<p>Rename this file as <strong>LaunchActivity.cs</strong> and replace the contents as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> Android</span><span style="color: #333333;">.</span><span style="color: #333333;">App</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     The splash screen Activity. To change the launcher icon for the Android app, simply change the Icon property.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">seealso</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">Intersoft</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">Crosslight</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">Android</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">StartActivity</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Activity</span><span style="color: #333333;">(</span><span style="color: #333333;">Label </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">XamarinFormSample</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">Android</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> MainLauncher </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">,</span><span style="color: #333333;"> NoHistory </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">,</span><span style="color: #333333;"> Icon </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@mipmap</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">icon</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> Theme </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@style</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">Theme</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">Splash</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LaunchActivity</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">StartActivity</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>This is just the splash screen that will be launched when the Android app is run. Since we&#8217;ve used a new Theme here, let&#8217;s add the styles to our <strong>Resources</strong> folder. Add a new styles.xml file inside the <strong>Resources/values</strong> folder.</p>
<p><img class="alignnone size-full wp-image-7046" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/styles.png" alt="styles.png" width="200" height="656" /></p>
<p>Add the following entry to the <strong>styles.xml</strong> file.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">&lt;?</span><span style="color: #333333;">xml</span><span style="color: #333333;"> </span><span style="color: #333333;">version</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">0</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;"> </span><span style="color: #333333;">encoding</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">utf</span><span style="color: #f57d00;">&#8211;</span><span style="color: #f57d00;">8</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;"> </span><span style="color: #009695;">?&gt;</span><br />
<span style="color: #333333;">&lt;</span><span style="color: #3364a4;">resources</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">  </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">style</span><span style="color: #3364a4;"> </span><span style="color: #333333;">name</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Theme</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">Splash</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">parent</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">Theme</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">      </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">item</span><span style="color: #3364a4;"> </span><span style="color: #333333;">name</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">windowBackground</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><span style="color: #333333;">@drawable/light_splash</span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">item</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">item</span><span style="color: #3364a4;"> </span><span style="color: #333333;">name</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">windowNoTitle</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><span style="color: #333333;">true</span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">item</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">  </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">style</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">resources</span><span style="color: #333333;">&gt;</span></span></p>
<p>And also add the following <strong>light_splash.png</strong> drawable to your <strong>Resources/drawable</strong> folder.</p>
<p><img class="alignnone size-full wp-image-7050" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/light_splash.png" alt="light_splash.png" width="250" height="960" /></p>
<p>Next, add a new folder in the root directory of the Android project, called <strong>Infrastructure</strong>. Then add a new empty class called <strong>AppInitializer</strong>.</p>
<p><img class="alignnone size-full wp-image-7123" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/android-appinitializer.png" alt="android-appinitializer.png" width="200" height="418" /></p>
<p>Replace the contents of the <strong>AppInitializer.cs</strong> as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Infrastructure</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Infrastructure</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Android Application Initializer class.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">seealso</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">Intersoft</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">Crosslight</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">IApplicationInitializer</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">sealed</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AppInitializer</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">IApplicationInitializer</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">Implementation</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">of</span><span style="color: #c12dac;"> IApplicationInitializer</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Gets the application service based on the current context.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">context</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The context of the application.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">returns</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     The application service.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">returns</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">IApplicationService</span><span style="color: #333333;"> </span><span style="color: #333333;">GetApplicationService</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IApplicationContext</span><span style="color: #333333;"> </span><span style="color: #333333;">context</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">CrosslightAppAppService</span><span style="color: #333333;">(</span><span style="color: #333333;">context</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes and prepares the application for launch.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">appHost</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The application host.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">InitializeApplication</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IApplicationHost</span><span style="color: #333333;"> </span><span style="color: #333333;">appHost</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes the components required for the application to run properly.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">appHost</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The application host.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">InitializeComponents</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IApplicationHost</span><span style="color: #333333;"> </span><span style="color: #333333;">appHost</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes the services for the application to start properly.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">appHost</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The application host.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">InitializeServices</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IApplicationHost</span><span style="color: #333333;"> </span><span style="color: #333333;">appHost</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>This file is the application initializer for Android, useful for registering custom Android services, views, and Form Builder components. We&#8217;ll leave this class as it is for now.</p>
<p>To create the login view for Android, we&#8217;re going to take advantage of the Crosslight Form which will help us create the login screen very quickly. Begin by creating a new folder inside the <strong>XamarinFormsSample</strong> (PCL) project called <strong>Forms</strong>. Then create a new empty class called <strong>LoginInfo.FormMetadata.cs</strong> inside the newly created folder. Use the following code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Forms</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Model</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">FormMetadataType</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #3364a4;">LoginInfo</span><span style="color: #333333;">.</span><span style="color: #3364a4;">FormMetadata</span><span style="color: #333333;">))]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">partial</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginInfo</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Form</span><span style="color: #333333;">(</span><span style="color: #333333;">Title </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Login</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">FormMetadata</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Section</span><span style="color: #333333;">]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginSection</span><span style="color: #333333;"> </span><span style="color: #333333;">LoginSection</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginSection</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Layout</span><span style="color: #333333;">(</span><span style="color: #333333;">Style </span><span style="color: #333333;">=</span><span style="color: #333333;"> LayoutStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">DetailOnly</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">StringInput</span><span style="color: #333333;">(</span><span style="color: #333333;">Placeholder </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Username</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">UserName</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Layout</span><span style="color: #333333;">(</span><span style="color: #333333;">Style </span><span style="color: #333333;">=</span><span style="color: #333333;"> LayoutStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">DetailOnly</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">StringInput</span><span style="color: #333333;">(</span><span style="color: #333333;">Placeholder </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Password</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Display</span><span style="color: #333333;">(</span><span style="color: #333333;">Caption </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Password</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">Password</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Editor</span><span style="color: #333333;">(</span><span style="color: #333333;">EditorType</span><span style="color: #333333;">.</span><span style="color: #333333;">Button</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Display</span><span style="color: #333333;">(</span><span style="color: #333333;">Caption </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Login</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Binding</span><span style="color: #333333;">(</span><span style="color: #333333;">Path </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">LoginCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> SourceType </span><span style="color: #333333;">=</span><span style="color: #333333;"> BindingSourceType</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModel</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Button</span><span style="color: #333333;">(</span><span style="color: #333333;">Title </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Login</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> TextColor </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">FF285AFF</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> Style </span><span style="color: #333333;">=</span><span style="color: #333333;"> ButtonStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">Simple</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">LoginButton</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>This is the FormMetadata that will be used for our login screen. This class is decorated with the <strong>FormMetadataTypeAttribute</strong> class which will indicate that this class will be used for the Form Builder definition. Also note that this class is a partial class from the <strong>LoginInfo</strong> model found inside the <strong>XamarinFormsSample/Models</strong> folder. Here, we only have a single <strong>LoginSection</strong> which consists of the following UI elements:</p>
<ul>
<li>Text box for the UserName</li>
<li>Text box for the Password</li>
<li>Button for the Login button.</li>
</ul>
<p>It is recommended to match the property name with the model to ensure Form Builder automatic validation. The login button is also bound to the <strong>LoginCommand</strong> in the <strong>LoginViewModel</strong>.</p>
<p>Add a new <strong>Crosslight Android Material Activity</strong> inside the <strong>Activities</strong> folder.</p>
<p><img class="alignnone size-full wp-image-7061" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/loginactivity.png" alt="loginactivity.png" width="250" height="336" /></p>
<p>Give it a name of <strong>LoginActivity</strong>.</p>
<p><img class="alignnone size-full wp-image-7059" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-18-at-4.40.00-PM.png" alt="Screen Shot 2016-03-18 at 4.40.00 PM.png" width="1640" height="1298" /></p>
<p>Replace the contents of <strong>LoginActivity.cs</strong> as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> Android</span><span style="color: #333333;">.</span><span style="color: #333333;">App</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">v7</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Runtime</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Activities</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     The main activity that acts as the host for LoginFragment.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Activity</span><span style="color: #333333;">]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginActivity</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AppCompatActivity</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LoginViewModel</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginActivity</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginActivity</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IntPtr</span><span style="color: #333333;"> </span><span style="color: #333333;">javaReference</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">JniHandleOwnership</span><span style="color: #333333;"> </span><span style="color: #333333;">transfer</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #009695;">base</span><span style="color: #333333;">(</span><span style="color: #333333;">javaReference</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #333333;">transfer</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>This Activity will act as a container for the <strong>LoginFragment</strong>, which is the real view that&#8217;s being rendered for the login screen. Create a new folder called <strong>Fragments</strong> at the root of the Android project.</p>
<p><img class="alignnone size-full wp-image-7070" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/fragments.png" alt="fragments.png" width="250" height="332" /></p>
<p>Create a new <strong>Crosslight Android Material Form Fragment</strong> in this folder, called <strong>LoginFragment</strong>.</p>
<p><img class="alignnone size-full wp-image-7325" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-22-at-1.35.42-PM.png" alt="Screen Shot 2016-03-22 at 1.35.42 PM.png" width="1681" height="1311" /></p>
<p>Paste the following code into <strong>LoginFragment</strong>.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Runtime</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">BindingProviders</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">v7</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Fragments</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     The main Fragment contained inside LoginActivity.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">LoginFragment</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">FormFragment</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LoginViewModel</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Methods</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes this instance.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">Initialize</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">base</span><span style="color: #333333;">.</span><span style="color: #333333;">Initialize</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">IconId</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Resource</span><span style="color: #333333;">.</span><span style="color: #3364a4;">Drawable</span><span style="color: #333333;">.</span><span style="color: #333333;">ic_toolbar</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>This project contains nothing except for the icon that will be used in the toolbar. When trying to run the project, you&#8217;ll get an error that <strong>ic_toolbar</strong> cannot be found. This can be easily resolved by copying the following image to the <strong>Resources/drawable</strong> folder.</p>
<p><img class="alignnone size-full wp-image-7115" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/ic_toolbar1.png" alt="ic_toolbar.png" width="48" height="48" /></p>
<p>The above is white and transparent, which makes it might be hard to see, but this icon will fit to almost Material Toolbar color you throw at it, except for white color, of course. You can replace this icon later with your own app branding, if you&#8217;d like.</p>
<p>If you build and run the project now, you should get the following screen.</p>
<p><img class="alignnone size-full wp-image-7142" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/android-result1.png" alt="android-result.png" width="400" height="1136" /></p>
<p>When you click on the Login button, nothing will happen for now, since we&#8217;ve omitted the logic for <strong>ExecuteLogin</strong> in the <strong>LoginViewModel</strong>.</p>
<h1>Preparing the Employee List Screen</h1>
<p>Now that we&#8217;ve successfully displayed the login screen, we&#8217;re going to further modify this sample to navigate to the list of employees screen after we&#8217;ve clicked on the Login button. Start by modifying the <strong>LoginViewModel</strong> located inside the <strong>XamarinFormsSample</strong> (PCL) project. Use the following code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">private</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteLogin</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Validate</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #333333;">    </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">!</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">HasErrors</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">NavigationService</span><span style="color: #333333;">.</span><span style="color: #333333;">Navigate</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">EmployeeListViewModel</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">else</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">MessagePresenter</span><span style="color: #333333;">.</span><span style="color: #333333;">Show</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ErrorMessage</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">}</span></p>
<p>Here, we simply invoke the <strong>Validate</strong> method that is built-in to the <strong>EditorViewModelBase</strong>. If there&#8217;s any errors, then it will be displayed using the built-in message presenter that comes with the <strong>ViewModelBase</strong>. If the user has indeed entered any values, then the app will navigate to the employee list screen. Create a new Editable List View Model under the <strong>XamarinFormsSample/ViewModels</strong> folder. Give it a name of <strong>EmployeeListViewModel</strong>.</p>
<p><img class="alignnone size-full wp-image-7158" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-21-at-9.34.27-AM.png" alt="Screen Shot 2016-03-21 at 9.34.27 AM.png" width="1626" height="1295" /></p>
<p>Use the following code:</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">Collections</span><span style="color: #333333;">.</span><span style="color: #333333;">Generic</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">Collections</span><span style="color: #333333;">.</span><span style="color: #333333;">ObjectModel</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">Linq</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Model</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeListViewModel</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EditableListViewModelBase</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Employee</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeListViewModel</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SourceItems</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Employees</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Title</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Employee</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">List</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Fields</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">private</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ObservableCollection</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Employee</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #333333;">_employees</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Properties</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ObservableCollection</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Employee</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #333333;">Employees</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">_employees</span><span style="color: #333333;"> !</span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">null</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">_employees</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #3364a4;">List</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Employee</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #333333;">list</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">List</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Employee</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Employee</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                        FirstName </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Cecil</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                        LastName </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Kinross</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                        ImageUri </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">CecilKinross</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">}</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Employee</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                        FirstName </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">William</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                        LastName </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Hall</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                        ImageUri </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">WilliamHall</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">}</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Employee</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                        FirstName </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Robert</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                        LastName </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Spall</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                        ImageUri </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">RobertSpall</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">}</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Employee</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                        FirstName </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Ernest</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                        LastName </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Smith</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                        ImageUri </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ErnestSmith</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">}</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                    </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Employee</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                        FirstName </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Paul</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                        LastName </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Triquet</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                        ImageUri </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">PaulTriquet</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">}</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">                </span><span style="color: #009695;">int</span><span style="color: #333333;"> </span><span style="color: #333333;">counter</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">1</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">foreach</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #3364a4;">Employee</span><span style="color: #333333;"> employee </span><span style="color: #009695;">in</span><span style="color: #333333;"> </span><span style="color: #333333;">list</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                    </span><span style="color: #333333;">employee</span><span style="color: #333333;">.</span><span style="color: #333333;">Twitter</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@fake</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;"> </span><span style="color: #333333;">+</span><span style="color: #333333;"> </span><span style="color: #333333;">counter</span><span style="color: #333333;">++;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">_employees</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ObservableCollection</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Employee</span><span style="color: #333333;">&gt;(</span><span style="color: #333333;">list</span><span style="color: #333333;">.</span><span style="color: #333333;">OrderBy</span><span style="color: #333333;">(</span><span style="color: #333333;">e</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;">&gt;</span><span style="color: #333333;"> </span><span style="color: #333333;">e</span><span style="color: #333333;">.</span><span style="color: #333333;">LastName</span><span style="color: #333333;">))</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">_employees</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>Remember the <strong>Employees</strong> property code we&#8217;ve copied from the deleted App.cs? Now it&#8217;s the time to use the code. In this ViewModel, we simply populate the list of employees to the <strong>SourceItems</strong> property of the <strong>EmployeeListViewModel </strong>and set the initial <strong>Title</strong> for the <strong>EmployeeListViewModel</strong>. Next, let&#8217;s prepare the <strong>EmployeeListFragment</strong>. Create a new Crosslight Android Material List Fragment inside <strong>XamarinFormsSample.Android/Fragments</strong> folder and give it a name of <strong>EmployeeListFragment</strong>.</p>
<p><img class="alignnone size-full wp-image-7172" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-21-at-9.54.55-AM.png" alt="Screen Shot 2016-03-21 at 9.54.55 AM.png" width="1657" height="1241" /></p>
<p>Use the following code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Runtime</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">v7</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">v7</span><span style="color: #333333;">.</span><span style="color: #333333;">ComponentModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Graphics</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Graphics</span><span style="color: #333333;">.</span><span style="color: #333333;">Drawables</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">BindingProviders</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Fragments</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">ImportBinding</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #c44c57;">EmployeeListBindingProvider</span><span style="color: #333333;">))]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeListFragment</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">RecyclerViewFragment</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">EmployeeListViewModel</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeListFragment</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeListFragment</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IntPtr</span><span style="color: #333333;"> </span><span style="color: #333333;">javaReference</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">JniHandleOwnership</span><span style="color: #333333;"> </span><span style="color: #333333;">transfer</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #009695;">base</span><span style="color: #333333;">(</span><span style="color: #333333;">javaReference</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #333333;">transfer</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Properties</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> Gets the layout identifier of list item.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">value</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> The list item layout identifier.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">value</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">int</span><span style="color: #333333;"> </span><span style="color: #333333;">ItemLayoutId</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Resource</span><span style="color: #333333;">.</span><span style="color: #3364a4;">Layout</span><span style="color: #333333;">.</span><span style="color: #c44c57;">item_layout</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Methods</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">Initialize</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;">To</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">learn</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">more</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">how</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">to</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">configure</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">this</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">template</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><br />
<span style="color: #333333;">            </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;">see</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">http</span><span style="font-style: italic; color: #888888;">:</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">developer</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">intersoftsolutions</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">com</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">display</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">crosslight</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">Using</span><span style="font-style: italic; color: #888888;">+</span><span style="font-style: italic; color: #888888;">Material</span><span style="font-style: italic; color: #888888;">+</span><span style="font-style: italic; color: #888888;">Recycler</span><span style="font-style: italic; color: #888888;">+</span><span style="font-style: italic; color: #888888;">View</span><span style="font-style: italic; color: #888888;">+Fragment</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">base</span><span style="color: #333333;">.</span><span style="color: #333333;">Initialize</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ImageLoaderSettings</span><span style="color: #333333;">.</span><span style="color: #333333;">AnimateOnLoad</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Appearance</span><span style="color: #333333;">.</span><span style="color: #333333;">Background</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ColorDrawable</span><span style="color: #333333;">(</span><span style="color: #3364a4;">Color</span><span style="color: #333333;">.</span><span style="color: #333333;">WhiteSmoke</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;">Recycler</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">View</span><span style="font-style: italic; color: #888888;"> configuration</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">InteractionMode</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ListViewInteraction</span><span style="color: #333333;">.</span><span style="color: #333333;">Navigation</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SourceSharedElementIds</span><span style="color: #333333;">.</span><span style="color: #333333;">Add</span><span style="color: #333333;">(</span><span style="color: #3364a4;">Resource</span><span style="color: #333333;">.</span><span style="color: #3364a4;">Id</span><span style="color: #333333;">.</span><span style="color: #c44c57;">Icon</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>The list view is pretty simple, it only contains 2 default constructors needed for Fragment initialization, then we provide the item layout to be used by providing the item_layout as ID (which we&#8217;ll create in just a moment), then in the <strong>Initialize</strong> method, we initialized several settings, such as <strong>ImageLoaderSettings</strong> to animate when it loads, then set the Fragment background to the <strong>Color.WhiteSmoke</strong> color. Then we configure the <strong>InteractionMode</strong> of the Fragment to navigate upon item click. Lastly, we specified the shared element transition to transition from the ImageView with id of Icon to the FormFragment (which we&#8217;ll create after the Employee List screen).</p>
<p>Create a new Android layout file inside<strong> XamarinFormsSample.Android/Resources/layout</strong> folder and give it a name of <strong>item_layout</strong>.</p>
<p><img class="alignnone size-full wp-image-7191" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-21-at-10.02.27-AM.png" alt="Screen Shot 2016-03-21 at 10.02.27 AM.png" width="1681" height="1310" /></p>
<p>Paste the following code inside the new layout file.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">&lt;?</span><span style="color: #333333;">xml</span><span style="color: #333333;"> </span><span style="color: #333333;">version</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">1</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">0</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;"> </span><span style="color: #333333;">encoding</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">utf</span><span style="color: #f57d00;">&#8211;</span><span style="color: #f57d00;">8</span><span style="color: #f57d00;">&#8220;</span><span style="color: #009695;">?&gt;</span><br />
<span style="color: #333333;">&lt;</span><span style="color: #3364a4;">intersoft</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">crosslight</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">android</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">v7</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">CardView</span><span style="color: #3364a4;"> </span><span style="color: #333333;">xmlns:app</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">http</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">schemas</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">com</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">apk</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">res</span><span style="color: #f57d00;">&#8211;</span><span style="color: #f57d00;">auto</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">xmlns:android</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">http</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">schemas</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">.</span><span style="color: #f57d00;">com</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">apk</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">res</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:foreground</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">?</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">attr</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">selectableItemBackground</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_marginLeft</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">8dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_marginRight</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">8dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_marginBottom</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">8dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">app:cardElevation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">2dp</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">RelativeLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">80dp</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">ImageView</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">72dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">72dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">Icon</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_margin</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">4dp</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_centerVertical</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">true</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">LinearLayout</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_toRightOf</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">Icon</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:gravity</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">center_vertical</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_centerVertical</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">true</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:orientation</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">vertical</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">TextView</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textAppearance</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">?</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">attr</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">textAppearanceMedium</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">TextLabel</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:ellipsize</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">end</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:singleLine</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">true</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">TextView</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:textAppearance</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">?</span><span style="color: #f57d00;">android</span><span style="color: #f57d00;">:</span><span style="color: #f57d00;">attr</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">textAppearanceSmall</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:id</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">@</span><span style="color: #f57d00;">+</span><span style="color: #f57d00;">id</span><span style="color: #f57d00;">/</span><span style="color: #f57d00;">Text2</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_width</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">match_parent</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:layout_height</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">wrap_content</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #3364a4;"> </span><span style="color: #333333;">android:singleLine</span><span style="color: #333333;">=</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">true</span><span style="color: #f57d00;">&#8220;</span><span style="color: #3364a4;"> </span><span style="color: #333333;">/</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">LinearLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">RelativeLayout</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">&lt;</span><span style="color: #333333;">/</span><span style="color: #3364a4;">intersoft</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">crosslight</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">android</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">v7</span><span style="color: #3364a4;">.</span><span style="color: #3364a4;">CardView</span><span style="color: #333333;">&gt;</span></span></p>
<p>Here, we&#8217;re going to use the new CardView to be the item layout for our employee list screen. To wrap up this view, we&#8217;re going to create the <strong>EmployeeListBindingProvider</strong> that will bind the data from the <strong>EmployeeListViewModel</strong> to the <strong>EmployeeListFragment</strong>. Create a new folder inside the <strong>XamarinFormsSample</strong> (PCL) project called <strong>BindingProviders</strong> and place it inside the newly created folder.</p>
<p><img class="alignnone size-full wp-image-7200" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-21-at-10.06.09-AM.png" alt="Screen Shot 2016-03-21 at 10.06.09 AM.png" width="1643" height="1295" /></p>
<p>Use the following code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">BindingProviders</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeListBindingProvider</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindingProvider</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeListBindingProvider</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #3364a4;">ItemBindingDescription</span><span style="color: #333333;"> </span><span style="color: #333333;">itemBinding</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ItemBindingDescription</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                DisplayMemberPath </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">DisplayName</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                DetailMemberPath </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Twitter</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                ImageMemberPath </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">ImageUri</span><span style="color: #f57d00;">&#8220;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">TableView</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">ItemsSourceProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Items</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">TableView</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">ItemTemplateBindingProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #333333;">itemBinding</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">TableView</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">SelectedItemProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">SelectedItem</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindingMode</span><span style="color: #333333;">.</span><span style="color: #333333;">TwoWay</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">this</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">AddBinding</span><span style="font-style: italic; color: #888888;">(</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">TableView</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">BindableProperties</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">DetailNavigationTargetProperty</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">new</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">NavigationTarget</span><span style="font-style: italic; color: #888888;">(</span><span style="font-style: italic; color: #888888;">typeof</span><span style="font-style: italic; color: #888888;">(</span><span style="font-style: italic; color: #888888;">EmployeeEditorViewModel</span><span style="font-style: italic; color: #888888;">)</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">NavigationMode</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">Push</span><span style="font-style: italic; color: #888888;">)</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">true</span><span style="font-style: italic; color: #888888;">)</span><span style="font-style: italic; color: #888888;">;</span><br />
<span style="color: #333333;">            </span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>In the <strong>EmployeeListBindingProvider</strong>, we did several things:</p>
<ul>
<li>Bound the <strong>ItemsSource</strong> for the <strong>RecyclerView</strong> with the Items property from the <strong>ViewModel</strong>.</li>
<li>Bound the <strong>ItemTemplateBinding</strong> for the RecyclerView to display the specified <strong>ItemBindingDescription</strong>.</li>
<li>Bound the <strong>SelectedItem</strong> of the <strong>RecyclerView</strong> to the <strong>SelectedItem</strong> property in the <strong>ViewModel</strong>.</li>
<li>Bound the <strong>DetailNavigationTarget</strong> of the <strong>RecyclerView</strong> to use which <strong>ViewModel</strong> when navigation is performed, and what mode of the navigation is used. (which is commented for now, for the sake compilation purposes).</li>
</ul>
<p>Let&#8217;s build and run this project to see how it looks like.</p>
<p><img class="alignnone size-full wp-image-7215" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/android-employee-list.png" alt="android-employee-list.png" width="400" height="1136" /></p>
<p>Phew. We&#8217;re almost there. For Android, we only have 1 screen left, which is the editor view. Let&#8217;s proceed.</p>
<h1>Preparing the Employee Editor Screen</h1>
<p>In this section, we&#8217;re going to use the Crosslight Form Builder capabilities to display our form. Begin by creating a new folder inside the <strong>XamarinFormsSample</strong> (PCL) and call it <strong>Forms</strong>. Inside the folder, create a new empty class and name it <strong>Employee.FormMetadata.cs</strong>.</p>
<p><img class="alignnone size-full wp-image-7222" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/forms.png" alt="forms.png" width="250" height="340" /></p>
<p>Replace the contents of the file with the following code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Forms</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Model</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">FormMetadataType</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #3364a4;">Employee</span><span style="color: #333333;">.</span><span style="color: #3364a4;">FormMetadata</span><span style="color: #333333;">))]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">partial</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Employee</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Form</span><span style="color: #333333;">(</span><span style="color: #333333;">Title </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">{</span><span style="color: #f57d00;">FormState</span><span style="color: #f57d00;">}</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">Employee</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">FormMetadata</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Section</span><span style="color: #333333;">]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ImageSection</span><span style="color: #333333;"> </span><span style="color: #333333;">ImageSection</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Section</span><span style="color: #333333;">]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #3364a4;">GeneralSection</span><span style="color: #333333;"> </span><span style="color: #333333;">GeneralSection</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Section</span><span style="color: #333333;">]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ButtonSection</span><span style="color: #333333;"> </span><span style="color: #333333;">ButtonSection</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ImageSection</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Editor</span><span style="color: #333333;">(</span><span style="color: #333333;">EditorType</span><span style="color: #333333;">.</span><span style="color: #333333;">Image</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Layout</span><span style="color: #333333;">(</span><span style="color: #333333;">Style </span><span style="color: #333333;">=</span><span style="color: #333333;"> LayoutStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">DetailOnly</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Image</span><span style="color: #333333;">(</span><span style="color: #333333;">Height </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">250</span><span style="color: #333333;">,</span><span style="color: #333333;"> HorizontalAlignment </span><span style="color: #333333;">=</span><span style="color: #333333;"> ControlHorizontalAlignment</span><span style="color: #333333;">.</span><span style="color: #333333;">Center</span><span style="color: #333333;">,</span><span style="color: #333333;"> ScaleMode </span><span style="color: #333333;">=</span><span style="color: #333333;"> ImageScaleMode</span><span style="color: #333333;">.</span><span style="color: #333333;">ScaleAspectFit</span><span style="color: #333333;">,</span><span style="color: #333333;"> Padding </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">6</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Editable</span><span style="color: #333333;">(</span><span style="color: #009695;">false</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">ImageUri</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">GeneralSection</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">StringInput</span><span style="color: #333333;">(</span><span style="color: #333333;">Placeholder </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">First</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">Name</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Display</span><span style="color: #333333;">(</span><span style="color: #333333;">Caption </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">First</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">Name</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">FirstName</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">StringInput</span><span style="color: #333333;">(</span><span style="color: #333333;">Placeholder </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Last</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">Name</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Display</span><span style="color: #333333;">(</span><span style="color: #333333;">Caption </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Last</span><span style="color: #f57d00;"> </span><span style="color: #f57d00;">Name</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">LastName</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">StringInput</span><span style="color: #333333;">(</span><span style="color: #333333;">Placeholder </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Twitter</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Display</span><span style="color: #333333;">(</span><span style="color: #333333;">Caption </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Twitter</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">static</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">Twitter</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ButtonSection</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Editor</span><span style="color: #333333;">(</span><span style="color: #333333;">EditorType</span><span style="color: #333333;">.</span><span style="color: #333333;">Button</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Binding</span><span style="color: #333333;">(</span><span style="color: #333333;">Path </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">DeleteCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> SourceType </span><span style="color: #333333;">=</span><span style="color: #333333;"> BindingSourceType</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModel</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">[</span><span style="color: #333333;">Button</span><span style="color: #333333;">(</span><span style="color: #333333;">Title </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">Delete</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> TextColor </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">#</span><span style="color: #f57d00;">FFFF0000</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> Style </span><span style="color: #333333;">=</span><span style="color: #333333;"> ButtonStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">Simple</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">string</span><span style="color: #333333;"> </span><span style="color: #333333;">ShowMessageButton</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>Let&#8217;s take this code from the top. We&#8217;ve created a <strong>partial</strong> class from the <strong>Employee</strong> model. Form Builder is all about attributes, whether it&#8217;s in the class level or property level. In the class definition, the <strong>FormAttribute</strong> is used to indicate that this is a Crosslight Form Builder metadata, and which class used as the real form metadata.</p>
<p>In this example, the inner <strong>FormMetadata</strong> class is used. Then, we have 3 sections, which will be inner classes as well, the three sections are: <strong>ImageSection</strong>, <strong>GeneralSection</strong> and <strong>ButtonSection</strong>. Then in each section, we define each properties that will be rendered for the form. It is highly recommended to use the same name as the original properties contained in the Model, or else, you would have to specify the <strong>BindingAttribute</strong> that will be used for the property, as shown in the last property in the <strong>ButtonSection</strong>.</p>
<p>Now that we&#8217;ve prepared the Form Metadata, let&#8217;s proceed by creating the FormFragment. Create a new <strong>Crosslight Android Material Form Fragment</strong> inside the <strong>Fragments</strong> folder and call it <strong>EmployeeFormFragment</strong>.</p>
<p><img class="alignnone size-full wp-image-7228" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-21-at-10.42.08-AM1.png" alt="Screen Shot 2016-03-21 at 10.42.08 AM.png" width="1689" height="1305" /></p>
<p>&nbsp;</p>
<p>Replace the contents of the file with the following code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Runtime</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">v7</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Android</span><span style="color: #333333;">.</span><span style="color: #333333;">Fragments</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeFormFragment</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">FormFragment</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">EmployeeEditorViewModel</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeFormFragment</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeFormFragment</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IntPtr</span><span style="color: #333333;"> </span><span style="color: #333333;">javaReference</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">JniHandleOwnership</span><span style="color: #333333;"> </span><span style="color: #333333;">transfer</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #009695;">base</span><span style="color: #333333;">(</span><span style="color: #333333;">javaReference</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #333333;">transfer</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">Overrides</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">of</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">FormFragment</span><span style="color: #c12dac;">&lt;</span><span style="color: #c12dac;">EmployeeEditorViewModel</span><span style="color: #c12dac;">&gt;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">Initialize</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">base</span><span style="color: #333333;">.</span><span style="color: #333333;">Initialize</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">SharedImageIndex</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #f57d00;">0</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBarItem</span><span style="color: #333333;">(</span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BarItem</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">SaveButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">CommandItemType</span><span style="color: #333333;">.</span><span style="color: #333333;">Done</span><span style="color: #333333;">))</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>As you can see, the <strong>EmployeeFormFragment</strong> contains nothing except for the 2 default constructors, and very minimal definition for the overridden <strong>Initialize</strong> method. Here, we specified the SharedImageIndex which will be needed for shared element transition and also added a <strong>BarItem</strong> with the ID <strong>SaveButton</strong>. Next, we&#8217;ll prepare the ViewModel for this Form Builder. Create a new <strong>Crosslight Editor View Model</strong> inside the <strong>XamarinFormsSample/ViewModels</strong> folder and call it <strong>EmployeeEditorViewModel</strong>.</p>
<p><img class="alignnone size-full wp-image-7229" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-21-at-10.47.41-AM.png" alt="Screen Shot 2016-03-21 at 10.47.41 AM.png" width="1711" height="1307" /></p>
<p>Then use the following code for the file.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">Input</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Model</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeEditorViewModel</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EditorViewModelBase</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">Employee</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeEditorViewModel</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">DeleteCommand</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DelegateCommand</span><span style="color: #333333;">(</span><span style="color: #333333;">ExecuteDelete</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Properties</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">DelegateCommand</span><span style="color: #333333;"> </span><span style="color: #333333;">DeleteCommand</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">get</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #009695;">set</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeListViewModel</span><span style="color: #333333;"> </span><span style="color: #333333;">ParentViewModel</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">get</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #009695;">set</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Methods</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">private</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteDelete</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ParentViewModel</span><span style="color: #333333;">.</span><span style="color: #333333;">SourceItems</span><span style="color: #333333;">.</span><span style="color: #333333;">Remove</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><span style="color: #333333;">   </span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">NavigationService</span><span style="color: #333333;">.</span><span style="color: #333333;">Close</span><span style="color: #333333;">()</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">Overrides</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">of</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">EditorViewModelBase</span><span style="color: #c12dac;">&lt;</span><span style="color: #c12dac;">Employee</span><span style="color: #c12dac;">&gt;</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">ExecuteSave</span><span style="color: #333333;">(</span><span style="color: #009695;">object</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">base</span><span style="color: #333333;">.</span><span style="color: #333333;">ExecuteSave</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;">Needed</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">in</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">iOS</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">to</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">notify</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">that</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">item</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">has</span><span style="font-style: italic; color: #888888;"> changed</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">OnDataChanged</span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">Navigated</span><span style="color: #333333;">(</span><span style="color: #333333;">Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #3364a4;">NavigatedParameter</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">base</span><span style="color: #333333;">.</span><span style="color: #333333;">Navigated</span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #3364a4;">EmployeeListViewModel</span><span style="color: #333333;"> </span><span style="color: #333333;">employeeListViewModel</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">.</span><span style="color: #333333;">Sender</span><span style="color: #333333;"> </span><span style="color: #009695;">as</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeListViewModel</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">employeeListViewModel</span><span style="color: #333333;"> !</span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">null</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">ParentViewModel</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #333333;">employeeListViewModel</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">Item</span><span style="color: #333333;"> </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #333333;">parameter</span><span style="color: #333333;">.</span><span style="color: #333333;">Data</span><span style="color: #333333;"> </span><span style="color: #009695;">as</span><span style="color: #333333;"> </span><span style="color: #3364a4;">Employee</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>In the <strong>Navigated</strong> method of the above <strong>ViewModel</strong>, we simply pass the selected item from the previous ViewModel (<strong>EmployeeListViewModel</strong>) to be used as the <strong>Item</strong> for the Form. Here, we also prepared the <strong>Save</strong> and <strong>Delete</strong> methods that will be used for the form.</p>
<p>Lastly, let&#8217;s create the <strong>EmployeeFormBindingProvider</strong> inside the <strong>XamarinFormsSample/BindingProviders</strong> folder. Then use the following code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">BindingProviders</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeFormBindingProvider</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindingProvider</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Constructors</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeFormBindingProvider</span><span style="color: #333333;">()</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">AddBinding</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">SaveButton</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BindableProperties</span><span style="color: #333333;">.</span><span style="color: #333333;">CommandProperty</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">SaveCommand</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>Here, we simply bound the BarItem to the <strong>SaveCommand</strong> property in the ViewModel. And before we forgot, uncomment the commented line in the <strong>EmployeeListBindingProvider</strong>. Then build and run your project to see it in action.</p>
<p><img class="alignnone size-full wp-image-7231" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/android-form-fragment.png" alt="android-form-fragment.png" width="400" height="1136" /></p>
<p>When you navigate to the Form Fragment, notice that the shared element transition effect is applied automatically. We&#8217;ve finished the Android app. Now let&#8217;s move on to the iOS project.</p>
<h1>Bootstrapping the iOS Project</h1>
<p>Similar to the Android project, the iOS project also need to be re-bootstrapped since it also comes from Xamarin.Forms. First, change the debug configuration to Debug | iPhone Simulator so you can run the iOS project.</p>
<p><img class="alignnone size-full wp-image-7244" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/debug-iphone.png" alt="debug-iphone.png" width="400" height="628" /></p>
<p>Let&#8217;s remove the unnecessary Xamarin.Forms references in iOS project.</p>
<p><img class="alignnone size-full wp-image-7247" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/xamarin-forms-ios.png" alt="xamarin-forms-ios.png" width="400" height="582" /></p>
<p>Next, we have to migrate the sample to use the new iOS.Unified API. To do this, select the project, and select <strong>Project</strong>, <strong>Migrate to Xamarin.iOS Unified API</strong>.</p>
<p><img class="alignnone size-full wp-image-7254" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/xamarin-ios-unified-api.png" alt="xamarin-ios-unified-api.png" width="1518" height="1078" /></p>
<p>Then install Crosslight.iOS using NuGet by running the following command (if you&#8217;re on Mac Xamarin Studio) with the iOS project selected.</p>
<p>Install-Package Intersoft.Crosslight</p>
<p><img class="alignnone size-full wp-image-7259" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/install-ios-crosslight.png" alt="install-ios-crosslight.png" width="1366" height="236" /></p>
<p>Ensure that the packages are installed correctly by inspecting the <strong>References</strong> folder.</p>
<p><img class="alignnone size-full wp-image-7263" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/ios-references.png" alt="ios-references.png" width="250" height="258" /></p>
<p>Next, open <strong>AppDelegate.cs</strong> and replace the contents as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> IntersoftCore </span><span style="color: #333333;">=</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">iOS</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Foundation</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> UIKit</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">iOS</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">The</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">UIApplicationDelegate</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">for</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">application</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">This</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">class</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">is</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">responsible</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">for</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">launching</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">User</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">Interface</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">of</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">application</span><span style="font-style: italic; color: #888888;">,</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">as</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">well</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">as</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">listening</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">(</span><span style="font-style: italic; color: #888888;">and</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">optionally</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">responding</span><span style="font-style: italic; color: #888888;">)</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">to</span><span style="font-style: italic; color: #888888;"> </span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">application</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">events</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">from</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">iOS</span><span style="font-style: italic; color: #888888;">.</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Register</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">AppDelegate</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AppDelegate</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> IntersoftCore</span><span style="color: #333333;">.</span><span style="color: #3364a4;">UIApplicationDelegate</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Methods</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Wraps the content view controller into the root view controller.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">contentViewController</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">Content view controller.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">returns</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     The root view controller.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">returns</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">protected</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIViewController</span><span style="color: #333333;"> </span><span style="color: #333333;">WrapRootViewController</span><span style="color: #333333;">(</span><span style="color: #3364a4;">UIViewController</span><span style="color: #333333;"> </span><span style="color: #333333;">contentViewController</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">contentViewController</span><span style="color: #333333;"> </span><span style="color: #009695;">is</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UISplitViewController</span><span style="color: #333333;"> || </span><span style="color: #333333;">contentViewController</span><span style="color: #333333;"> </span><span style="color: #009695;">is</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UITabBarController</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #333333;">contentViewController</span><span style="color: #333333;">;</span></p>
<p><span style="color: #333333;">            </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UINavigationController</span><span style="color: #333333;">(</span><span style="color: #333333;">contentViewController</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>This is needed for Crosslight.iOS to create the navigation controllers automatically when performing navigation between ViewModels. Then, create a new folder at the root of the iOS project called <strong>Infrastructure</strong>, and create a new empty class with the name of <strong>AppInitializer.cs</strong>.</p>
<p><img class="alignnone size-full wp-image-7269" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/xamarin-ios-infrastructure.png" alt="xamarin-ios-infrastructure.png" width="250" height="536" /></p>
<p>Replace the contents of the file as follows.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Infrastructure</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">iOS</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     iOS&#8217;s application initializer.</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">seealso</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">cref</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">Intersoft</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">Crosslight</span><span style="font-style: italic; color: #888888;">.</span><span style="font-style: italic; color: #888888;">IApplicationInitializer</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">sealed</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">AppInitializer</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">IApplicationInitializer</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">Implementation</span><span style="color: #c12dac;"> </span><span style="color: #c12dac;">of</span><span style="color: #c12dac;"> IApplicationInitializer</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Gets the application service based on the current context.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">context</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The context of the application.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">returns</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     The application service.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">returns</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #3364a4;">IApplicationService</span><span style="color: #333333;"> </span><span style="color: #333333;">GetApplicationService</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IApplicationContext</span><span style="color: #333333;"> </span><span style="color: #333333;">context</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">CrosslightAppAppService</span><span style="color: #333333;">(</span><span style="color: #333333;">context</span><span style="color: #333333;">)</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes and prepares the application for launch.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">appHost</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The application host.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">InitializeApplication</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IApplicationHost</span><span style="color: #333333;"> </span><span style="color: #333333;">appHost</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes the components required for the application to run properly.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">appHost</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The application host.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">InitializeComponents</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IApplicationHost</span><span style="color: #333333;"> </span><span style="color: #333333;">appHost</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;">     Initializes the services for the application to start properly.</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">summary</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="font-style: italic; color: #888888;">///</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">name</span><span style="font-style: italic; color: #888888;">=</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">appHost</span><span style="font-style: italic; color: #888888;">&#8220;</span><span style="font-style: italic; color: #888888;">&gt;</span><span style="font-style: italic; color: #888888;">The application host.</span><span style="font-style: italic; color: #888888;">&lt;</span><span style="font-style: italic; color: #888888;">/</span><span style="font-style: italic; color: #888888;">param</span><span style="font-style: italic; color: #888888;">&gt;</span><br />
<span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> </span><span style="color: #333333;">InitializeServices</span><span style="color: #333333;">(</span><span style="color: #3364a4;">IApplicationHost</span><span style="color: #333333;"> </span><span style="color: #333333;">appHost</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>Similar to Android, this is the application initializer for iOS, where you can register custom view components, services, iOS views, and more. However, in this tutorial, we won&#8217;t register any additional services. Now, if you try to build the project, you should be able to build it successfully. Great, let&#8217;s create the ViewControllers for iOS. Start by creating a new folder called <strong>ViewControllers. </strong>Then create a new ViewController called <strong>LoginViewController</strong>.</p>
<p><img class="alignnone size-full wp-image-7288" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-21-at-2.12.24-PM.png" alt="Screen Shot 2016-03-21 at 2.12.24 PM.png" width="1663" height="1301" /></p>
<p>Your current folder structure should look like this.</p>
<p><img class="alignnone size-medium wp-image-7290" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/LoginViewController-186x300.png" alt="LoginViewController" width="186" height="300" /></p>
<p>Replace the contents as follows.</p>
<p><span style="font-family: Menlo;"> <span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">Drawing</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">iOS</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Foundation</span><span style="color: #333333;">;</span></span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">iOS</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Register</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">EmployeeFormViewController</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeFormViewController</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UIFormViewController</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">EmployeeEditorViewModel</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><span style="color: #333333;">   </span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>As you can see, in the <strong>LoginViewController</strong> contains nothing. Before you can run the project, open up the iOS project options by double-clicking on the iOS project, then in the <strong>iOS Build</strong> menu, ensure that the Supported architectures for the <strong>Debug | iPhone Simulator</strong> configuration supports the <strong>64-bit</strong> emulator. <img class="alignnone size-full wp-image-7316" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-21-at-2.45.44-PM.png" alt="Screen Shot 2016-03-21 at 2.45.44 PM.png" width="1907" height="1507" /></p>
<p>Then try to run the project to the iOS Simulator. You should get the following result.</p>
<p><img class="alignnone size-full wp-image-7317" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/iOS-Login.png" alt="iOS-Login.png" width="400" height="1136" /></p>
<p>Okay, seems our login screen has worked well. Now let&#8217;s move on to creating the rest of the views. This will be a breeze. Proceed by creating a new <strong>Table ViewController</strong> inside the <strong>ViewControllers</strong> folder. Name it <strong>EmployeeListViewController</strong>.</p>
<p><img class="alignnone size-full wp-image-7318" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-21-at-3.24.23-PM.png" alt="Screen Shot 2016-03-21 at 3.24.23 PM.png" width="1713" height="1309" /></p>
<p>Then use the following code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">BindingProviders</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">iOS</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Foundation</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">Drawing</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">iOS</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">Register</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">EmployeeListViewController</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #3364a4;">ImportBinding</span><span style="color: #333333;">(</span><span style="color: #009695;">typeof</span><span style="color: #333333;">(</span><span style="color: #3364a4;">EmployeeListBindingProvider</span><span style="color: #333333;">))]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> </span><span style="color: #3364a4;">EmployeeListViewController</span><span style="color: #333333;"> </span><span style="color: #333333;">:</span><span style="color: #333333;"> </span><span style="color: #3364a4;">UITableViewController</span><span style="color: #333333;">&lt;</span><span style="color: #3364a4;">EmployeeListViewModel</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Properties</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ImageSettings</span><span style="color: #333333;"> </span><span style="color: #333333;">CellImageSettings</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">ImageSettings</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                    ImageSize </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">SizeF</span><span style="color: #333333;">(</span><span style="color: #f57d00;">36</span><span style="color: #333333;">,</span><span style="color: #333333;"> </span><span style="color: #f57d00;">36</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">}</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #3364a4;">TableViewCellStyle</span><span style="color: #333333;"> </span><span style="color: #333333;">CellStyle</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">TableViewCellStyle</span><span style="color: #333333;">.</span><span style="color: #333333;">Subtitle</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BasicImageLoaderSettings</span><span style="color: #333333;"> </span><span style="color: #333333;">ImageLoaderSettings</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #009695;">new</span><span style="color: #333333;"> </span><span style="color: #3364a4;">BasicImageLoaderSettings</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                    AnimateOnLoad </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">,</span><br />
<span style="color: #333333;">                    CacheExpirationPolicy </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #3364a4;">CacheExpirationPolicy</span><span style="color: #333333;">.</span><span style="color: #333333;">AutoDetect</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">}</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #3364a4;">TableViewInteraction</span><span style="color: #333333;"> </span><span style="color: #333333;">InteractionMode</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">get</span><span style="color: #333333;"> </span><span style="color: #333333;">{</span><span style="color: #333333;"> </span><span style="color: #009695;">return</span><span style="color: #333333;"> </span><span style="color: #3364a4;">TableViewInteraction</span><span style="color: #333333;">.</span><span style="color: #333333;">Navigation</span><span style="color: #333333;">;</span><span style="color: #333333;"> </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>Since this ViewController does not require any initialization from the Storyboard, then the constructor is not needed. Here, we&#8217;ve configured several properties, such as the <strong>CellImageSettings</strong>, <strong>CellStyle</strong>, <strong>ImageLoaderSettings</strong> and <strong>InteractionMode</strong>. Let&#8217;s create our last ViewController, which is the EmployeeFormViewController.</p>
<p><img class="alignnone size-full wp-image-7320" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-21-at-3.28.42-PM.png" alt="Screen Shot 2016-03-21 at 3.28.42 PM.png" width="1686" height="1301" /></p>
<p>Then use the following code.</p>
<p><span style="font-family: Menlo;"> <span style="color: #009695;">using</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">Core</span><span style="color: #333333;">.</span><span style="color: #333333;">ViewModels</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> System</span><span style="color: #333333;">.</span><span style="color: #333333;">Drawing</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Intersoft</span><span style="color: #333333;">.</span><span style="color: #333333;">Crosslight</span><span style="color: #333333;">.</span><span style="color: #333333;">iOS</span><span style="color: #333333;">;</span><br />
<span style="color: #009695;">using</span><span style="color: #333333;"> Foundation</span><span style="color: #333333;">;</span></span></p>
<p><span style="color: #009695;">namespace</span><span style="color: #333333;"> XamarinFormsSample</span><span style="color: #333333;">.</span><span style="color: #333333;">iOS</span><br />
<span style="color: #333333;">{</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">[</span><span style="color: #333333;">Register</span><span style="color: #333333;">(</span><span style="color: #f57d00;">&#8220;</span><span style="color: #f57d00;">EmployeeFormViewController</span><span style="color: #f57d00;">&#8220;</span><span style="color: #333333;">)]</span><br />
<span style="color: #333333;">    </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">class</span><span style="color: #333333;"> EmployeeFormViewController </span><span style="color: #333333;">:</span><span style="color: #333333;"> UIFormViewController</span><span style="color: #333333;">&lt;</span><span style="color: #333333;">EmployeeEditorViewModel</span><span style="color: #333333;">&gt;</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">        </span><span style="color: #c12dac;">#region</span><span style="color: #c12dac;"> Methods</span></p>
<p><span style="color: #333333;">        </span><span style="color: #009695;">public</span><span style="color: #333333;"> </span><span style="color: #009695;">override</span><span style="color: #333333;"> </span><span style="color: #009695;">void</span><span style="color: #333333;"> DetermineNavigationMode</span><span style="color: #333333;">(</span><span style="color: #333333;">NavigationParameter parameter</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">            </span><span style="color: #009695;">if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #009695;">this</span><span style="color: #333333;">.</span><span style="color: #333333;">GetService</span><span style="color: #333333;">&lt;</span><span style="color: #333333;">IApplicationService</span><span style="color: #333333;">&gt;()</span><span style="color: #333333;">.</span><span style="color: #333333;">GetContext</span><span style="color: #333333;">()</span><span style="color: #333333;">.</span><span style="color: #333333;">Device</span><span style="color: #333333;">.</span><span style="color: #333333;">Kind </span><span style="color: #333333;">==</span><span style="color: #333333;"> DeviceKind</span><span style="color: #333333;">.</span><span style="color: #333333;">Tablet</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">     </span><span style="color: #3364a4;">        </span><span style="color: #333333;">   </span><span style="font-style: italic; color: #888888;">//</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">Only</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">customize</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">the</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">navigation</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">mode</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">for</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">editing</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">(</span><span style="font-style: italic; color: #888888;">default</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">navigation</span><span style="font-style: italic; color: #888888;"> </span><span style="font-style: italic; color: #888888;">command</span><span style="font-style: italic; color: #888888;">)</span><br />
<span style="color: #333333;">     </span><span style="color: #3364a4;">           if</span><span style="color: #333333;"> </span><span style="color: #333333;">(</span><span style="color: #333333;">parameter</span><span style="color: #c44c57;">.CommandId ==</span><span style="color: #333333;"> </span><span style="color: #009695;">null</span><span style="color: #333333;">)</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">{</span><br />
<span style="color: #333333;">                    parameter</span><span style="color: #333333;">.</span><span style="color: #333333;">PreferPopover </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                    parameter</span><span style="color: #333333;">.</span><span style="color: #333333;">EnsureNavigationContext </span><span style="color: #333333;">=</span><span style="color: #333333;"> </span><span style="color: #009695;">true</span><span style="color: #333333;">;</span><br />
<span style="color: #333333;">                </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">            </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">        </span><span style="color: #333333;">}</span></p>
<p><span style="color: #333333;">        </span><span style="color: #c12dac;">#endregion</span><br />
<span style="color: #333333;">    </span><span style="color: #333333;">}</span><br />
<span style="color: #333333;">}</span></p>
<p>The EmployeeFormViewController is pretty much empty. The DetermineNavigationMode helps to determine whether the app is run from an iPhone or an iPad, and which container should be returned upon navigation. It seems that the iOS app is ready. Let&#8217;s try to give it a run.</p>
<p><img class="alignnone size-full wp-image-7321" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/ios-views.png" alt="ios-views.png" width="1366" height="1136" /></p>
<p>If you notice, our effort to create the iOS app is much smaller compared to the Android version. This is the power of Crosslight. You an easily reuse 100% of the UI logic for iOS and Android platform, allowing developers to accomplish more in less time.</p>
<h1>Samples</h1>
<p>You can obtain the finished sample <a href="http://git.intersoftsolutions.com/projects/CT/repos/crosslightxamarinformsbuilder/browse" target="_blank">here</a>. Simply restore the NuGet packages and hit Run to run the sample properly. Should have any questions, feel free to leave a comment down below or initiate a <a href="http://www.intersoftsolutions.com/#livechat" target="_blank">live chat</a> session with us directly from our website.</p>
<h1>Wrapping Up</h1>
<p>In this tutorial, you have learnt how to migrate a Xamarin Form app to Crosslight which is pretty straightforward. Leveraging MVVM pattern, you have learnt the Crosslight fundamentals, particularly the <em>binding providers</em>, <em>ViewModels</em>, <em>Form Metadata</em>, and <em>Views</em>.</p>
<p>Along the way, you might be interested in several topics, such as the Form Builder, or working with the Storyboard, nonetheless, I highly recommend you to go through each of these topics to quench your thirst:</p>
<ul>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Building+Rich+Data+Entry+Form" target="_blank">Building Rich Data Entry Form</a>
<ul>
<li>If you&#8217;d like to get started with the Form Builder, I highly recommend you to look at the two-part blogpost series I wrote up: <a href="http://blog.intersoftsolutions.com/2015/11/getting-started-with-crosslight-form-builder/" target="_blank">Getting Started with Crosslight Form Builder</a> and <a href="http://blog.intersoftsolutions.com/2015/11/extending-crosslight-form-builder-2/" target="_blank">Extending Crosslight Form Builder</a>.</li>
</ul>
</li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Working+with+iOS+Universal+Storyboards" target="_blank">Working with iOS Universal Storyboards</a></li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Crosslight+Android+Material+Development" target="_blank">Crosslight Android Material Development</a></li>
</ul>
<p>Don&#8217;t hesitate to explore the child pages on the documentation as well, as it contains more detailed information on each particular subject. Hopefully this tutorial helps you on grasping the concepts used in Crosslight development and accelerate in building gorgeous cross-platform apps, without sacrificing any user experiences along the way.</p>
<p>Till next post,<br />
Nicholas Lie</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2016/03/migrating-from-xamarin-forms-to-crosslight-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started with Premier Studio 2016</title>
		<link>http://blog.intersoftsolutions.com/2016/03/getting-started-with-premier-studio-2016/</link>
		<comments>http://blog.intersoftsolutions.com/2016/03/getting-started-with-premier-studio-2016/#comments</comments>
		<pubDate>Mon, 07 Mar 2016 11:52:18 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2016 R1]]></category>
		<category><![CDATA[ClientUI]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Reference Samples]]></category>
		<category><![CDATA[WebUI]]></category>
		<category><![CDATA[Get Started]]></category>
		<category><![CDATA[Premier Studio 2016]]></category>
		<category><![CDATA[Samples]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WebUI Studio]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=5827</guid>
		<description><![CDATA[In our past releases, getting started with Intersoft Premier Studio was quite inconvenience and tedious. With tons of shortcuts to choose from, you can be easily confused where to start from. In this release, we think hard on what&#8217;s the best possible scenario for users [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/getting-started-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="getting-started" style="float:right; margin:0 0 10px 10px;" /><p>In our past releases, getting started with Intersoft Premier Studio was quite inconvenience and tedious. With tons of shortcuts to choose from, you can be easily confused where to start from. In this release, we think hard on what&#8217;s the best possible scenario for users to get started quickly with our products. At the end, we came to a conclusion: <strong>samples</strong>.</p>
<p><img class="aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/getting-started.png" alt="getting-started.png" width="700" align="middle" /></p>
<p>Samples provide a hands-on experience for developers as well as practical code for implementing the desired features to their applications. We&#8217;ve made it super easy for you to run the samples and opening the sample solution in Visual Studio, all right from a single web interface.</p>
<h1>Introducing the New Get Started Experience</h1>
<p>When you install Premier Studio, you&#8217;ll get the following dialog box.</p>
<p><img class="aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/dialog-box.png" alt="dialog-box.png" width="700" align="middle" /></p>
<p>When you click Finish with the checkbox ticked, a new browser will be opened, this will lead you to a landing page that will help you get started with our products (assuming that you have a working internet connection).</p>
<p><img class="alignnone size-full wp-image-5967" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/getting-started2.png" alt="getting-started2.png" width="1326" height="814" /></p>
<p>Simply select one of the products you would like to get started with, you will be immediately presented with the available samples designed in stunning card view interface. Then hover on the samples you&#8217;re interested in to perform an action.</p>
<p>Note that the Get Started experience works only on Windows with Premier Studio (2016 and above) properly installed.</p>
<h1>Getting Started with WebUI</h1>
<p>Nothing explains better than a video. Here&#8217;s a 1-minute video experience on how to get started with WebUI through the new Get Started experience.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/FTLtFX4ZTsI?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>The samples for WebUI is categorized according to its respective controls, so you can quickly jump to the controls you&#8217;re interested in.</p>
<p><img class="aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/webui.png" alt="webui.png" width="700" align="middle" /></p>
<p>When you hover on a sample, you&#8217;ll get the following experience.</p>
<p><img class="aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/webgrid-first-experience1.png" alt="webgrid-first-experience.png" width="500" align="middle" /></p>
<p>When you click on <strong>Open Solution</strong>, a new Visual Studio instance that contains the sample will be automatically opened. When you click on <strong>Run Sample</strong>, a locally-running sample for that particular sample will be launched. Clicking on Learn More takes you to the WebGrid documentation.</p>
<h1>Getting Started with Crosslight</h1>
<p>And here&#8217;s a minute-and-a-half video that shows the Get Started experience with Crosslight.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/2kwHgjbawqI?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>The samples for Crosslight are categorized as follows:</p>
<p><img class="aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/crosslight.png" alt="crosslight.png" width="700" align="middle" /></p>
<ul>
<li><strong>Basic Samples</strong>: These are the basic and recommended samples if you&#8217;re just starting out with Crosslight. It contains the basic fundamentals of Crosslight development, such as MVVM pattern, data binding, display data list, perform CRUD operation, and more.</li>
<li><strong>App Samples</strong>: These samples showcases small, working apps made with Crosslight.</li>
<li><strong>UI Samples</strong>: These samples showcases various UI components available in Crosslight, such as Crosslight Charting, Crosslight Material Design, Crosslight Signature Pad, Crosslight Maps, Crosslight View Slider and more.</li>
<li><strong>Services Samples</strong>: These samples demonstrates how you can work with Crosslight services which are built-in to the Crosslight ViewModel and other library extensions as well. For example, performing calls, scanning barcode, sending emails, sharing content to social media and more.</li>
<li><strong>Data Samples</strong>: These samples shows you how to work with data-related operations with the built-in repositories and how they work together in harmony with the open-source Crosslight App Framework.</li>
</ul>
<p>When you hover on an item, you&#8217;ll be presented with the following.</p>
<p><img class="aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/mvvm-samples.png" alt="mvvm-samples.png" width="500" align="middle" /></p>
<p>When you click on <strong>Download</strong>, you&#8217;ll immediately get a zip file that is immediately runnable using Xamarin Studio or Visual Studio (works on either Mac or Windows). If you click on <strong>Learn More</strong>, you&#8217;ll be taken to the respective sample page in the Developer Center.</p>
<h1>Getting Started with ClientUI</h1>
<p>Last but not least, here&#8217;s another minute-and-a-half video that shows the Get Started experience with ClientUI.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/mgK21rwJkj0?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>The samples for ClientUI are categorized as follows.</p>
<p><img class="aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/clientui.png" alt="clientui.png" width="700" align="middle" /></p>
<p>The categorization follows the previous categories available in the <a href="http://live.clientui.com" target="_blank">ClientUI Live Samples</a>. When hovering to an item, you&#8217;ll be presented with the following experience.</p>
<p><img class="aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/03/clientui-item.png" alt="clientui-item.png" width="700" align="middle" /></p>
<p>If the sample has a WPF counterpart, then an additional combo box will be displayed for WPF, as well as the <strong>Run Sample</strong> option. If the WPF counterpart is not available, then the combo box will not appear. When clicking on the <strong>Open Solution</strong>, then the Silverlight solution will be opened. Similarly, clicking on <strong>Run Sample</strong> will run the Silverlight sample locally on your computer.</p>
<h1>Conclusion</h1>
<p>We hope you enjoyed the new Getting Started experience available in this new release. Should you have any feedback with the Getting Started experience, feel free to <a href="http://www.intersoftsolutions.com/#livechat" target="_blank">initiate a chat with us</a>, and we’ll be more than happy to assist you for the best on-boarding experience.</p>
<p>Till next post,<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2016/03/getting-started-with-premier-studio-2016/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Premier Studio 2016 is here.</title>
		<link>http://blog.intersoftsolutions.com/2016/02/premier-studio-2016-is-here/</link>
		<comments>http://blog.intersoftsolutions.com/2016/02/premier-studio-2016-is-here/#comments</comments>
		<pubDate>Mon, 29 Feb 2016 05:21:36 +0000</pubDate>
		<dc:creator><![CDATA[Jimmy Petrus]]></dc:creator>
				<category><![CDATA[2016 R1]]></category>
		<category><![CDATA[announcement]]></category>
		<category><![CDATA[ClientUI]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[WebUI]]></category>
		<category><![CDATA[New Releases]]></category>
		<category><![CDATA[WebUI Studio]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=5669</guid>
		<description><![CDATA[The wait is over! Premier Studio 2016 is here, our biggest and most revolutionary release since Intersoft was established. Our team worked very hard to ensure the best quality of the products delivered in this release. A big thanks to you all for your continuous [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/premier-studio-2016-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="Premier Studio 2016" style="float:right; margin:0 0 10px 10px;" /><p>The wait is over! Premier Studio 2016 is here, our biggest and most revolutionary release since Intersoft was established. Our team worked very hard to ensure the best quality of the products delivered in this release. A big thanks to you all for your continuous support and feedback to make this great release a reality.</p>
<p><img class="alignnone size-large wp-image-5678" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/premier-studio-2016-1024x467.png" alt="Premier Studio 2016" width="700" /></p>
<p>This latest release brings major upgrades to all our toolset across 5 platforms, including ASP​.​NET, Silverlight, WPF, iOS, and Android. It reflects on our continuous commitment to create the most innovative and forward-thinking toolset that dramatically improve productivity and shorten development time. We&#8217;re very excited to have something new for everyone!</p>
<p>We started out by revamping our entire product lineups starting with WebUI, which includes 40+ web components, with Unified Theming support. The new feature now uses advanced SCSS in combination with Node SASS and Web Compiler to achieve a modern, unified look and feel across the lineup. It&#8217;s the best of both worlds: industry&#8217;s most advanced web components with beautiful and gorgeous design combined into a single, complete package. More importantly, all WebUI lineups have been reengineered with the latest and greatest web technologies, so you can expect responsive design and full support for latest major browsers like IE11, Edge, Safari 9, Chrome 48, Firefox 44.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/webui-2016-banner.jpg"><img class="alignnone size-large wp-image-5673" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/webui-2016-banner-1024x574.jpg" alt="WebUI 2016" width="700" /></a></p>
<p>Next, the most anticipated improvement for Crosslight is here. Fully embracing Material Design, building gorgeous Material apps is no longer a chore. The new v7 library introduced in this release was built from the ground up, taking account the user experience and interaction covered in the new Material Design. With the new library and simplified APIs, you can now easily add Material Design elements and interactions such as Floating Action Buttons, Collapsing Toolbars with expand/collapse behaviors, parallax scrolling, Material Navigation Drawer, and so much more.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/crosslight5-banner.png"><img class="alignnone size-large wp-image-5675" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/crosslight5-banner-1024x596.png" alt="crosslight5-banner" width="700" /></a></p>
<p>Another important milestone in this release, we&#8217;ve smoothened out the development experience by fully embracing NuGet package manager as the main delivery channel for future Crosslight builds, so you don&#8217;t have to worry about tedious packages references to ensure your Crosslight solution and samples work properly.</p>
<p>Introducing the new ClientUI Reporting for WPF, now you can easily author and build gorgeous enterprise reports from the convenience of your desktop. Fully optimized and fine-tuned for WPF, ClientUI Reporting for WPF ensures that your existing ClientUI reports will continue to work as it is, whether it&#8217;s on the desktop or on the web.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/clientui12-banner1.png"><img class="alignnone wp-image-5681 size-large" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/clientui12-banner1-1024x545.png" alt="" width="604" height="321" /></a></p>
<p>Visualizing your data in your reports? We have something special in store for you. In this release, new charting support with over more than 20+ types of charts are now available in ClientUI Reporting, for both WPF and Silverlight platforms. Whether it&#8217;s doughnut, pie, line, bar, columns, anything. We&#8217;ve got it all covered. This new addition is sign of our enduring commitment towards ClientUI and continues to strengthen ClientUI&#8217;s position as the best toolset for enterprise development on Silverlight and WPF platforms.</p>
<h1>Download Now</h1>
<p>To begin enjoying this new release, simply <a href="http://intersoftsolutions.com/account" target="_blank">sign-in</a> to your account to download the latest release, or request a trial <a href="http://intersoftsolutions.com/RequestTrial" target="_blank">here</a>.</p>
<p>While waiting for downloads, please follow the links below to learn more what’s new in this latest release:</p>
<ul>
<li><a href="http://intersoftsolutions.com/Corporate/PressRelease/dca52020-15ed-4d59-891e-9dee63197e21" target="_blank">Press Release</a> — an official overview of the release</li>
<li><a href="http://intersoftsolutions.com/2016" target="_blank">2016 Tour</a> — a comprehensive details of each new component and new feature introduced in this release</li>
</ul>
<p>In addition to product bits, we&#8217;ve moved forward to a better direction which greatly enhance and simplify installation experience. The first thing you notice when downloading the new installer is its absolutely small size, 480MB, which is about half the size of previous installer. It&#8217;s made possible as we no longer ship offline documentation since we&#8217;re completely transitioning to agile workflow for all products (including WebUI and ClientUI now). This direction allows all our documentation to be updated online, whenever new features are added, instead of waiting for the next installer update. As the result, Intersoft Developer Center has been significantly updated to cover new documentation for all the three platforms. You can start exploring <a href="http://developer.intersoftsolutions.com">here</a>.</p>
<p>Finally, we hope you enjoy our latest release as much as we love building it. We look forward to see what you will build next!</p>
<p>Note: New licenses will be sent out to all active subscribers in 24 hours after this announcement. You’ll receive a notification email when your account is updated.</p>
<p>All the best,<br />
Jimmy</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2016/02/premier-studio-2016-is-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Closer Look at Premier Studio 2016</title>
		<link>http://blog.intersoftsolutions.com/2016/01/a-closer-look-at-premier-studio-2016/</link>
		<comments>http://blog.intersoftsolutions.com/2016/01/a-closer-look-at-premier-studio-2016/#comments</comments>
		<pubDate>Fri, 29 Jan 2016 07:09:32 +0000</pubDate>
		<dc:creator><![CDATA[Jimmy Petrus]]></dc:creator>
				<category><![CDATA[2016 R1]]></category>
		<category><![CDATA[ClientUI]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[WebUI]]></category>
		<category><![CDATA[Android Material]]></category>
		<category><![CDATA[Premier Studio]]></category>
		<category><![CDATA[WebUI Studio ASP.NET]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=5557</guid>
		<description><![CDATA[In this first post of the year, I’d like to share something fresh and exciting for all of you. As you might have aware, we’ve been working hard on a big release since the past few months. It’s in deed our biggest release yet so [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/crosslight-android-swipe-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="iOS-style swipe to action in Crosslight Android RecycleView" style="float:right; margin:0 0 10px 10px;" /><p>In this first post of the year, I’d like to share something fresh and exciting for all of you. As you might have aware, we’ve been working hard on a big release since the past few months. It’s in deed our biggest release yet so far — with major upgrades to all flagship products across all 7 platforms which include WebUI, ClientUI, and obviously, Crosslight. So what does that mean to you, and what you can expect in the upcoming release? Read on.</p>
<p>Whether you have a Premier subscription, or individual platform subscription, you’re getting the most out of your investment, and more importantly, get ready to kick off the new year with new goodies we’ve prepared for you.</p>
<p>As we’re reaching the RTM milestone, most of the product bits are ready. That said, here are some latest previews, fresh from the kitchen.</p>
<h1 id="crosslight">A Whole New Level of Crosslight Development Experience</h1>
<p>Crosslight developers, rejoice! Gone are the days of assembly references nightmare. In the new release, we’re strongly focused in creating a better development experience in addition to new tools and features. Our goal is to make getting started with Crosslight as easy as 1-2-3, where you can start from a blank Xamarin project or downloading a Crosslight sample, add Crosslight package, and start writing some code.</p>
<p>To make that happen, we’ve created over 60 NuGet packages that you can consume with a simple click. We designed our packages to be atomic which align with the Crosslight nature: highly extensible and modular.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/nuget-vs.png"><img class="alignnone wp-image-5575" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/nuget-vs-1024x548.png" alt="Crosslight NuGet Packages" width="700" height="375" /></a></p>
<p>Unlike typical packages, Crosslight NuGet packages are designed for cross-platform targeting, allowing you to simply add a single package which automatically install to multiple projects in the solutions, including Core, iOS, Android, Windows Phone and Windows 8 projects. In addition, we also made available special packages for Xamarin Support and Google Play Services which have been strongly signed. The end result is clear, a much streamlined, hassle-free development experience.</p>
<p>More importantly, Crosslight&#8217;s packages implemented auto dependencies which greatly improve developer experince. Let’s say you want to add logging with Azure integration, you just need to add the Crosslight Logging Azure Insights package. It automatically adds required dependencies such as Crosslight Logging and Azure Service packages to all client and server projects.</p>
<p>This makes building cross-platform apps with Crosslight ultimately simple and easy. Not to mention you can now perform updates in a single click as new Crosslight updates are available. No more frustrating, error-prone manual updates.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/nuget-vs-update.png"><img class="alignnone size-large wp-image-5577" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/nuget-vs-update-1024x588.png" alt="Updating Crosslight" width="604" height="347" /></a></p>
<p>But wait, does it work in Xamarin Studio on the Mac? Yep, absolutely. The entire goal of adopting NuGet is due to cross-platform nature of Crosslight where developers typically work with the project across different operating systems and IDEs. Using NuGet is the perfect strategy for such cross-platform development since all references are stored locally in each solution folder.</p>
<p>To make NuGet works the way we desire, we shipped a special package manager console add-in for Xamarin Studio. This allows you to simply type a command, and have the specified package added to all projects in the solution.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/nuget-xs.png"><img class="alignnone wp-image-5579" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/nuget-xs-1024x298.png" alt="Intersoft Package Console for Xamarin Studio" width="649" height="189" /></a></p>
<p>Here&#8217;s an example result of a Crosslight solution with NuGet in Xamarin Studio.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/crosslight-xs.png"><img class="alignnone wp-image-5582" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/crosslight-xs-1024x741.png" alt="Crosslight NuGet support for Xamarin Studio" width="700" height="506" /></a></p>
<p>Note that although Crosslight 5 pre-release packages have been made available to NuGet for a while, they are published particularly for testing purpose. The latest submission is a near-final build which is feature-complete and stable. Surely you can give it an early look, although we recommend you to wait for a little while, at least until we released the accompanying samples next week.</p>
<h1>Introducing Crosslight Android Material</h1>
<p>Crosslight Android Material is arguably the most anticipated features in Crosslight 5. The new release ships thousands of new features and resolved backlogs. But what excites me the most in this release is the all-new, shiny Crosslight for Android Material, which is a result of many months of intensive engineering and meticulous UX design.</p>
<p>We&#8217;ve made it super easy for you to create beautiful Android Material experience. It’s all started with the new Crosslight Fragment component which provides a wealth of APIs and built-in features. Let&#8217;s take a quick look at the Material version of our popular Inventory sample.</p>
<div style="width: 400px; " class="wp-video"><!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->
<video class="wp-video-shortcode" id="video-5557-1" width="400" height="360" autoplay="1" preload="metadata" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/inventory-material.mp4?_=1" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/inventory-material.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/inventory-material.mp4</a></video></div>
<p>Unlike the native Android development, creating Material experience with Crosslight is simple yet elegant. Here are some code snippets to give you some ideas how Crosslight Material APIs look like.</p>
<p id="bar-items">Want to add bar items? It&#8217;s easy.</p>
<p></p><pre class="crayon-plain-tag">protected override void Initialize()
{
    base.Initialize();

    this.AddBarItem(new BarItem("SaveButton", CommandItemType.Save) { ShowAsAction = ShowAsAction.Always });
    this.AddBarItem(new BarItem("CancelButton", CommandItemType.Cancel) { ShowAsAction = ShowAsAction.Always });
}</pre><p></p>
<p id="fab">Adding a floating action button? Just a single API to call.</p>
<p></p><pre class="crayon-plain-tag">protected override void Initialize()
{
    base.Initialize();

    this.FloatingActionButtons.Add(new FloatingActionButton("EditItem")
    {
        Position = FloatingActionButtonPosition.BottomRight,
        IconId = Resource.Drawable.edit,
        Direction = FloatingActionButtonDirection.Up,
        HideOnScrollUp = true
    });
}</pre><p>Presenting a parallax image with collapsible toolbar? Piece of cake.</p><pre class="crayon-plain-tag">protected override void Initialize()
{
    base.Initialize();

    this.ToolbarSettings.Mode = ToolbarMode.Collapsing;
    this.ToolbarSettings.CollapsingToolbarSettings.EnableParallaxImage = true;
    this.ToolbarSettings.CollapsingToolbarSettings.ExpandedHeight = 240;
}</pre><p></p>
<p id="swipe">iOS-style swipe-to-action? That&#8217;s built-in.</p>
<p></p><pre class="crayon-plain-tag">protected override void Initialize()
{
    base.Initialize();

    this.EditActions.Add(new EditAction("Sold"));
    this.EditActions.Add(new EditAction("Delete", true));
}</pre><p>The result of the edit actions can be seen below.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/crosslight-android-swipe.png"><img class="alignnone wp-image-5586" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/crosslight-android-swipe-632x1024.png" alt="iOS-style swipe to action in Crosslight Android RecycleView" width="300" height="486" /></a></p>
<p>As seen in several examples above, we’ve redesigned the entire Android development experience so you can define behaviors and features with simple API, minimizing the needs on AXML layout. That saves countless of hours, we&#8217;ve experienced that ourselves.</p>
<p>The Crosslight Android Material ships with 50+ components exclusively engineered for Material user experience. This includes a brand-new navigation view, card view, recycle view, collection view, and iOS-style split view complete with editing mode, multiple selection and all data-related functionality you would expect.</p>
<p>The following image shows the all-powerful SplitViewFragment.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/crosslight-android-splitview.png"><img class="alignnone wp-image-5588" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/crosslight-android-splitview-1024x662.png" alt="Crosslight Android SplitView" width="701" height="453" /></a></p>
<p>To let you quickly learn and explore the new Crosslight for Android Material, we’re re-creating over 40 Crosslight samples to support the latest platforms and best practices. All Crosslight samples are also NuGet-enabled now, so you can now get started by simply downloading them and restore the packages. We’ll be publishing out these new samples ahead of the release so you can give it a try early. Stay tuned for our next announcement.</p>
<h1 id="webui">Big WebUI Revolution.</h1>
<p>It’s unlike any WebUI you’ve seen before. All 40+ WebUI components are redesigned from the ground-up to leverage the latest technologies and trends in web development. In the <a href="http://blog.intersoftsolutions.com/2015/11/the-next-webui/">previous post</a>, Nicholas has shown you a preview of the upcoming WebUI redesign. But that’s only a fraction of what we’re working on. We introduced hundreds of new styles which are meticulousy designed for every component, every feature, and every little interaction detail.</p>
<p>In this post, I’m thrilled to show you WebGrid Enterprise 10, with its all-new, wonderful user interface design. It marries the best of both worlds — the most advanced data grid functionality and a modern user interface. Here’s how WebGrid 10 looks like at a glance.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/webgrid-10-new.png"><img class="alignnone wp-image-5590" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/webgrid-10-new-1024x675.png" alt="The All New WebGrid Enterprise" width="700" height="462" /></a></p>
<p>The new WebGrid theme is designed to be timeless, incorporating SVG for all icons and glyphs, allowing your WebUI apps to look great in any screen display, from standard resolutions to iMac 5K display. To make that dream a reality, our designers have been busy creating some 500+ icons exclusively designed for WebUI, then engineered to perfection with our latest Unified Theming framework.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/webgrid-svg-final.png"><img class="alignnone wp-image-5591" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/webgrid-svg-final-1024x800.png" alt="Redesigned WebGrid UI with SVG" width="700" height="547" /></a></p>
<p>The redesign for hierarchical and batch update UI have been one of the most challenging tasks as they are unique features in WebGrid. You won’t find any design references on jQuery or Bootstrap-based grids which are mostly a plain table. So we invented one for you.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/hierarchical-grid.png"><img class="alignnone wp-image-5592" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/hierarchical-grid-1024x673.png" alt="Hierarchical WebGrid" width="700" height="460" /></a></p>
<p>Pivot chart, one of the flagship features in WebGrid, has been completely redesigned along with the ribbon, pivot area, drag-drop interaction, data filter experience and more.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/pivot-chart.png"><img class="alignnone size-large wp-image-5593" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/pivot-chart-1024x659.png" alt="Pivot Chart" width="604" height="389" /></a></p>
<p>And even to every little details, such as sort indicator, filter elements, and context menu. Everything is new in WebGrid 10.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/improved-ux.png"><img class="alignnone wp-image-5594 size-large" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/improved-ux-1024x747.png" alt="Improved UX" width="604" height="441" /></a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/pixel-perfect-design.png"><img class="alignnone wp-image-5595" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/pixel-perfect-design-1024x765.png" alt="Pixel-perfect Design" width="700" height="523" /></a></p>
<p>&nbsp;</p>
<p>How about other WebUI components? Definitely you won’t be able to build a full-fledged web app with only a single WebGrid component. We’ve a lot of new and interesting UI goodies to offer. For instance, WebPaneManager now allows you to create various modern layout such as those found in Apple Mail app, OneDrive, or iCloud. The entire lineup of WebDesktop, WebEssentials, and WebScheduler are joining force this big WebUI revolution.</p>
<p>We can’t wait to deliver these exciting major WebUI release to you soon. Stay tuned for our next announcement when our new demo is published.</p>
<h1 id="clientui">Stunning Charts for Enterprise Reporting.</h1>
<p>As if it weren’t enough, the 2016 release also ships a major upgrade to ClientUI, the enterprise developer’s choice of toolset. We’re strongly focused in creating new features that make enterprise desktop apps development even easier.</p>
<p>You can now add professional-looking charts right in your reports. It works the way you expect it to be — drag the chart to the designer surface, bind it to a data source, and choose a chart type from the intuitive Chart Designer. Voila! Here you go.</p>
<p>The following images show the chart designer and the report viewer respectively.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/ChartDesigner.png"><img class="alignnone wp-image-5597" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/ChartDesigner.png" alt="Chart Designer" width="701" height="499" /></a></p>
<p>&nbsp;</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/Reporting_Chart.png"><img class="alignnone wp-image-5598" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/Reporting_Chart-1024x620.png" alt="Reporting with Chart" width="701" height="424" /></a></p>
<p>We offer dozens of chart types commonly used in financial and enterprise reports, including bar, column, pie, doughnut, bubble, scatter, range and much more.</p>
<p>That’s not all. The new chart feature will be also available and fully supported in WPF platform. In the previous release, the reporting suite are only partially available in WPF. And starting in this release, we’re pleased to announce that all ClientUI components and features in Silverlight have been made available in WPF. Our WPF team has been working hard to optimize every control and features so they run with best performance and flawlessly in WPF as well as in the latest Windows 10 release.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/Reporting-Samples.png"><img class="alignnone wp-image-5599" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/Reporting-Samples-1024x488.png" alt="Reporting Samples" width="701" height="334" /></a></p>
<p>And as a bonus, ClientUI 12 will include a report conversion tool for Crystal Report files. So if you&#8217;re tasked to migrate a bunch of CR reports, you’ll love this small yet time-saving tool.</p>
<h1>Coming Soon</h1>
<p>Premier Studio 2016 is slated for a public release on mid February 2016. Our team is currently making final touch to the products and preparing an even better development experience to everyone. Last but not least, we’re also working on a new series of getting started guide and improvements to over hundreds of documentation pages.</p>
<p>Last but not least, we’re giving out a free 3 month extension for all expiring subscriptions between Nov 2015 and Jan 2016. We’d love to have you joining us to celebrate our biggest release yet.</p>
<p>At the meantime, we want to hear from you what new tools/features in the upcoming release that you anticipated the most. We’ll also welcome any feedback!</p>
<p>Best,<br />
Jimmy</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2016/01/a-closer-look-at-premier-studio-2016/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2016/01/inventory-material.mp4" length="19493242" type="video/mp4" />
		</item>
		<item>
		<title>Getting Started with Crosslight Collection Views and Grid Views</title>
		<link>http://blog.intersoftsolutions.com/2015/11/getting-started-with-crosslight-collection-views-and-grid-views-5/</link>
		<comments>http://blog.intersoftsolutions.com/2015/11/getting-started-with-crosslight-collection-views-and-grid-views-5/#comments</comments>
		<pubDate>Thu, 26 Nov 2015 09:32:18 +0000</pubDate>
		<dc:creator><![CDATA[Arief]]></dc:creator>
				<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[kb-how-to-article]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[collection view]]></category>
		<category><![CDATA[Cross Platform]]></category>
		<category><![CDATA[grid view]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[springboard]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=5483</guid>
		<description><![CDATA[Hi guys, Arief here from the Intersoft Consultant team. Today I will talk about how to use iOS Collection View and Android Grid View in order to create a beautiful cross-platform navigation menu. At the end of this tutorial, you&#8217;ll learn how to use the collection view in [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Result-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="Result" style="float:right; margin:0 0 10px 10px;" /><p>Hi guys, Arief here from the Intersoft Consultant team. Today I will talk about how to use iOS Collection View and Android Grid View in order to create a beautiful cross-platform navigation menu. At the end of this tutorial, you&#8217;ll learn how to use the collection view in your Crosslight applications, which looks similar to the following illustration.</p>
<p><img class="alignnone wp-image-5524 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Result.png" alt="Result" width="865" height="726" /></p>
<h1>Introduction</h1>
<p>Collection View / Grid View (will be referred as <em>Collection View</em> from now on) is a very versatile user interface. As a matter fact, both <em>iOS</em> and <em>Android</em> have always been using it as a native pattern for Springboard (iOS home) as well as lots of other Android launchers. Nowadays those trends start to spread throughout business apps considering how user-friendly and eye-pleasing when compared to the plain old list view.</p>
<p>If you are interested in creating a gorgeous and cool business apps, using collection view is a must! In this tutorial, I will guide you step by step how you can create collection view using the <em>Crosslight style</em>.</p>
<p>Here are the steps that you need to follow:</p>
<ul>
<li>Core Preparation</li>
<li>Assets Preparation</li>
<li>Designing Android Grid View</li>
<li>Designing iOS Collection View</li>
<li>Capturing Selection</li>
</ul>
<p>Without further ado, let&#8217;s get started!</p>
<h1>Preparing the Project</h1>
<p>The first thing you&#8217;ll need is, of course, the project itself. Start by creating a new project using Crosslight Project Wizard and choose the <strong>Blank</strong> template. To do this, from Visual Studio 2012 and upwards, choose <strong>New</strong>, <strong>Project</strong>. From the dialog that appears, choose <strong>Crosslight</strong> and choose to create a new Crosslight application with the <strong>Blank</strong> template. For the purposes of this tutorial, we&#8217;ll name this project: <strong>CollectionView. </strong>Now that you have your project ready, let&#8217;s move on.</p>
<h1>Core Preparation</h1>
<p>Here are several things you need to prepare at the project Core level:</p>
<ul>
<li>Prepare the ViewModel</li>
<li>Prepare the BindingProvider</li>
</ul>
<h2>Prepare the ViewModel</h2>
<p>Begin by creating a new ViewModel in <strong>CollectionView.Core/ViewModels</strong> folder. Simply right-click on the <strong>ViewModels</strong> folder and choose <strong>Add</strong>, <strong>New Item</strong>. We will be repeating this method several times in later sections to add new items to our project, so keep this in mind.</p>
<p><img class="alignnone wp-image-5285 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Untitled1.png" alt="Adding New Item" width="619" height="356" /></p>
<p>Crosslight also ships with built-in item templates that are integrated with Visual Studio, so you can quickly create Crosslight classes right within Visual Studio or Xamarin Studio. In the next dialog that appears, choose <strong>Visual C</strong>#, <strong>Crosslight</strong>, then choose <strong>Crosslight List View Model</strong>. Name this ViewModel as <strong>CollectionViewModel</strong>.</p>
<p><img class="alignnone wp-image-5286 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Untitled2.png" alt="CrosslightListViewModel" width="955" height="582" /></p>
<p>Copy-paste these codes to the newly-created <strong>CollectionViewModel.cs</strong>:</p><pre class="crayon-plain-tag">using Intersoft.Crosslight;
using Intersoft.Crosslight.ViewModels;
using System.Collections.Generic;

namespace CollectionView.Core.ViewModels
{
    public class CollectionViewModel : ListViewModelBase
    {
        #region Constructors

        public CollectionViewModel()
        {
			List items = new List();

			items.Add(new NavigationItem("Ride", typeof(SimpleViewModel)) { Image = "CrosstransRide.png" });
			items.Add(new NavigationItem("Delivery", typeof(SimpleViewModel))  { Image = "CrosstransDeliver.png" });
			items.Add(new NavigationItem("Food", typeof(SimpleViewModel))  { Image = "CrosstransFood.png" });
			items.Add(new NavigationItem("Shop", typeof(SimpleViewModel))  { Image = "CrosstransShop.png" });

			this.SourceItems = items;
        }

        #endregion
    }
}</pre><p>Let&#8217;s take a quick look at the above code. In the constructor of the <strong>CollectionViewModel</strong>, we initialize a list of <strong>NavigationItems</strong> that holds the navigation menus. <strong>NavigationItem</strong> is a very useful class provided by Crosslight that you can utilize to create a menu, as it holds all the common properties you need to create a navigation item. All you have to do is simply populate it with the menu title, image/icon name, and the target <em>ViewModel</em> as navigation target.</p>
<h2>Preparing the BindingProvider</h2>
<p>Next step would be adding a new <strong>Crosslight List Binding Provider</strong> under your <strong>CollectionView.Core/BindingProviders </strong>folder. Give it a name of <strong>CollectionBindingProvider.cs.</strong></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Untitled3.png"><img class="alignnone wp-image-5289 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Untitled3.png" alt="CrosslightListBindingProvider" width="955" height="582" /></a></p>
<p>And change the code to the following:</p><pre class="crayon-plain-tag">using Intersoft.Crosslight;

namespace CollectionView.Core.BindingProviders
{
    public class CollectionViewBindingProvider : BindingProvider
    {
        #region Constructors

        public CollectionViewBindingProvider()
        {
            ItemBindingDescription itemBinding = new ItemBindingDescription
            {
                DisplayMemberPath = "Title",
                ImageMemberPath = "Image",
                NavigateMemberPath = "Target"
            };

            this.AddBinding("GridView", BindableProperties.ItemsSourceProperty, "Items");
            this.AddBinding("GridView", BindableProperties.ItemTemplateBindingProperty, itemBinding, true);
            this.AddBinding("GridView", BindableProperties.IsBatchUpdatingProperty, "IsBatchUpdating");
            this.AddBinding("GridView", BindableProperties.SelectedItemProperty, "SelectedItem", BindingMode.TwoWay);
            this.AddBinding("GridView", BindableProperties.SelectedItemsProperty, "SelectedItems", BindingMode.TwoWay);
            this.AddBinding("GridView", BindableProperties.IsEditingProperty, "IsEditing", BindingMode.TwoWay);

            this.AddBinding("RefreshButton", BindableProperties.RefreshCommandProperty, "RefreshCommand");

            // navigation
            //this.AddBinding("TableView", BindableProperties.DetailNavigationTargetProperty, new NavigationTarget(typeof(TViewModel)), true);

            // edit commands
            this.AddBinding("AddButton", BindableProperties.CommandProperty, "AddCommand");

            this.AddBinding("DeleteButton", BindableProperties.CommandProperty, "DeleteCommand");
            this.AddBinding("DeleteButton", BindableProperties.CommandParameterProperty, "SelectedItems");
        }

        #endregion
    }
}</pre><p>In the above code, we simply comment out the <strong>DetailNavigationTargetProperty</strong>, as it won&#8217;t be needed because our goal is only to create a navigation menu. It will be needed if you want to create <a href="http://developer.intersoftsolutions.com/display/crosslight/Master-Detail+Navigation">Master-Detail Navigation</a>. We also assign the <strong>MemberPaths </strong>with the properties from <strong>NavigationItem</strong>, such as <strong>ImageMemberPath</strong> for the icon, <strong>DisplayMemberPath</strong> for displaying the title, and <strong>NavigateMemberPath </strong>for the target <em>ViewModel</em> menu. To learn more about Crosslight Binding Provider, check out this <a href="http://developer.intersoftsolutions.com/display/crosslight/Understanding+Binding+Providers">link</a>.</p>
<p><img class="alignnone wp-image-5291 size-medium" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Untitled4-300x71.png" alt="Cave Johnson, We'll done here!" width="300" height="71" /></p>
<p>Your Core is up and ready. Let&#8217;s prepare our assets next.</p>
<h1>Assets Preparation</h1>
<p>Previously in the Binding Provider, you have already specified the <strong>Image</strong> property in <strong>NavigationItem</strong> from <em>ViewModel</em> which contains the filename for the .png file that we will use. When you bind it to the <em>BindableProperties.ImageProperty</em> or <em>ImageMemberPath</em>, it will find the appropriate files to use in<strong> CollectionView.Android/Resources/drawable</strong> or in <strong>CollectionView.iOS/Resources. </strong>So you need to put <a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Image.zip">these files</a> inside both folders because we will be using it for our app&#8217;s interface.<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/CrosstransFood.png"><br />
</a></p>
<p>Tip: Make sure to optimize the size of your image files. In some phones, images with humongous file size will be ignored and they won&#8217;t show. Okay, since you have finished preparing the assets, let&#8217;s continue to Android GridView!</p>
<h1>Designing Android GridView</h1>
<p>Designing a view for Android is relatively easy and simple. In overall, we&#8217;ll be doing these tasks:</p>
<ul>
<li>Create an Activity for <strong>CollectionActivity</strong>.</li>
<li>Create the view layout.</li>
<li>Define the <strong>ContentLayoutId</strong> and <strong>ItemLayoutId</strong>.</li>
</ul>
<p>To start, simply add a new item and use <strong>Crosslight Android Activity</strong> to get started. Put it inside the <strong>CollectionView.Android/Activities </strong>folder and name it <strong>CollectionActivity.cs</strong>.</p>
<p><img class="gr-progress alignnone wp-image-5293 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Untitled5.png" alt="Crosslight Android Activity" width="955" height="582" /></p>
<p>After your <strong>CollectionActivity</strong> is created, change the contents of the class to the following code.</p><pre class="crayon-plain-tag">using Android.App;
using Intersoft.Crosslight;
using Intersoft.Crosslight.Android;

namespace CollectionView.Android.Activities
{
    [Activity(Label = "Menu")]
    [ImportBinding(typeof(CollectionBindingProvider))]
    public class CollectionActivity : GridActivity
    {
        public override ListViewInteraction InteractionMode
        {
            get{ return ListViewInteraction.Navigation; }
        }

        protected override int ContentLayoutId
        {
            get{ return Resource.Layout.CollectionLayout;}
        }

        protected override int GridItemLayoutId 
        {
	       get{ return Resource.Layout.ItemLayout; }
	    }

        protected override void InitializeView()
        {
            base.InitializeView();
            this.GridView.NumColumns = 2;
        }
    }
}</pre><p>We need to replace the <strong>Activity</strong> with <strong>GridActivity</strong>,<strong> </strong>in<strong> </strong>which then you have more properties to override: <strong>ListViewInteraction</strong>. By overriding the <strong>ListViewInteraction</strong> into <strong>ListViewInteraction.Navigation</strong>, it allows the user to use the grid as a navigation button when an item is tapped.</p>
<p><strong>ContentLayoutId</strong> is also overridden since we want to customize the appearance of our GridView, which we will do in just a moment. The <strong>ItemLayoutId </strong>is overridden to customize the item layout to be used with the GridView. Both <strong>ContentLayoutId</strong> and <strong>ItemLayoutId</strong> refers to Android layout files which exist in the <strong>CollectionView.Android/Resources</strong> folder.</p>
<p>Since we only have two columns for this scenario, we can simply provide the number of columns to show in the overridden <strong>InitializeView</strong> method by setting <strong>this.GridView.NumColumns </strong>to <strong>2</strong>. The advantage of using this method is: you actually don&#8217;t need to specify the width of the Grid. The <em>GridActivity</em> automatically adjusts the optimal number of items by taking account the viewport width.</p>
<p>Earlier, we&#8217;ve specified the <strong>ContentLayoutId</strong> and <strong>ItemLayoutId</strong> in our Activity. Now let&#8217;s create those layouts. You will need to create two layouts inside <strong>CollectionView.Android/Resources/layout </strong>folder using <em>Android Layout</em> item template. We will name it <strong>CollectionLayout.axml</strong> &amp; <strong>ItemLayout.axml.</strong></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidLayout1.png"><img class="alignnone size-full wp-image-5531" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidLayout1.png" alt="AndroidLayout" width="955" height="582" /></a></p>
<p>Here&#8217;s the code for <strong>CollectionLayout.axml</strong> and <strong>ItemLayout.axml</strong> respectively.</p><pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/CrosstransBg"
    android:minWidth="25px"
    android:minHeight="25px"&gt;
    &lt;LinearLayout
        android:orientation="horizontal"
        android:layout_marginBottom="25dp"
        android:layout_marginTop="50dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/linearLayout1"
        android:gravity="center_horizontal"&gt;
        &lt;ImageView
            android:src="@drawable/CrosstransLogo"
            android:layout_width="wrap_content"
            android:layout_height="100dp"
            android:id="@+id/imageView1" /&gt;
    &lt;/LinearLayout&gt;
    &lt;GridView
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_margin="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:verticalSpacing="20dp"
        android:horizontalSpacing="20dp"
        android:id="@+id/GridView" /&gt;
&lt;/LinearLayout&gt;</pre><p>From the designer&#8217;s view, the <strong>CollectionLayout </strong>looks like the following:</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/CollectionLayout1.png"><img class="alignnone size-full wp-image-5544" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/CollectionLayout1.png" alt="CollectionLayout" width="728" height="574" /></a></p>
<p>and here&#8217;s the contents for <strong>ItemLayout.axml</strong>:</p><pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:minWidth="25px"
    android:minHeight="25px"
    android:background="#CC2368C0"
    android:gravity="center_horizontal"&gt;
    &lt;LinearLayout
        android:orientation="vertical"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:id="@+id/linearLayout1"
        android:gravity="center_horizontal|center_vertical"&gt;
        &lt;ImageView
            android:src="@android:drawable/ic_menu_gallery"
            android:scaleType="centerCrop"
            android:adjustViewBounds="true"
            android:layout_width="wrap_content"
            android:layout_height="50dp"
            android:id="@+id/ImageView" /&gt;
    &lt;/LinearLayout&gt;
    &lt;TextView
        android:text="Medium Text"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="20dp"
        android:id="@+id/TextLabel"
        android:gravity="center_horizontal" /&gt;
&lt;/LinearLayout&gt;</pre><p>From the designer&#8217;s view, it looks like this:</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ItemLayout.png"><img class="alignnone size-full wp-image-5545" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ItemLayout.png" alt="ItemLayout" width="726" height="569" /></a></p>
<p>In summary, what I do in <strong>CollectionLayout.axml</strong> is setting the background for the page, add a header, and provide enough spacing between GridView items. The most important things to note is I&#8217;ve defined the GridView id,  <strong>@+id/GridView. </strong>The will be the reference that we defined in <em>BindingProvider</em> to the property in <em>ViewModel, </em>so make sure the id name is right!</p>
<p>We will be doing a similar task with<strong> ItemLayout.axml</strong>, where we assign both <strong>ImageView</strong> to the <strong>Image</strong> Property in <em>ViewModel</em> and <strong>TextView</strong> to <strong>Title</strong> Property in <em>ViewModel</em>. By default, Crosslight provides two built-in ids for showing an image and a text for item template, which has the name <em>ImageView</em> and <em>TextLabel</em> respectively. But if you want to add additional view elements to the item template, then you can simply add a new binding definition in the binding provider like this which must be done in BindingProvider:</p><pre class="crayon-plain-tag">itemBinding.AddBinding ("CustomView", BindableProperties.TextProperty, "Title");</pre><p>Run the project. You should get a result similar to the following:</p>
<div style="width: 300px; " class="wp-video"><video class="wp-video-shortcode" id="video-5483-2" width="300" height="0" loop="1" autoplay="1" preload="metadata" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2015_11_27_09_11_14.mp4?_=2" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2015_11_27_09_11_14.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2015_11_27_09_11_14.mp4</a></video></div>
<p>Next, let&#8217;s create the iOS version.</p>
<h1>Designing iOS CollectionView</h1>
<p>Similar to Android, building <strong>CollectionView</strong> on iOS follows a pretty similar path:</p>
<ul>
<li>Create a ViewController for MainCollectionView.</li>
<li>Create the cell and the header.</li>
<li>Set the outlets.</li>
</ul>
<p>Let&#8217;s start from the ViewController. Add a new item using <strong>Crosslight</strong><strong> iOS Collection View Controller </strong>template<strong> </strong>and put it inside your <strong>CollectionView.iOS/ViewControllers </strong>folder and name it <strong>MainCollectionView.cs</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-26-at-5.16.58-PM.png"><img class="alignnone wp-image-5505 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-26-at-5.16.58-PM.png" alt="MainViewController" width="721" height="550" /></a></p>
<p>This is the code for the ViewController.</p><pre class="crayon-plain-tag">using CollectionView.ViewModels;
using CollectionView;
using Intersoft.Crosslight;
using Intersoft.Crosslight.iOS;
using Foundation;
using UIKit;

namespace CollectionView.iOS
{
	[Register ("MainCollectionView")]
	[ImportBinding (typeof(CollectionBindingProvider))]
	public class MainCollectionView : UICollectionViewController
	{
		#region Constructors

		public MainCollectionView ()
			: base ("MainCollectionView", null)
		{
		}

		#endregion

		#region Properties

		public override UIViewTemplate CellTemplate {
			get { return new UIViewTemplate (CollectionViewCell.Nib); }
		}

		public override CollectionViewInteraction InteractionMode {
			get { return CollectionViewInteraction.Navigation; }
		}

		public override bool ShowSectionHeader {
			get { return true; }
		}

		public override UIViewTemplate SectionHeaderTemplate {
			get { return new UIViewTemplate(CollectionHeader.Nib); }
		}

		#endregion

		#region Methods

		protected override void InitializeView ()
		{
			base.InitializeView ();

			this.NavigationItem.Title = "Home";
                        UIImageView backView = new UIImageView(UIImage.FromFile ("CrosstransBg.png")); 
                        backView.ContentMode = UIViewContentMode.ScaleAspectFill; 
                        this.CollectionView.BackgroundView = backView;
			// Register Views
			this.RegisterViewIdentifier ("GridView", this.CollectionView);
		}

		#endregion
	}
}</pre><p>Let&#8217;s take a look at some of the overridden methods and properties.</p>
<ul>
<li><strong>CellTemplate</strong>: This property is the equivalent of Android&#8217;s <strong>ItemLayoutID</strong>, which will define the view to be used as navigation item inside the Collection View.</li>
<li><strong>InteractionMode</strong>: This method is the equivalent of Android&#8217;s <strong>ListViewInteraction</strong>, that defines the interaction when users tap on the navigation item.</li>
<li><strong>SectionHeader &amp; SectionHeaderTemplate</strong>: It will be used to specify the header for the Collection View.</li>
<li><b>InitializeView</b>: This method is called when the view is initialized. Here, we set the background view of the Collection View. Afterward, <em>this.RegisterViewIdentifier (&#8220;GridView&#8221;, this.CollectionView); </em>is used to associate the Collection View with the <strong>GridView</strong> view identifier to be used by the Binding Provider.</li>
</ul>
<p>Now your view controller is done! Next, we&#8217;ll create the <em>CollectionView</em> <em>Header</em> and <em>Cells</em>. Inside your <strong>CollectionView.iOS/Views</strong>, add 2 new items: <strong>Crosslight iOS Collection Cell</strong>, we will name it <strong>CollectionViewCell.cs </strong>(feel free to choose between iPhone or iPad) and <strong> Crosslight iOS Collection View Group Header</strong> which we will name it <strong>CollectionHeader.cs.</strong></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-27-at-10.33.53-AM.png"><img class="alignnone wp-image-5506 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-27-at-10.33.53-AM.png" alt="CollectionViewCell" width="719" height="548" /></a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-27-at-10.34.49-AM.png"><img class="alignnone wp-image-5507 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-27-at-10.34.49-AM.png" alt="CollectionHeader" width="719" height="549" /></a></p>
<p>If you check back your <strong>MainCollectionView.cs</strong>, you can see that both <strong>CollectionViewCell.Nib</strong> <strong>&amp; CollectionHeader.Nib are</strong> now detected. The Nib represents both .cs files that we&#8217;ve created before. However, we won&#8217;t touch any codes, instead we will play around with the layout using iOS XCode.</p>
<p>Let&#8217;s first open the <strong>MainCollectionView.xib</strong> inside your <strong>CollectionView.iOS/Views</strong> using Apple XCode. Inside the Document Outline, you can select <em>File&#8217;s Owner</em>, then the Identity Inspector will change according to what  you selected. Specify the Custom Class as <strong>MainCollectionView</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/asdsadsa.png"><img class="alignnone size-full wp-image-5508" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/asdsadsa.png" alt="Files Owner" width="261" height="128" /></a>  <a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-27-at-10.46.08-AM.png"><img class="alignnone wp-image-5509 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-27-at-10.46.08-AM.png" alt="MainViewControllerClass" width="257" height="434" /></a></p>
<p>Using the Connections Inspector, control + drag the <em>view</em> from Outlets to the Collection View to set the outlet, as shown in the following illustration.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/MainCollectionView.png"><img class="alignnone size-large wp-image-5546" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/MainCollectionView-1024x231.png" alt="MainCollectionView" width="604" height="136" /></a></p>
<p>Then, in the File Inspector, turn off Auto Layout.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/turnoffautolayout1.png"><img class="alignnone wp-image-5513 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/turnoffautolayout1.png" alt="turnoffautolayout" width="260" height="391" /></a></p>
<p>In the Size Inspector, specify the cell&#8217;s width and height, also adjusting the auto-resizing behaviors so that it will layout nicely when the device is rotated.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/CollectionViewConfiguration.png"><img class="alignnone wp-image-5514 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/CollectionViewConfiguration.png" alt="CollectionViewConfiguration" width="260" height="665" /></a></p>
<p>Now you are done configuring your <strong>MainCollectionView.xib.</strong></p>
<p>Let&#8217;s continue to <strong>CollectionViewCell.xib</strong>, in this case, you don&#8217;t need to worry about  your <strong>File&#8217;s Owner</strong>,  Simply drag and drop a <strong>Label</strong> and <strong>ImageView</strong> from the Object Library to the view.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/viewchoice.png"><img class="alignnone wp-image-5515 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/viewchoice.png" alt="viewchoice" width="262" height="491" /></a></p>
<p>Select your Label (or anything in your designer interface), Press the conjoined circle button on the right top. A panel with codes will appear, this is the <strong>Assistant Editor</strong> which will help you create Binding without having you to code anything.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ConjoinedCircle.png"><img class="alignnone wp-image-5516 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ConjoinedCircle.png" alt="ConjoinedCircle" width="698" height="421" /></a></p>
<p>Next, let&#8217;s set the outlets using the Assistant Editor. Select your <strong>CollectionViewCell.m</strong> and change it to <strong>CollectionViewCell.h</strong>, control + drag your <strong>Label</strong> into the panel and give it <strong>TextLabel</strong> as a name, then set the <strong>ImageView</strong> outlet with the name of <strong>ImageView</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ctrldrop.png"><img class="alignnone wp-image-5517 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ctrldrop.png" alt="ctrldrop" width="881" height="417" /></a></p>
<p>You need to turn off the auto layout from both image, label, and their parent to use auto resizing. Here&#8217;s what I&#8217;ve done to each of them:</p>
<ul>
<li><strong>View</strong>: Change the background color, turn on the horizontal and vertical scaling so that it won&#8217;t grow or shrink when the display rotates.</li>
<li><strong>TextLabel</strong>: Change the alignment to the middle,  Pin it to the bottom using auto resizing and change the width to 120 and height to 50</li>
<li><strong>ImageView</strong>: Change the view mode to Aspect fit, turn on the horizontal and vertical arrow inside auto-resizing, and changes the width and height to 60</li>
</ul>
<p>In <strong>CollectionHeader.xib</strong>, what we do is just drag and drop an ImageView. Here are the settings for ImageView:</p>
<ul>
<li>Change the image with CrosstransLogo.png,</li>
<li>View Mode to Aspect Fit,</li>
<li>Width = 150,</li>
<li>Turn on the horizontal and vertical arrow inside auto resizing</li>
</ul>
<p>Here is the result:</p>
<div style="width: 300px; " class="wp-video"><video class="wp-video-shortcode" id="video-5483-3" width="300" height="0" loop="1" autoplay="1" preload="metadata" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Crosstransios.mp4?_=3" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Crosstransios.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Crosstransios.mp4</a></video></div>
<p>Your app is pretty much done, but we still ned to capture what user has selected.</p>
<h1>Capturing Selection</h1>
<p>In this section, we&#8217;ll learn how to capture selection made when the user taps on any of the navigation items.</p>
<p>If you recall earlier, we&#8217;ve defined how our <em>CollectionView</em> should navigate, which is done in our <em>BindingProvider </em>in the <strong>NavigateMemberPath </strong>inside using <strong>ItemBindingDescription</strong>.</p><pre class="crayon-plain-tag">ItemBindingDescription itemBinding = new ItemBindingDescription
            {
                DisplayMemberPath = "Title",
                ImageMemberPath = "Image",
                NavigateMemberPath = "Target"
            };</pre><p>As you are aware, each <em>MemberPath</em> represents the component of our menu. In fact, it also contains the whole data associated with the specific Item you choose from the list that you have created in your <em>ViewModel</em> back then.</p><pre class="crayon-plain-tag">public CollectionViewModel()
        {
			List items = new List();

			items.Add(new NavigationItem("Ride", typeof(SimpleViewModel)) { Image = "CrosstransRide.png" });
			items.Add(new NavigationItem("Delivery", typeof(SimpleViewModel))  { Image = "CrosstransDeliver.png" });
			items.Add(new NavigationItem("Food", typeof(SimpleViewModel))  { Image = "CrosstransFood.png" });
			items.Add(new NavigationItem("Shop", typeof(SimpleViewModel))  { Image = "CrosstransShop.png" });

			this.SourceItems = items;
        }</pre><p>BindingProvider will obtain the target of your navigation, represented by <em>typeof(SimpleViewModel))</em>. However even though we already successfully navigate,  in our case each of our Item have the same Navigation target. What if we want to know which item/menu is selected? Here is how:</p>
<p>When you navigate to a new <em>ViewModel</em>, the <strong>Navigated</strong> method is called in the target <em>ViewModel</em>, and it contains the <strong>sender</strong> value which holds the information of the caller <em>ViewModel</em>. For the simplicity of this tutorial, we&#8217;ll change the <em>SimpleViewModel</em> to handle user input. Let&#8217;s change our <strong>SimpleViewModel.cs </strong>(CollectionView.Core/ViewModels folder):</p><pre class="crayon-plain-tag">using Intersoft.Crosslight;
using Intersoft.Crosslight.Input;
using Intersoft.Crosslight.ViewModels;

namespace CollectionView.ViewModels
{
    public class SimpleViewModel : ViewModelBase
    {
        #region Fields

        private string _footerText;
        private string _greetingText;
        private string _newText;

        #endregion

        #region Properties

        public string FooterText
        {
            get { return _footerText; }
            set
            {
                if (_footerText != value)
                {
                    _footerText = value;
                    OnPropertyChanged("FooterText");
                }
            }
        }

        public string GreetingText
        {
            get { return _greetingText; }
            set
            {
                if (_greetingText != value)
                {
                    _greetingText = value;
                    OnPropertyChanged("GreetingText");
                }
            }
        }

        public string NewText
        {
            get { return _newText; }
            set
            {
                if (_newText != value)
                {
                    _newText = value;
                    OnPropertyChanged("NewText");
                }
            }
        }

        public DelegateCommand ShowToastCommand { get; set; }

        #endregion

        #region Constructors

        public SimpleViewModel()
        {
            IApplicationContext context = this.GetService().GetContext();
            if (context.Platform.OperatingSystem == OSKind.Android)
                this.GreetingText = "Hello Android from Crosslight!";
            else if (context.Platform.OperatingSystem == OSKind.WinPhone)
                this.GreetingText = "Hello WinPhone from Crosslight!";
            else if (context.Platform.OperatingSystem == OSKind.WinRT)
                this.GreetingText = "Hello WinRT from Crosslight!";
            else if (context.Platform.OperatingSystem == OSKind.iOS)
                this.GreetingText = "Hello iOS from Crosslight!";

            this.FooterText = "Powered by Crosslight®";
            this.ShowToastCommand = new DelegateCommand(ShowToast);
        }

        #endregion

        #region Methods

        public override void Navigated (NavigatedParameter parameter)
        {
            if (parameter.Sender is CollectionViewModel) 
            {
                this.ToastPresenter.Show("You are choosing: " + (parameter.Sender as CollectionViewModel).SelectedItem.Title);
            }
        }

        private void ShowToast(object parameter)
        {
            this.ToastPresenter.Show("You entered: " + this.NewText);
            this.GreetingText = this.NewText;
        }

        #endregion
    }
}</pre><p>The menu that user chooses will be represented by <strong>SelectedItem </strong>and there are two things to note here: <strong>SelectedItem</strong> actually obtained from the<strong> sender ViewModel</strong> which is from <em>CollectionViewModel.cs</em> and <strong>SelectedItem</strong> actually the default property provided from <em>CollectionViewModel</em> implementing the <strong>ListViewModelBase</strong>. In this case, we will show a toast presenter to indicate which menu the user has chosen, by obtaining the <strong>Title</strong> of <strong>SelectedItem </strong>and show it using Toast Presenter.</p>
<p>Also, If you put a breakpoint in the highlighted line above and inspect the <strong>NavigatedParameter</strong>,<strong> </strong>you can see from the shot below that it holds lots of information not only the <strong>SelectedItem </strong>but the whole CollectionViewModel.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Content.png"><img class="alignnone wp-image-5500 size-full" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Content.png" alt="Debugger Content" width="571" height="488" /></a></p>
<p>You will use this neat trick to accomplish a lot of cool things using Crosslight, so don&#8217;t forget to save this favourite this blog for later uses. Okay, now let&#8217;s run our project!</p>
<p>Wait&#8230; should we also change the Android and iOS? <strong>No need at all</strong> using Crosslight you only need to change it in Core and it will be applied to each platform, very convenient! Here is the result:</p>
<div style="width: 300px; " class="wp-video"><video class="wp-video-shortcode" id="video-5483-4" width="300" height="0" loop="1" autoplay="1" preload="metadata" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2015_11_27_14_23_41.mp4?_=4" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2015_11_27_14_23_41.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2015_11_27_14_23_41.mp4</a></video></div>
<div style="width: 300px; " class="wp-video"><video class="wp-video-shortcode" id="video-5483-5" width="300" height="0" loop="1" autoplay="1" preload="metadata" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/crosstransfull.mp4?_=5" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/crosstransfull.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/crosstransfull.mp4</a></video></div>
<h1>Wrapping Up</h1>
<p>With Crosslight, you will never have to worry about the code behind the scene. However, in  this session, I want to emphasize the customizability of Crosslight, using minimal effort and codes we already successfully create a simple and gorgeous navigation menu. I believe the next steps for you is to discover more about Crosslight features and we still have more tutorials coming in the futures! So stay tuned with us and have fun!</p>
<p>You can find the source code for this post here: <a href="http://git.intersoftsolutions.com/projects/CT/repos/crosslightcollectionview/browse">http://git.intersoftsolutions.com/projects/CT/repos/crosslightcollectionview/browse</a></p>
<p>See you in the next post,<br />
Arief Handany</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/11/getting-started-with-crosslight-collection-views-and-grid-views-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2015_11_27_09_11_14.mp4" length="4544727" type="video/mp4" />
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Crosstransios.mp4" length="1532667" type="video/mp4" />
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2015_11_27_14_23_41.mp4" length="13983430" type="video/mp4" />
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/crosstransfull.mp4" length="3605056" type="video/mp4" />
		</item>
	</channel>
</rss>
