<?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; iOS</title>
	<atom:link href="http://blog.intersoftsolutions.com/tag/ios/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>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>Crosslight 5 RC Is Now Available</title>
		<link>http://blog.intersoftsolutions.com/2016/02/crosslight-5-rc-is-now-available/</link>
		<comments>http://blog.intersoftsolutions.com/2016/02/crosslight-5-rc-is-now-available/#comments</comments>
		<pubDate>Fri, 12 Feb 2016 18:33:42 +0000</pubDate>
		<dc:creator><![CDATA[Jimmy Petrus]]></dc:creator>
				<category><![CDATA[2016 R1]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Material]]></category>
		<category><![CDATA[Crosslight 5]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=5615</guid>
		<description><![CDATA[Good news to y’all. Today, we’re releasing Crosslight 5 Release Candidate to public ahead of the RTM release scheduled later this month. As mentioned in my previous blog, you can now test drive Crosslight 5 along with over 40 revamped Crosslight samples. Crosslight 5 RC [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-inventory-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="sample inventory" style="float:right; margin:0 0 10px 10px;" /><p>Good news to y’all. Today, we’re releasing Crosslight 5 Release Candidate to public ahead of the RTM release scheduled later this month. As mentioned in my <a href="http://blog.intersoftsolutions.com/2016/01/a-closer-look-at-premier-studio-2016/">previous blog</a>, you can now test drive Crosslight 5 along with over 40 revamped Crosslight samples.</p>
<p>Crosslight 5 RC is currently published to NuGet with version 5.0.5000.535. Note that Crosslight 5 availability in NuGet provides only runtime libraries — sufficient to test drive the accompanying new samples and all shiny features introduced in Crosslight 5. The development experience such as IDE integration and project wizard are not available yet in this RC release. They will be available from installers in official RTM release later this month.</p>
<p>Now, let&#8217;s check out some cool new stuff.</p>
<h1>Introducing Crosslight’s New Samples Repository</h1>
<p>Crosslight 5 release isn’t just about great new tools and amazing features. Our team is hard at work to create dozens of new samples that have been optimized for cross-platform best practices and support for latest mobile platforms. That includes the new Material project for Android, and Universal Storyboard for iOS. To provide a clear migration path and to avoid confusion with previous techniques, we decided to start a new Git project to host the new samples which you can access here: <a href="http://git.intersoftsolutions.com/projects/cs" target="_blank">http://git.intersoftsolutions.com/projects/cs</a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/Crosslight-new-samples-repo.png"><img class="alignnone size-large wp-image-5659" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/Crosslight-new-samples-repo-1024x696.png" alt="Crosslight new samples repo" width="604" height="411" /></a></p>
<p>Unlike the previous Crosslight samples, each Crosslight sample is now hosted in its own repository. This means you no longer need to download a huge 600MB file only to get a specific sample you’re interested in. As seen above, we’ve also categorized the samples so you can quickly decide which samples to pick up based on your needs.</p>
<p>For instance, If you’re just starting out, check out the “basic”-labeled samples, i.e., basic-mvvm, basic-data, and so on. If you’d like to check out a full app reference, jump ahead to the “app”-labeled samples. The rest should be self-explanatory, “data” for data-related, “ui” and “services” for UI components and services respectively.</p>
<p>Here’s a quick recap of major changes in the new Crosslight samples:</p>
<ul>
<li>Added Android.Material project — building on the new Crosslight.Android.v7 library.</li>
<li>Dropped classic Android project.</li>
<li>iOS project is now redesigned with universal storyboard instead of XIB.</li>
<li>Core project has been much improved to comply with best practices and API introduced in Crosslight 5. For instance, setting Title can be simply done in ViewModel. The associated view in iOS and Android will automatically take that. This means less code to concern in the view.</li>
<li>Core project now uses Profile78 as our new PCL standards. This will allow you to consume most BCL packages from Microsoft.</li>
<li>Crosslight samples that use WebAPI can now run directly — no Windows required. By default, all WebAPI samples are now pointing to Intersoft’s public WebAPI endpoint. If you wish to change it to your local WebAPI, that’s just one property value to set.</li>
</ul>
<p><strong>How about the existing Crosslight Samples repo?</strong> It’s retired and will no longer receive new commits. However, we decided to leave it as is to provide sample references for classic Android.</p>
<h1>Download. Run. It Just Works.</h1>
<p>Get started with Crosslight is now easier than ever. No more tedious or additional configuration required to run the sample. In this release, we’ve worked hard to bring a better development experience for Crosslight. Whether you’re an advanced Crosslight developer or a newbie just starting to look into cross-platform mobile development, you&#8217;ll find Crosslight easy and fun to work with.</p>
<p>Here’s a 2-minute video demo to show the new sample experience.</p>
<div class="wp-video" style="width: 700px;"><video id="video-5557-1" class="wp-video-shortcode" style="width: 100%; height: 100%;" src="https://onedrive.live.com/download?cid=2C4B065D8C2846A7&#038;resid=2C4B065D8C2846A7%2110220&#038;authkey=AFk3tnP_FevU3nY" preload="metadata" controls="controls" width="700" height="150"><source type="video/mp4" src="https://onedrive.live.com/download?cid=2C4B065D8C2846A7&#038;resid=2C4B065D8C2846A7%2110220&#038;authkey=AFk3tnP_FevU3nY" /><a href="https://onedrive.live.com/download?cid=2C4B065D8C2846A7&#038;resid=2C4B065D8C2846A7%2110220&#038;authkey=AFk3tnP_FevU3nY"> https://https://onedrive.live.com/download?cid=2C4B065D8C2846A7&#038;resid=2C4B065D8C2846A7%2110220&#038;authkey=AFk3tnP_FevU3nY </a></video></div>
<h1>Top 10 Samples to Check Out</h1>
<p>To help you make the most out of Crosslight 5 release, I’m pleased to share the top 10 samples I fav’ed the most, ordered from the least to the most. I hope you’ll like them too!</p>
<p>For testing the Android Material samples below, I highly recommend to use Xamarin Android Player with API 22 (Lollipop) which is generally faster and more stable than Google&#8217;s emulators.</p>
<h3>Property Cross</h3>
<p>Url: <a href="http://git.intersoftsolutions.com/projects/CS/repos/app-propertycross/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/app-propertycross/browse</a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-propertycross.png"><img class="alignnone size-large wp-image-5646" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-propertycross-1024x738.png" alt="PropertyCross" width="604" height="435" /></a></p>
<p>Our implementation of the open-source <a href="https://github.com/tastejs/PropertyCross" target="_blank">PropertyCross</a> has been well recognized as the best cross-platform implementation with 100% UI logic sharing. PropertyCross v2 now includes the new Android Material project, featuring stunning shared element transition, list view with card style, and new bar items.</p>
<p>Interesting points to check out:</p>
<ul>
<li><strong>PropertyDetailFragment</strong>: See how easy it is to implement a Favorite floating action button with toggle behavior. A single line of code is what it takes.</li>
<li><strong>PropertyListFragment</strong>: Notice that the list view binds to the thumbnail URL which is used for shared element transition. When it navigates to detail, the large image will be asynchronously loaded — smoothly fading into the parallax image. This beautiful UX commonly needs hundreds line-of-code to get it done right, but Crosslight saves you with only one line-of-code.</li>
</ul>
<h3>Form Builder</h3>
<p>Url: <a href="http://http//git.intersoftsolutions.com/projects/CS/repos/basic-form-builder/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/basic-form-builder/browse</a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-formbuilder.png"><img class="alignnone size-large wp-image-5651" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-formbuilder-1024x744.png" alt="sample formbuilder" width="604" height="439" /></a></p>
<p>The new Crosslight Android Material library isn’t just an incremental improvement to existing Android library. It’s a revolutionary milestone. We re-created every single editor for Form Builder to match the latest Material UX and design pattern. This includes the spacing between elements, margin to parent, typography, font size, and colors.</p>
<p>Check out each editor sample to see how Form Builder looks like in Material design pattern.</p>
<h3>Dialog Presenter</h3>
<p>Url: <a href="http://git.intersoftsolutions.com/projects/CS/repos/services-dialog-presenter/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/services-dialog-presenter/browse</a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-dialogpresenter.png"><img class="alignnone size-large wp-image-5650" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-dialogpresenter-1024x738.png" alt="sample dialogpresenter" width="604" height="435" /></a></p>
<p>Along with the introduction of Crosslight Android Material library, we also introduced a redesigned Dialog Presenter component for Android Material.</p>
<p>Interesting points to check out:</p>
<ul>
<li><strong>AddCartFragment</strong>: The dialog fragment works in harmony with the hosted Form Builder controls according to the defined theme.</li>
<li><strong>CallFragment</strong>: The full screen presentation style with accelerated slide down animation works beautifully with Material theme.</li>
</ul>
<h3>Expenses</h3>
<p>Url: <a href="http://http//git.intersoftsolutions.com/projects/CS/repos/app-simple-expense/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/app-simple-expense/browse</a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-expense1.png"><img class="alignnone size-large wp-image-5657" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-expense1-1024x738.png" alt="sample expense" width="604" height="435" /></a></p>
<p>The lightweight yet useful expenses sample have got a major facelift. Redesigned with Material experience, you’ll be greeted with the new navigation drawer. Try to add a category and some expenses to get a feeling of it.</p>
<p>Interesting points to check out:</p>
<ul>
<li><strong>ExpenseListFragment</strong>: See how straightforward it is to define floating action buttons, enable multiple selection, and enable contextual toolbar.</li>
<li><strong>ExpenseEditFragment</strong>: Need two or more floating action buttons in your fragment? No problems — just use the same <em>FloatingActionButtons.Add</em> API. Pay attention to <em>CommandItemType</em>, <em>Position</em> and <em>Direction</em> which lets you logically define where you want the button to be positioned, what icon it should display, and in case of multiple buttons, where should it put the siblings.</li>
</ul>
<h3>Calendar</h3>
<p>Url: <a href="http://git.intersoftsolutions.com/projects/CS/repos/ui-calendar/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/ui-calendar/browse</a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-calendar.png"><img class="alignnone size-large wp-image-5648" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-calendar-1024x709.png" alt="sample calendar" width="604" height="418" /></a></p>
<p>The calendar samples have been updated to reflect the improved Calendar control shipped in Crosslight 5. The Calendar control in iOS now joined the latest control framework which offers the following advantages:</p>
<ul>
<li>Support Universal Storyboard</li>
<li>Support Xamarin Studio iOS Designer</li>
<li>Support rotation, both iPhone and iPad</li>
</ul>
<p>Interesting points to check out:</p>
<ul>
<li><strong>iOS &#8211; CalendarViewController</strong>: Notice there are no more code that creates UICalendar. That’s because everything is now defined in MainStoryboard. If you open the MainStoryboard in Xamarin Studio, you can see the new Calendar is rendering beautifully in the designer surface.</li>
<li><strong>Android</strong>: Optimized for Crosslight Android Material library.</li>
</ul>
<h3>Signature Pad</h3>
<p>Url: <a href="http://http//git.intersoftsolutions.com/projects/CS/repos/ui-signature-pad/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/ui-signature-pad/browse</a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-signaturepad.png"><img class="alignnone size-large wp-image-5647" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-signaturepad-1024x775.png" alt="sample signaturepad" width="604" height="457" /></a></p>
<p>This is a new sample that demonstrates the SignaturePad control introduced in Crosslight 5. The SignaturePad control comes with two flavors. The first is the platform-specific control as usual. The other is the brand-new SignaturePad Widget for Form Builder. SignaturePad is our first UI control that ships with a widget extension for Form Builder.</p>
<p>Moving forward, all our UI controls will have the Form Builder Widget counterpart, so you can use them in your form metadata in just a single line of code.</p>
<p>Interesting points to check out:</p>
<ul>
<li><strong>Models\FormMetadata</strong>: See the new metadata format for the SignaturePad widget extension.</li>
<li><strong>BindingProviders\SignaturePadVi</strong><strong>ewResultBindingProvide r</strong>: The SignaturePad supports binding to ImageSource property. With the byte array stored to your model after a signing input is detected, you can easily display the byte array to an ImageView by simply binding to the ImageSource property.</li>
</ul>
<h3>Gauge</h3>
<p>Url: <a href="http://git.intersoftsolutions.com/projects/CS/repos/ui-gauge/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/ui-gauge/browse</a></p>
<p><img class="alignnone size-large wp-image-5652" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-gauge-1024x604.png" alt="sample gauge" width="604" height="356" /></p>
<p>This is a new sample demonstrating the Gauge data visualization control introduced in Crosslight 5. Unlike traditional gauges, Crosslight Gauge is designed with sleek modern styles right from the start, so you can create some stunning dashboards in matter of minutes.</p>
<p>Crosslight Gauge offers industry-standard gauge and a circular gauge similar to those used in Apple’s Health and Watch apps. There are 25 individual examples that show each feature in detail, and every customizable aspects. I highly recommend you to check them all to get insights what you can do with it.</p>
<h3>Master Detail</h3>
<p>Url: <a href="http://http//git.intersoftsolutions.com/projects/CS/repos/app-inventory-masterdetail/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/app-inventory-masterdetail/browse</a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-masterdetail.png"><img class="alignnone size-large wp-image-5654" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-masterdetail-1024x620.png" alt="sample masterdetail" width="604" height="366" /></a></p>
<p>Master Detail pattern is arguably one of the most essential navigation patterns in today’s ubiquitous modern apps, particularly if your app needs to support both phone and tablet. Modeled upon the industry standard apps such as Facebook, the new <strong>MasterDetailFragment</strong> contains a master view and a detail view — both shared a single toolbar. In most cases, the bar items that are contextual to the master items will be presented, such as Add, Edit, Delete, etc. However, with the introduction of floating action buttons, that could provide better solution as you can add them to each view individually — which is demonstrated in this sample.</p>
<p>This specialized <strong>MasterDetailFragment</strong> features a number of different navigation scenarios designed for business/enterprise apps. It’s also worth to mention that this fragment plays well with navigation drawer and optimized for Material experience.</p>
<p>Interesting points to check out:</p>
<ul>
<li><strong>InventoryFragment</strong>: Shows a list of inventory in the master view and the item details in the detail view.</li>
<li><strong>CategoryContainerFragment</strong>: Shows a nested navigation scenarion in master view and item details in the detail view.</li>
<li><strong>SettingsFragment</strong>: Demonstrates the flexibility to navigate to any content in detail view.</li>
</ul>
<h3>Inventory</h3>
<p>Url: <a href="http://git.intersoftsolutions.com/projects/CS/repos/basic-inventory/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/basic-inventory/browse</a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-inventory.png"><img class="alignnone size-large wp-image-5653" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-inventory-1024x657.png" alt="sample inventory" width="604" height="388" /></a></p>
<p>As Crosslight’s flagship reference sample, the Inventory has been significantly revamped and shaped to comply with the latest and greatest APIs available in Crosslight 5. The new Inventory for Android Material provides best practices how a typical Android app should be built, including data listing with <strong>RecycleView</strong>, adding bar items, enabling shared transition, defining floating actions and contextual toolbar.</p>
<p>One more thing, you can now have swipe-for-action gesture in the RecycleView, a nice UX feature that has been exclusive to iOS developers. We designed swipe actions to support commands, so you can have a single UI logic in ViewModel that responding to the swipe gesture in both iOS and Android. Pretty cool, right?</p>
<p>While you’re at the <strong>Inventory.Android.Material</strong> project, try to run the sample again in an Android tablet simulator, you’ll be welcomed with a <strong>GridView</strong> with neatly arranged layout. This is another important feature parity with iOS (CollectionView) which wasn’t available previously. Notice that the long press (contextual toolbar) and multiple selection works equally great as in iOS.</p>
<p>More interestingly, the Inventory sample also introduces a master-detail pattern that is designed after iOS SplitView. Introducing the new <strong>SplitFragment</strong> for Android Material, it’s now possible to create a beautiful master-detail experience in Android platform. With SplitFragment, the master and detail view can have its own title and bar items individually which are controlled by the contained fragment, makes it on-par with iOS SplitView concept and capability. For us, SplitFragment is one of the most important Android building blocks in this release as it brings many functionalities not possible before, and more importantly, brings developers one step closer to the iOS parity. Run the <strong>Inventory.MasterDetail.Android.Material</strong> sample in an Android tablet simulator to see it in action.</p>
<p>And the best part is, all the view variations you seen above are actually done with the same UI logic and codebase. That&#8217;s what makes Crosslight truly standout from the crowd.</p>
<p>That&#8217;s not all. On <strong>iOS</strong> platform, we&#8217;ve done many improvements and re-engineering to table view, particularly related to performance and animation. For instance, try to swipe and delete (or Mark as Sold), or edit and delete multiple items, notice that row animations are now super-smooth. We&#8217;ve streamlined this experience on all editing scenarios, whether it&#8217;s on single or grouped list, or on master-detail.</p>
<p>Interesting points to check out:</p>
<ul>
<li><strong>ItemListFragment</strong>: Learn how easy it is to enable searchable list by simply deriving from the new <em>SearchableRecyclerViewFragment</em>. Also see the API simplicity to enable swipe actions, shared element transition, and floating action buttons.</li>
<li><strong>ItemGridFragment</strong>: The new <em>GridViewFragment</em> makes it easy to present items list in collection view. Inspired by iOS, you can simply define the orientation, number of rows or columns.</li>
<li><strong>MasterDetailFragment</strong>: The new <em>SplitFragment</em> lets you implement a beautiful master-detail experience with just a few line of code. The control does all the heavy lifting, from navigation logic, rotation handling, fragment instantiation and everything.</li>
<li><strong>ItemListViewModel</strong>: Notice the use of new <em>ActionToastPresenter</em>, supported in both iOS and Android Material, allows you to easily present &#8220;snack bar&#8221; style interface. At runtime, try to enter edit mode (Edit in iOS, long-press in Android), select one or more items, then perform <em>Mark Sold</em>. In this sample, you&#8217;ll see an &#8220;Undo&#8221; action in the toast, perfect for users to easily perform certain actions contextual to the last action.</li>
</ul>
<h3>Material</h3>
<p>Url: <a href="http://http//git.intersoftsolutions.com/projects/CS/repos/ui-material/browse" target="_blank">http://git.intersoftsolutions.com/projects/CS/repos/ui-material/browse</a></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-material.png"><img class="alignnone size-large wp-image-5645" src="http://blog.intersoftsolutions.com/wp-content/uploads/2016/02/sample-material-1024x737.png" alt="sample material" width="604" height="435" /></a></p>
<p>Last but not least, here’s the #1 sample you won’t want to miss out. The Material sample unleashes all powerful features introduced in the new Crosslight Android Material library. You can find a wide variety of Material UX features hosted in some 30+ individual samples.</p>
<p>From collapsing toolbar to parallax and shared element and snack bar, you’ll find everything you need to build great Material experience here. I highly recommend you to spend some time playing with every sample and try interacting with the UI elements.</p>
<h1>Wrapping Up</h1>
<p>So, which samples you liked the most? We’d love to hear from you. If you prefer to browse all samples, jump ahead to <a href="http://http//git.intersoftsolutions.com/projects/cs." target="_blank">http://git.intersoftsolutions.com/projects/cs.</a></p>
<p>While trying out the samples, please be noted that the documentation links found in the sample’s readme will not work as they’re still in progress. Rest assured that the new documentation will be very comprehensive in this release — and will be completely available upon the official release later this month.</p>
<p>Enjoy, and happy sampling!</p>
<p><strong>Disclaimer</strong>: Do not apply Crosslight 5 RC in your production apps yet as it will require you to update the Crosslight license key which haven’t been released.</p>
<p>Best,<br />
Jimmy</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2016/02/crosslight-5-rc-is-now-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</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"><!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->
<video class="wp-video-shortcode" id="video-5483-1" 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?_=1" /><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-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/Crosstransios.mp4?_=2" /><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-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/2015_11_27_14_23_41.mp4?_=3" /><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-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/crosstransfull.mp4?_=4" /><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>
		<item>
		<title>Redesigning Xamarin Field Service Sample with Crosslight &#8211; Part 1</title>
		<link>http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/</link>
		<comments>http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/#comments</comments>
		<pubDate>Fri, 20 Nov 2015 07:00:00 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Reference Samples]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Design Pattern]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[UI Design]]></category>
		<category><![CDATA[UX Design]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Xamarin]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=4878</guid>
		<description><![CDATA[Hi guys, Nicholas here. I’m back with another blog post, this time covering the Xamarin Field Service sample. Many of you have asked: “How can I transform the Xamarin Field Service sample using Crosslight?” And that tickled something in the back of our minds. This [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabList-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="TabList" style="float:right; margin:0 0 10px 10px;" /><p>Hi guys, Nicholas here. I’m back with another blog post, this time covering the <a href="https://xamarin.com/prebuilt/field-service" target="_blank">Xamarin Field Service</a> sample. Many of you have asked: “How can I transform the Xamarin Field Service sample using Crosslight?” And that tickled something in the back of our minds. This could be our next Crosslight reference sample! So we embarked on a quest to transform the Xamarin Field Service completely using Crosslight and see how much we can do about it.</p>
<h1>Tablet-only Design?</h1>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/1446536283_full1.png"><img class=" size-large wp-image-4941 aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/1446536283_full1-1024x378.png" alt="1446536283_full" width="604" height="223" /></a></p>
<p style="text-align: center;"><em>Xamarin Field Service on Android, iPad and Windows 8.1</em></p>
<p>Before delving further, we need to take a step back and have a good look on overall UI and UX design of this app. When talking about cross-platform, yes, it would be valid to say that this app works cross-platform. But it only works on tablets. Why can’t the design be brought to the phone as well?</p>
<p>Let me share with you some of the design quirks found in the app, and how we decided to transform the experience in overall. We’re not talking about any code stuff first in this post. Just pure, plain UX, then we’ll move on to code sharing aspects in the next post.</p>
<h2>The Assignments Screen</h2>
<p>The assignments screen. At a first glance, nothing seems to be wrong with it. So, we decided to add additional swipe gesture touches to it, to change statuses quickly. Overall, I’m totally fine with it.</p>
<h2>The Assignment Detail</h2>
<p>Until it pushes the entire screen to display the assignment detail. Let&#8217;s take a look at Xamarin&#8217;s Field Service push navigation.</p>
<div style="text-align: center;">
<div style="width: 604px; " class="wp-video"><video class="wp-video-shortcode" id="video-4878-5" width="604" height="311" loop="1" autoplay="1" preload="metadata" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iPad-Transition.mp4?_=5" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iPad-Transition.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iPad-Transition.mp4</a></video></div>
<p><em>Xamarin Field Service &#8211; iPad Push Navigation</em></p>
</div>
<p>The transition between the assignments list and the assignment detail screen. It’s quite rare to see an iPad app performs a push navigation in such manner, especially in a list navigation. Most mobile apps will present itself with a SplitView on iPad, in which the push navigation will be contained within itself, not navigating the entire view. This is apparent in several iPad’s default apps, such as Mail, Contacts, Messages and Notes. I’m not saying this design is incorrect. But what if there is a way to enhance the navigation experience, much like the Apple’s native experience?</p>
<p><strong>Problem</strong>: User experiences abrupt changes when navigating to detail view, hindering the user experience.<strong><br />
Objective</strong>: Show the detail view without abrupt, major changes in screen presentation.<br />
<strong>Considerations</strong>: Obviously, we can’t add a SplitView to do that.<br />
<strong>Our solution:</strong> Crosslight Dialog Presenter.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ipad-dialog-presenter.png"><img class="alignnone size-large wp-image-5029" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ipad-dialog-presenter-1024x891.png" alt="ipad-dialog-presenter" width="604" height="526" /></a></p>
<p style="text-align: center;"><em>Crosslight Field Service &#8211; iPad Dialog Presenter</em></p>
<p>The Dialog Presenter is be a perfect candidate to replace the push navigation. By displaying a beautiful translucent modal panel from the right-hand side to the center that covers third-quarter of the screen, we managed to simulate the “content navigation” found in split view apps, enhancing the overall detail navigation experience. To close the dialog presenter, users can simply tap on the left hand side of the screen, outside the dialog presenter.</p>
<blockquote><p>Have you managed to get started with the Dialog Presenter? If not, I’ve covered how to <a href="http://blog.intersoftsolutions.com/2015/11/getting-started-with-crosslight-dialog-presenter/" target="_blank">get started with the Dialog Presenter</a> in another post.</p></blockquote>
<p>Reusing the same view, the dialog presenter&#8217;s content can be easily adapted to iPhone&#8217;s more compact screen and uses simple push navigation, as follows.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iphone-summary1.png"><img class=" wp-image-5020 aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iphone-summary1-630x1024.png" alt="iphone-summary" width="300" height="488" /></a></p>
<p style="text-align: center;"><em>Crosslight Field Service &#8211; iPhone Push Navigation</em></p>
<p style="text-align: left;">Crosslight is all about reusability, efficiency and design pattern consistency. You can easily design views that work perfectly in either phone or tablets, thanks to its robust, thoughtfully engineered navigation service.</p>
<h2>Displaying the Navigation Items</h2>
<p>Okay, we’ve managed to solve the list navigation experience. But how about containing all those navigation items in the detail view of our dialog presenter? Currently, we have 7 items: <strong>Summary</strong>, <strong>Map</strong>, <strong>Items</strong>, <strong>Labor Hours</strong>, <strong>Expenses</strong>, <strong>Documents</strong>, <strong>Confirmations</strong>. I’m not including History since it’s not supported by Xamarin just yet.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2navigation1.png"><img class="alignnone wp-image-4991" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2navigation1.png" alt="2navigation" width="700" height="500" /></a></p>
<p style="text-align: center;"><em>Xamarin Field Service &#8211; iPad Navigation List</em></p>
<p><strong>Problem</strong>: The navigation items takes up too much space and exceeds the 5-items-limit for the tabs.<strong><br />
Objective</strong>: Display the navigation items inside the dialog presenter, while still maintaining a native and pleasant iPad UX.<br />
<strong>Considerations</strong>: Can we simplify the navigation items even futher?<br />
<strong>Our solution</strong>: Tabbed navigation.</p>
<p>Up to this point, you might have several objections in mind, such as: “What if Xamarin decided to bring that History menu back up and even adding more modules to the app? Your tabbed solution will not be able to solve that issue, no?” Yes. We admit it won’t be able fit more items inside it, as Apple has provided a maximum threshold of 5 items of the tab controllers.</p>
<p>However, we can improve the navigation item categorization to include lesser items and display them as needed. Remember, as a UI/UX designer, you have to keeps things simple for your users. And contextual. Imagine you’re designing the app for your mom, therefore, you have to keep it as simple as possible.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2navigation2.png"><img class="alignnone wp-image-4992" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/2navigation2.png" alt="2navigation2" width="700" height="774" /></a></p>
<p style="text-align: center;"><em>Crosslight Field Service &#8211; iPad Tabs</em></p>
<p>Our answer was to reduce the number of navigation items into maximum of 5 items: <strong>Summary</strong>, <strong>Items</strong>, <strong>Labor Hours</strong>, <strong>Expenses</strong>, and <strong>Confirmations</strong>. The <strong>Map</strong> and <strong>Documents</strong> can easily fit into the <strong>Summary</strong> tab. It all makes sense, considering that the <strong>Map</strong> and <strong>Documents</strong> do not contain any data entry capabilities and does not require any user interactions whatsoever. In other words, they’re designed to be <em>read-only</em>, which would fit the <strong>Summary</strong> tab. Why use 7 tabs if you can manage with just 5? And here&#8217;s how it looks on the iPhone.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iphonesummary-2.png"><img class=" wp-image-5024 aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iphonesummary-2-722x1024.png" alt="iphonesummary-2" width="300" height="425" /></a></p>
<p style="text-align: center;"><em>Crosslight Field Service &#8211; iPhone Tabs</em></p>
<p>As for the <strong>History</strong> problem, since users can&#8217;t perform any data interaction with it, you can simply add a <strong>History</strong> icon button within the <strong>Summary</strong> tab that displays the previous records related with the assignment, or if you would like to separate each the list of <strong>Documents</strong> and list of <strong>History </strong>records, you can introduce a segmented button, like the one found in Apple&#8217;s App Store Purchased screen, especially the &#8220;<strong>All</strong>&#8221; and &#8220;<strong>Not on This iPad</strong>&#8220;.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ipad-app-store-purchased.png"><img class="alignnone size-large wp-image-5023" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ipad-app-store-purchased-1024x776.png" alt="ipad-app-store-purchased" width="604" height="458" /></a></p>
<p style="text-align: center;"><em>App Store &#8211; iPad &#8211; Purchased</em></p>
<h2>The Summary Screen</h2>
<p>When I think of <strong>Summary</strong>, I always assume that the user expects the view to contain <em>read-only</em><b> </b>information. For that same reason, the <strong>Summary</strong> screen is perfect to display static list of items, in which the user can perform only one action upon it.</p>
<p><img class=" wp-image-5039 aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/xamarin-map-1024x617.png" alt="xamarin-map" width="700" height="422" /></p>
<p style="text-align: center;"><em>Xamarin Field Service &#8211; iPad &#8211; Summary</em></p>
<p><strong>Problem</strong>: The number of items to be included tab navigation can only contain max. 5 items.<strong><br />
Objective</strong>: Reduce the number of navigation items and display relevant information in a simpler manner.<br />
<strong>Considerations</strong>: Decide which navigation menus that don&#8217;t need user interaction.<br />
<strong>Our solution</strong>: Put <strong>Maps</strong> and <strong>Documents</strong> inside the Summary screen.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ipad-summary-map.png"><img class=" size-large wp-image-5040 aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ipad-summary-map-1024x602.png" alt="ipad-summary-map" width="604" height="355" /></a></p>
<p>&nbsp;</p>
<p style="text-align: center;"><em>Crosslight Field Service &#8211; Maps and Documents in Summary</em></p>
<p>Therefore, we decide to inject <strong>Map</strong> and <strong>Documents</strong> inside the <strong>Summary</strong> screen. Including the <strong>Map</strong> was pretty simple. We display then <strong>Map</strong> on the top header, along with other relevant information about the customer. If users were to click on the map view, then Apple Maps will be fired up with a placemark showing more details about the location in the form of map annotations. As for the <strong>Documents</strong>, it is achievable simply by adding the documents list at the very bottom of the <strong>Summary</strong> page.</p>
<h2>The Items Screen</h2>
<p>How many times have you encountered an iPad app with adding and editing experience that is not located in the navigation bar? I’m sure, not much. For me, it’s my first time.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/items-old.png"><img class=" wp-image-5031 aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/items-old.png" alt="items-old" width="700" height="490" /></a></p>
<p style="text-align: center;"><em>Xamarin Field Service &#8211; Items</em></p>
<p>And because of that, I’m pretty sure this is not Apple’s standard design.</p>
<p><strong>Problem</strong>: The user actions are not part of the navigation bar and it&#8217;s confusing.<br />
<strong>Objective</strong>: Provide a method for the user to display the relevant information as needed.<br />
<strong>Considerations</strong>: What does the user usually expect when perform user actions?<br />
<strong>Our solution</strong>: By removing the sticky header altogether, we&#8217;ve managed to place the user actions where it truly belongs.</p>
<p style="text-align: center;"><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Item-Search.png"><img class="alignnone size-large wp-image-5185" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Item-Search-1024x768.png" alt="Item-Search" width="604" height="453" /></a></p>
<p style="text-align: center;"><em>Crosslight Field Service &#8211; Items</em></p>
<p>The addition and editing of items generally occurs from the navigation bar, in which we have done so with the dialog presenter approach. Since the Items screen is similar to the <strong>Labor Hours</strong> and <strong>Expenses</strong> screen, we’re taking the same approach to both of the screens.</p>
<h2>The Sticky Header</h2>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/xamarin-sticky-header.png"><img class=" wp-image-5034 aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/xamarin-sticky-header-1024x878.png" alt="xamarin-sticky-header" width="700" height="600" /></a></p>
<p style="text-align: center;"><em>Xamarin Field Service &#8211; Sticky Header</em></p>
<p><strong>Problem</strong>: With the sticky header gone, what is the best place to put it?<br />
<strong>Objective</strong>: Find an alternative to place the sticky header with global accessibility.<br />
<strong>Considerations</strong>: The information should be globally accessible, anytime, anywhere.<br />
<strong>Our solution</strong>: Provide a header callout that displays the removed information.</p>
<p>In my personal opinion, it’s the &#8220;sticky header” in the content detail view is what breaks the overall iPad experience. This is why we have removed this view and opted to stick it in only the <strong>Summary</strong> view, the correct place where it belongs. Users also do not have to see this information the whole time.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ipad-callout.png"><img class="alignnone size-large wp-image-5035" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ipad-callout-1024x913.png" alt="ipad-callout" width="604" height="539" /></a></p>
<p style="text-align: center;"><em>Crosslight Field Service &#8211; iPad</em></p>
<p>However, if the user wants to see that quick information, he can just tap on the top header anytime and a callout will present the temporary information he needed.</p>
<h2>The &#8220;Active Work&#8221; Indicator/Player</h2>
<p>Before we proceed, we might have forgotten one other thing. The “active work” indicator/player. If you notice, when the assignment is marked as Active, the player pops out from the bottom of the screen to let the user know that the current assignment is active and he can pause at any time. This will count automatically as a new entry in the <strong>Labor Hours</strong> screen.</p>
<p><strong>Problem</strong>: Display globally-available information that shows the current work is active that adheres to Apple&#8217;s standard user experience.<strong><br />
Objective</strong>: Display the “active work” indicator/player in the dialog presenter content detail.<br />
<strong>Considerations</strong>: It has to be global (user should be able to see it all the time). The dialog presenter content is already cramped up. Where would be the correct place to put the view?</p>
<p>Before I present you with our approach to the above problem, I want you to think how to solve this problem. Think of all the possible places and approaches to tackle this problem. And yes, Apple did have this exact same problem in one of their apps. Can you guess what the app is?</p>
<p>Did you come up with any solution to the above problem? If not, let me tell you what <strong>our solution</strong> is: <strong>Apple’s Music Player View</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/applemusic.png"><img class="alignnone wp-image-4998" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/applemusic-1024x652.png" alt="applemusic" width="700" height="446" /></a></p>
<p style="text-align: center;"><em>Apply Music &#8211; Player</em></p>
<p>Think about it. The Music app introduced in iOS 8.4 has this exact same problem. When the music is playing, how can Apple show the user on what music is playing, globally, and whether the user can perform any actions upon it?</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ipad-player.png"><img class=" wp-image-5036 aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/ipad-player-1024x884.png" alt="ipad-player" width="700" height="605" /></a></p>
<p style="text-align: center;"><em>Crosslight Field Service &#8211; Active Work View</em></p>
<p>Yes, we dealt with the problem the same way. Both of the solutions are consistent in iPhone and iPad.</p>
<h2>The Confirmation Screen</h2>
<p>The last, but not the least view in the app: the confirmation screen. This screen also presents quite a challenge to be redesigned and optimized.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/9confirm-before.png"><img class=" size-full wp-image-4983 aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/9confirm-before.png" alt="9confirm-before" width="938" height="714" /></a></p>
<p style="text-align: center;"><em>Xamarin Field Service &#8211; Confirmation</em></p>
<p>Take a look at the design above. And imagine running it on a phone.<br />
The design is quite tricky to address, since it has one list and a signature pad.</p>
<p><strong>Problem</strong>: The screen&#8217;s design cannot be adapted to phones.<strong><br />
Objective</strong>: Revamp the screen in such a way that will accommodate users running on tablets and phones.<br />
<strong>Considerations</strong>: The vertical-scrolling list might be a problem.<br />
<strong>Our solution</strong>: Change the vertical-scrolling list into a horizontal-scrolling list and add the signature pad directly beneath it.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/8confirmation1.png"><img class=" wp-image-4996 aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/8confirmation1-1024x660.png" alt="8confirmation" width="700" height="451" /></a></p>
<p style="text-align: center;"><em>Crosslight Field Service &#8211; Confirmation Screen</em></p>
<p>Therefore, we’ve elegantly redefined how things work in the <strong>Confirmation</strong> screen by making the <em>Photos</em> section acts as a carousel view with <em>Signature Pad</em> placed directly underneath it. This way, it can work on smaller screens like phones.</p>
<h1>How about Android?</h1>
<p>Android fans, do not fret. Let&#8217;s take a look at the Android designs of the Field Service app.</p>
<p>Here&#8217;s a gallery of how it looks on the phone.</p>

<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/androidphone-expenses-popup/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Expenses-Popup-150x150.png" class="attachment-thumbnail" alt="AndroidPhone-Expenses-Popup" data-attachment-id="5041" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Expenses-Popup.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="AndroidPhone-Expenses-Popup" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Expenses-Popup-169x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Expenses-Popup-576x1024.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/androidphone-expenses/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Expenses-150x150.png" class="attachment-thumbnail" alt="AndroidPhone-Expenses" data-attachment-id="5042" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Expenses.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="AndroidPhone-Expenses" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Expenses-169x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Expenses-576x1024.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/androidphone-items-popup/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-items-popup-150x150.png" class="attachment-thumbnail" alt="AndroidPhone-items-popup" data-attachment-id="5043" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-items-popup.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="AndroidPhone-items-popup" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-items-popup-169x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-items-popup-576x1024.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/androidphone-items/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-items-150x150.png" class="attachment-thumbnail" alt="AndroidPhone-items" data-attachment-id="5044" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-items.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="AndroidPhone-items" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-items-169x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-items-576x1024.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/androidphone-labor-popup/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Labor-Popup-150x150.png" class="attachment-thumbnail" alt="AndroidPhone-Labor-Popup" data-attachment-id="5045" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Labor-Popup.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="AndroidPhone-Labor-Popup" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Labor-Popup-169x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Labor-Popup-576x1024.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/androidphone-labor/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Labor-150x150.png" class="attachment-thumbnail" alt="AndroidPhone-Labor" data-attachment-id="5046" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Labor.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="AndroidPhone-Labor" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Labor-169x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Labor-576x1024.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/androidphone-list/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-list-150x150.png" class="attachment-thumbnail" alt="AndroidPhone-list" data-attachment-id="5047" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-list.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="AndroidPhone-list" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-list-169x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-list-576x1024.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/androidphone-login/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Login-150x150.png" class="attachment-thumbnail" alt="AndroidPhone-Login" data-attachment-id="5048" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Login.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="AndroidPhone-Login" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Login-169x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-Login-576x1024.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/androidphone-map/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-map-150x150.png" class="attachment-thumbnail" alt="AndroidPhone-map" data-attachment-id="5049" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-map.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="AndroidPhone-map" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-map-169x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-map-576x1024.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/androidphone-summary/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-summary-150x150.png" class="attachment-thumbnail" alt="AndroidPhone-summary" data-attachment-id="5050" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-summary.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="AndroidPhone-summary" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-summary-169x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhone-summary-576x1024.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/androidphoneconfirmation/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhoneconfirmation-150x150.png" class="attachment-thumbnail" alt="AndroidPhoneconfirmation" data-attachment-id="5051" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhoneconfirmation.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="AndroidPhoneconfirmation" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhoneconfirmation-169x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/AndroidPhoneconfirmation-576x1024.png" /></a>

<p>And here&#8217;s how it looks on Android tablets.</p>

<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/tabconfirmation/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabConfirmation-150x150.png" class="attachment-thumbnail" alt="TabConfirmation" data-attachment-id="5053" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabConfirmation.png" data-orig-size="1280,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TabConfirmation" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabConfirmation-300x188.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabConfirmation-1024x640.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/tabexpense-popup/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabExpense-Popup-150x150.png" class="attachment-thumbnail" alt="TabExpense-Popup" data-attachment-id="5054" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabExpense-Popup.png" data-orig-size="1280,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TabExpense-Popup" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabExpense-Popup-300x188.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabExpense-Popup-1024x640.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/tabexpense/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabExpense-150x150.png" class="attachment-thumbnail" alt="TabExpense" data-attachment-id="5055" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabExpense.png" data-orig-size="1280,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TabExpense" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabExpense-300x188.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabExpense-1024x640.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/tabitem-popup/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabItem-Popup-150x150.png" class="attachment-thumbnail" alt="TabItem-Popup" data-attachment-id="5056" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabItem-Popup.png" data-orig-size="1280,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TabItem-Popup" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabItem-Popup-300x188.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabItem-Popup-1024x640.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/tablabor-popup/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLabor-popup-150x150.png" class="attachment-thumbnail" alt="TabLabor-popup" data-attachment-id="5057" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLabor-popup.png" data-orig-size="1280,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TabLabor-popup" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLabor-popup-300x188.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLabor-popup-1024x640.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/tablabor/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLabor-150x150.png" class="attachment-thumbnail" alt="TabLabor" data-attachment-id="5058" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLabor.png" data-orig-size="1280,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TabLabor" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLabor-300x188.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLabor-1024x640.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/tablist/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabList-150x150.png" class="attachment-thumbnail" alt="TabList" data-attachment-id="5059" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabList.png" data-orig-size="1280,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TabList" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabList-300x188.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabList-1024x640.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/tablogin/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLogin-150x150.png" class="attachment-thumbnail" alt="TabLogin" data-attachment-id="5060" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLogin.png" data-orig-size="1280,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TabLogin" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLogin-300x188.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabLogin-1024x640.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/tabmap/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabMap-150x150.png" class="attachment-thumbnail" alt="TabMap" data-attachment-id="5061" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabMap.png" data-orig-size="1280,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TabMap" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabMap-300x188.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabMap-1024x640.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/tabsummary-popup/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabSummary-Popup-150x150.png" class="attachment-thumbnail" alt="TabSummary-Popup" data-attachment-id="5062" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabSummary-Popup.png" data-orig-size="1280,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TabSummary-Popup" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabSummary-Popup-300x188.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabSummary-Popup-1024x640.png" /></a>
<a href='http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/tabsummary/'><img width="150" height="150" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabSummary-150x150.png" class="attachment-thumbnail" alt="TabSummary" data-attachment-id="5063" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabSummary.png" data-orig-size="1280,800" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TabSummary" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabSummary-300x188.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/TabSummary-1024x640.png" /></a>

<p>Umm, wait, the images above look very similar with iOS rather than Android, particularly the <em>swipe-to-action</em> screens. Could it be possibly that I attach wrong images, you might asked. Nope! We&#8217;ve great surprises for you, Android fans! Stay tuned for my answer in the next post.</p>
<h1>Wrapping Up</h1>
<p>I hope this post may give you meaningful insights on better design for cross-platform, especially one that works for both tablets and phones. By streamlining the design and user flow at the beginning, jumping into development becomes much an easier task with clearer goal in mind.</p>
<blockquote><p>If you haven&#8217;t try out Crosslight, you can quickly jump start by requesting your free 30 day trial <a href="http://intersoftsolutions.com/RequestTrial">here</a>. You will be guided by our consultant team during your evaluation period.</p></blockquote>
<p>In the next post, we’ll see how can we use Crosslight to create this app and make it work across all platforms of different screen sizes and see how much code for this app can be optimized to work for multiple platforms.</p>
<h1>Update</h1>
<p>Read the <a href="http://blog.intersoftsolutions.com/2016/04/redesigning-xamarin-field-service-sample-with-crosslight-part-2/" target="_blank">part 2 here</a>, which contains highlights of the finished sample along with snippet codes and detailed explanations.</p>
<p>Till next post,<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/11/redesigning-xamarin-field-service-sample-with-crosslight/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iPad-Transition.mp4" length="569039" type="video/mp4" />
		</item>
		<item>
		<title>Adding Header and Footer for iOS TableView and Android ListView</title>
		<link>http://blog.intersoftsolutions.com/2015/11/adding-header-and-footer-for-ios-tableview-and-android-listview/</link>
		<comments>http://blog.intersoftsolutions.com/2015/11/adding-header-and-footer-for-ios-tableview-and-android-listview/#comments</comments>
		<pubDate>Wed, 18 Nov 2015 07:01:08 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[kb-how-to-article]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[custom view]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[listview]]></category>
		<category><![CDATA[tableview]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=5159</guid>
		<description><![CDATA[Hi guys, I&#8217;m back with another blog post, this time covering how to use the a custom view for header and footer to be used alongside iOS TableView / Android TableView. You&#8217;ll see how you can easily create custom views and use them as headers and footers in [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-3.38.19-PM-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="Screen Shot 2015-11-19 at 3.38.19 PM" style="float:right; margin:0 0 10px 10px;" data-attachment-id="5164" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-3.38.19-PM.png" data-orig-size="1736,1334" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2015-11-19 at 3.38.19 PM" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-3.38.19-PM-300x231.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-3.38.19-PM-1024x787.png" /><p>Hi guys, I&#8217;m back with another blog post, this time covering how to use the a custom view for header and footer to be used alongside iOS TableView / Android TableView. You&#8217;ll see how you can easily create custom views and use them as headers and footers in your Crosslight apps.</p>
<p><img class="alignnone size-large wp-image-5164" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-3.38.19-PM-1024x787.png" alt="Screen Shot 2015-11-19 at 3.38.19 PM" width="604" height="464" /></p>
<p>After this project has completed, you&#8217;ll end up with a custom header and footer in your ListView/TableView. When you click on the Add Item button on the top, new item will be added to the list, and you can see how the header and footer is correctly persisted when the items collection is updated.</p>
<p>To complete this project, there are several steps need to be completed:</p>
<ul>
<li>Preparing the project</li>
<li>Creating custom views for iOS</li>
<li>Preparing the BIndingProvider</li>
<li>Preparing the ViewModel</li>
<li>Modify iOS ViewController and running the project</li>
<li>Creating custom views for Android</li>
<li>Modifying Android ListActivity and running the project</li>
</ul>
<p>Without further ado, let&#8217;s get started.</p>
<h1>Preparing the project</h1>
<p>For this sample, I&#8217;ll keep it nice and simple. This time, I&#8217;ll start from the Navigation template created using Crosslight Project Wizard. I&#8217;ll name this project: <strong>HeaderAndFooter</strong>.</p>
<h1>Creating custom views for iOS</h1>
<p>Let&#8217;s begin by creating a new custom header view for iOS, by right-clicking on the VIews folder in <strong>HeaderAndFooter.iOS/Views</strong> folder and choose <strong>Add</strong>, <strong>New File</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-4.57.27-PM.png"><img class="alignnone size-large wp-image-5166" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-4.57.27-PM-1024x285.png" alt="Screen Shot 2015-11-19 at 4.57.27 PM" width="604" height="168" /></a></p>
<p>Then choose <strong>Crosslight</strong>, <strong>Crosslight iOS View for iPhone</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-4.54.59-PM.png"><img class="alignnone size-large wp-image-5167" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-4.54.59-PM-1024x774.png" alt="Screen Shot 2015-11-19 at 4.54.59 PM" width="604" height="457" /></a></p>
<p>Give it a name of <strong>CustomHeader</strong>. This will generate two files, <em>CustomHeader.xib</em> and <em>CustomHeader.cs</em> for the designer files.</p>
<p>Then open the <em>CustomHeader.xib</em> using Xcode Interface Builder.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-4.59.08-PM.png"><img class="alignnone size-large wp-image-5168" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-4.59.08-PM-1024x174.png" alt="Screen Shot 2015-11-19 at 4.59.08 PM" width="604" height="103" /></a></p>
<p>In Xcode Interface Builder, drag a Label and a button.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-5.03.12-PM.png"><img class="alignnone size-large wp-image-5169" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-5.03.12-PM-1024x306.png" alt="Screen Shot 2015-11-19 at 5.03.12 PM" width="604" height="180" /></a></p>
<p>Set the label outlet as <strong>TxtHeader </strong>and the button as <strong>BtnHeader</strong>. I won&#8217;t go too much on the layouting details, but you can ensure the followings are set:</p>
<ul>
<li>Set the View size as Freeform, so you can adjust the view size freely.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-5.06.01-PM.png"><img class="alignnone  wp-image-5170" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-5.06.01-PM.png" alt="Screen Shot 2015-11-19 at 5.06.01 PM" width="321" height="89" /></a></li>
<li>Turn off Auto Layout.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-5.06.24-PM.png"><img class="alignnone  wp-image-5171" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-5.06.24-PM.png" alt="Screen Shot 2015-11-19 at 5.06.24 PM" width="318" height="183" /></a></li>
<li>Ensure that the View background is set to <strong>Default</strong> (no fill), this will avoid clipping issues when placed as the header view.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-5.07.15-PM.png"><img class="alignnone  wp-image-5172" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-5.07.15-PM.png" alt="Screen Shot 2015-11-19 at 5.07.15 PM" width="317" height="252" /></a></li>
</ul>
<p>Your custom header is now ready. Let&#8217;s move on to custom footer.</p>
<p>Basically, you&#8217;re going to perform the same tasks as adding a custom header, but the difference is that you&#8217;re going to give it a file name of <strong>CustomFooter</strong>, then provide a label with the outlet of <strong>TxtCopyright</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-9.14.16-PM.png"><img class="alignnone size-large wp-image-5174" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-9.14.16-PM-1024x222.png" alt="Screen Shot 2015-11-19 at 9.14.16 PM" width="604" height="131" /></a></p>
<h1>Preparing the BindingProvider</h1>
<p>Since you&#8217;ve successfully created the custom views, let&#8217;s prepare the <strong>BindingProvider</strong> first to prepare the properties and commands you wish to bind to the View. Open up <strong>NavigationBindingProvider</strong> (I renamed this file to MainBindingProvider to avoid confusion) and add the highlighted lines.</p><pre class="crayon-plain-tag">using Intersoft.Crosslight;

namespace HeaderAndFooter
{
    public class MainBindingProvider : BindingProvider
    {
        #region Constructors

        public MainBindingProvider()
        {
            ItemBindingDescription itemBinding = new ItemBindingDescription()
            {
                DisplayMemberPath = "Title",
                NavigateMemberPath = "Target"
            };

            this.AddBinding("TableView", BindableProperties.ItemsSourceProperty, "Items");
            this.AddBinding("TableView", BindableProperties.ItemTemplateBindingProperty, itemBinding, true);
            this.AddBinding("TableView", BindableProperties.SelectedItemProperty, "SelectedItem", BindingMode.TwoWay);
            
            this.AddBinding("BtnHeader", BindableProperties.TextProperty, "ButtonText");
            this.AddBinding("BtnHeader", BindableProperties.CommandProperty, "AddCommand");
            this.AddBinding("TxtCopyright", BindableProperties.TextProperty, "CopyrightText");
            this.AddBinding("TxtHeader", BindableProperties.TextProperty, "HeaderText");
        }

        #endregion
    }
}</pre><p>From the added lines, notice that we&#8217;re going to do the following:</p>
<ul>
<li>Bind <strong>ButtonText</strong> property in the ViewModel to the <strong>BtnHeader</strong> button.</li>
<li>Bind the ViewModel&#8217;s built-in <strong>AddCommand</strong> to the <strong>BtnHeader</strong> button. This is available in the <em>EditableListViewModel</em> shipped in Crosslight.</li>
<li>Bind the <strong>HeaderText</strong> property in the ViewModel to the <strong>TxtHeader</strong> label.</li>
<li>Bind the <strong>CopyrightText</strong> property in the ViewModel to <strong>TxtCopyright</strong> label. This is for the footer.</li>
</ul>
<p>Since you&#8217;ve prepared everything in the BindingProvider, let&#8217;s modify the ViewModel.</p>
<h1>Modifying the ViewModel</h1>
<p>The  <strong>NavigationViewModel </strong>now looks like the following. It&#8217;s located inside the <strong>HeaderAndFooter.Core/ViewModels</strong> folder.</p><pre class="crayon-plain-tag">using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using Intersoft.Crosslight;

namespace HeaderAndFooter.ViewModels
{
    public class NavigationViewModel : SampleListViewModelBase&lt;NavigationItem&gt;
    {
        #region Constructors

        public NavigationViewModel()
        {
            ObservableCollection&lt;NavigationItem&gt; items = new ObservableCollection&lt;NavigationItem&gt;();

            items.Add(new NavigationItem("Simple Page", "About", typeof(SimpleViewModel)));
            items.Add(new NavigationItem("About This App", "About", typeof(AboutNavigationViewModel)));

            this.SourceItems = items;

            this.ButtonText = "Add Item";
            this.CopyrightText = "Copyright © Intersoft Solutions";
        }

        #endregion

        #region Properties

        private string _aboutText { get; set; }
        private string _buttonText { get; set; }
        private string _copyrightText { get; set; }
        private string _headerText { get; set; }

        public string AboutText
        {
            get { return _aboutText; }
            set
            {
                if (_aboutText != value)
                {
                    _aboutText = value;
                    OnPropertyChanged("AboutText");
                }
            }
        }

        public string ButtonText
        {
            get { return _buttonText; }
            set
            {
                if (_buttonText != value)
                {
                    _buttonText = value;
                    OnPropertyChanged("ButtonText");
                }
            }
        }

        public string CopyrightText
        {
            get { return _copyrightText; }
            set
            {
                if (_copyrightText != value)
                {
                    _copyrightText = value;
                    OnPropertyChanged("CopyrightText");
                }
            }
        }

        public string HeaderText
        {
            get
            {
                _headerText = this.Items.Count() + " items.";
                return _headerText;
            }
            set
            {
                if (_headerText != value)
                {
                    _headerText = value;
                    OnPropertyChanged("HeaderText");
                }
            }
        }

        #endregion

        #region Methods

        protected override bool CanExecuteAdd(object parameter)
        {
            return true;
        }

        protected override void ExecuteAdd(object parameter)
        {
            base.ExecuteAdd(parameter);

            NavigationItem newItem = new NavigationItem("Simple Page", "About", typeof(SimpleViewModel));
            var items = this.SourceItems.ToObservable();
            items.Add(newItem);
        }

        protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
        {
            this.OnPropertyChanged("HeaderText");
        }

        #endregion
    }
}</pre><p>Let&#8217;s take a deeper look at this class, starting from the top. In the constructor, we&#8217;ve prepared our <strong>SourceItems</strong> with <strong>ObservableCollection</strong>. We then initialize the <strong>ButtonText</strong> property and the <strong>CopyrightText</strong> property. The <strong>ButtonText</strong> and <strong>CopyrightText</strong> property are all MVVM-ready properties. The <strong>HeaderText</strong> is also an MVVM-ready property, but in the property getter, the text is always updated according to the number of items which exists in the list.</p>
<p>Right after the properties, we then override the built-in <strong>CanExecuteAdd</strong> method to return true so that the AddCommand can be executed, as well as overriding the actions for the <strong>ExecuteAdd </strong>method. Here, we simply add a new <strong>NavigationItem</strong> to the list. Just right after the method, Crosslight has provided an elegant way to perform any additional changes to other properties or any other implementation by overriding the <strong>OnCollectionChanged</strong> method. In the method, we trigger the <strong>OnPropertyChanged</strong> of the <strong>HeaderText</strong>, so that the number of items is always updated in our custom header.</p>
<h1>Modify iOS ViewController and running the project</h1>
<p>Now that you got the Core project covered, let&#8217;s modify the <strong>MainViewController</strong> (located inside <strong>HeaderAndFooter.iOS/ViewControllers</strong>) a bit.</p><pre class="crayon-plain-tag">using CoreGraphics;
using Foundation;
using HeaderAndFooter.ViewModels;
using Intersoft.Crosslight;
using Intersoft.Crosslight.iOS;
using UIKit;

namespace HeaderAndFooter.iOS.ViewControllers
{
    [Register("MainViewController")]
    [ImportBinding(typeof(MainBindingProvider))]
    public class MainViewController : UITableViewController&lt;NavigationViewModel&gt;
    {
        #region Properties

        public override UIViewTemplate HeaderViewTemplate
        {
            get { return new UIViewTemplate(CustomHeader.Nib); }
        }

        public override UIViewTemplate FooterViewTemplate
        {
            get { return new UIViewTemplate(CustomFooter.Nib); }
        }

        public override TableViewInteraction InteractionMode
        {
            get { return TableViewInteraction.Navigation; }
        }

        public override bool ShowGroupHeader
        {
            get { return false; }
        }

        public override UITableViewStyle TableViewStyle
        {
			get { return UITableViewStyle.Plain; }
        }

        #endregion

        #region Methods

        protected override void InitializeView()
        {
            base.InitializeView();

            // set navigation title
            this.NavigationItem.Title = "Crosslight App";
        }

        #endregion
    }
}</pre><p>In the <strong>MainViewController</strong>, we&#8217;ve overridden the <strong>HeaderViewTemplate</strong> as well as <strong>FooterViewTemplate</strong> to return the Nib for each custom header and footer view that we&#8217;ve just defined. We also made things simpler by not showing the group header as wellas ensuring that the used <strong>TableViewStyle</strong> is <strong>Plain</strong>. Run the project. You should get the following result.</p>
<div style="width: 500px; " class="wp-video"><video class="wp-video-shortcode" id="video-5159-6" width="500" height="360" loop="1" autoplay="1" preload="auto" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS-header-footer.mp4?_=6" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS-header-footer.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS-header-footer.mp4</a></video></div>
<p>If you&#8217;re curious about the separator that exists between the header with the table view, as well as the footer with the table view, it&#8217;s because I&#8217;ve added an additional view in the custom header and footer layout, with the height of 1 unit and giving it a light gray background, to show the boundaries of the custom header and custom footer view. We&#8217;re going to do the same with Android layout later. You&#8217;ve completed the iOS version. Let&#8217;s move on to the Android.</p>
<h1>Creating custom views for Android</h1>
<p>Similar to iOS, you&#8217;ll need to create a custom header view first for Android. To do this, simply right click on the <strong>Resources/layout</strong> folder in the <strong>HeaderAndFooter.Android/Views</strong> folder, then choose <strong>Add</strong>, <strong>New Item</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-9.42.51-PM.png"><img class="alignnone size-large wp-image-5177" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-9.42.51-PM-1024x202.png" alt="Screen Shot 2015-11-19 at 9.42.51 PM" width="604" height="119" /></a></p>
<p>&nbsp;</p>
<p>From the dialog that appears, choose <strong>Android</strong>, <strong>Layout</strong>, and give it a name of <strong>CustomHeader</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-9.43.39-PM.png"><img class="alignnone size-large wp-image-5178" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-19-at-9.43.39-PM-1024x794.png" alt="Screen Shot 2015-11-19 at 9.43.39 PM" width="604" height="468" /></a></p>
<p>&nbsp;</p>
<p>And here&#8217;s the contents of the <strong>CustomHeader.axml</strong> file.</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="wrap_content"
    &gt;
    &lt;LinearLayout 
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        &gt;
        &lt;TextView
        	android:id="@+id/TxtHeader"
        	android:layout_width="fill_parent"
        	android:layout_height="30dp"
        	android:textSize="20sp"
        	android:gravity="left"
            android:layout_weight="1"
        /&gt;
        &lt;Button 
            android:id="@+id/BtnHeader"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
        /&gt;
    &lt;/LinearLayout&gt;
    &lt;LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="1px"
            android:background="#f2f2f2"
        /&gt;
&lt;/LinearLayout&gt;</pre><p>This layout simply contains a pretty much similar layout with iOS, that contains a label, a button, and a gray separator at the bottom. Repeat the same procedure for the custom footer layout. Here&#8217;s the contents of the <strong>CustomFooter.axml</strong> file.</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="wrap_content"
    &gt;
    &lt;LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="1px"
        android:background="#f2f2f2"
    /&gt;
    &lt;TextView
    	android:id="@+id/TxtCopyright"
    	android:layout_width="fill_parent"
    	android:layout_height="30dp"
    	android:textSize="12sp"
    	android:gravity="center"
        android:fontFamily="sans-serif-light" 
    /&gt;
&lt;/LinearLayout&gt;</pre><p></p>
<h1></h1>
<h1>Modifying Android ListActivity and running the project</h1>
<p>Since you&#8217;ve prepared the custom views let&#8217;s modify the Android ListActivity to display our custom header and footer. Open up <strong>MainActivity </strong>in the <strong>HeaderAndFooter.Android/Activities</strong> folder and take note of the following changes.</p><pre class="crayon-plain-tag">using Android.App;
using HeaderAndFooter.ViewModels;
using Intersoft.Crosslight;
using Intersoft.Crosslight.Android;

namespace HeaderAndFooter.Android
{
    [Activity(Label = "Crosslight App", Icon = "@drawable/icon")]
    [ImportBinding(typeof(MainBindingProvider))]
    public class MainActivity : ListActivity&lt;NavigationViewModel&gt;
    {
        #region Methods

        protected override void InitializeView()
        {
            base.InitializeView();

            this.RegisterViewIdentifier("TableView", this.ListView);
        }

        #endregion

        #region Properties

        protected override int ContentLayoutId
        {
            get { return Intersoft.Crosslight.Android.Resource.Layout.listgroupsectionlayout; }
        }

        protected override int FooterLayoutId
        {
            get { return Resource.Layout.CustomFooter; }
        }

        protected override int HeaderLayoutId
        {
            get { return Resource.Layout.CustomHeader; }
        }

        public override ListViewInteraction InteractionMode
        {
            get { return ListViewInteraction.Navigation; }
        }

        #endregion
    }
}</pre><p>All you need to do is just override the <strong>FooterLayoutId</strong> as well <strong>HeaderLayoutId</strong> and provide the layout you&#8217;ve just created. If you notice in the template, right in the InitializeView method, we&#8217;re registering the ListView with the TableView identifier at runtime. This is how you would register a view at runtime. For more information in registering view at runtime, check out <a href="http://developer.intersoftsolutions.com/display/crosslight/Getting+Started+with+Crosslight+Android+App#GettingStartedwithCrosslightAndroidApp-RegisteringaViewIdentifieratRuntime">this document</a> in the Developer Center.</p>
<p>You&#8217;re now ready to run the project. You should get the result similar to the following.</p>
<div style="width: 500px; " class="wp-video"><video class="wp-video-shortcode" id="video-5159-7" width="500" height="360" loop="1" autoplay="1" preload="auto" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android-header-footer.mp4?_=7" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android-header-footer.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android-header-footer.mp4</a></video></div>
<h1>Wrapping Up</h1>
<p>You&#8217;ve seen how easy it is to set up a custom header and footer view to use with iOS TableView and Android ListView. With Crosslight, the custom views are automatically compatible with data binding and Crosslight takes care of the magic, so you can focus on building your app instead of having to worry about wiring behind the scenes. Hopefully this gives you a good insight on how Crosslight accomplishes business scenarios elegantly, without compromising any of the MVVM-design pattern enforced throughout the app.</p>
<p>As always, you can find the source code to this post here: <a href="http://git.intersoftsolutions.com/projects/CT/repos/crosslightheaderandfooter/browse">http://git.intersoftsolutions.com/projects/CT/repos/crosslightheaderandfooter/browse.</a></p>
<p>See you in the next post,<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/11/adding-header-and-footer-for-ios-tableview-and-android-listview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS-header-footer.mp4" length="535560" type="video/mp4" />
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android-header-footer.mp4" length="319873" type="video/mp4" />
		</item>
		<item>
		<title>Getting Started with Crosslight Charting</title>
		<link>http://blog.intersoftsolutions.com/2015/10/getting-started-with-crosslight-charting/</link>
		<comments>http://blog.intersoftsolutions.com/2015/10/getting-started-with-crosslight-charting/#comments</comments>
		<pubDate>Wed, 21 Oct 2015 06:25:00 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2015 R1]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Charting]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[UI Components]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=4759</guid>
		<description><![CDATA[One of the greatest new components in Crosslight 4 is a powerful, full-fledged Charting component, enabling Crosslight developers to easily add stunning charts to their business cross-platform mobile apps. Fully MVVM capable, it works beautifully across iOS and Android platforms. Have you checked out the new Crosslight Charting yet? If not, then this post [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/10/crosslight-charting-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="crosslight-charting" style="float:right; margin:0 0 10px 10px;" data-attachment-id="4786" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/10/crosslight-charting.png" data-orig-size="1218,1082" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="crosslight-charting" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/10/crosslight-charting-300x267.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/10/crosslight-charting-1024x910.png" /><p>One of the greatest new components in Crosslight 4 is a powerful, full-fledged Charting component, enabling Crosslight developers to easily add stunning charts to their business cross-platform mobile apps. Fully MVVM capable, it works beautifully across iOS and Android platforms.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/10/crosslight-charting.png"><img class="alignnone size-large wp-image-4786" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/10/crosslight-charting-1024x910.png" alt="crosslight-charting" width="604" height="537" /></a></p>
<p>Have you checked out the new Crosslight Charting yet? If not, then this post is the perfect guide for you. This post will help you learn how to get started with Crosslight Charting.</p>
<h1>Starting Off</h1>
<p>Let’s try to create the illustrated column chart from scratch. To start off, I created a Blank Crosslight project with Crosslight Project Wizard. I&#8217;ll call this CrosslightCharting for now. After the project is created, don’t forget to add the necessary references as well.</p>
<p><a href="file://localhost//Users/nicholaslie/Library/Containers/com.blogo.Blogo/Data/Library/Caches/com.blogo.Blogo/1445403569_full.png" target="_blank"><img class="aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/10/1445403604_thumb.png" alt="" align="middle" /></a></p>
<h2>Necessary References</h2>
<ul>
<li>Core project: Add <strong>Intersoft.Crosslight.UI.DataVisualization</strong> assembly.</li>
<li>iOS project: Add<strong> Intersoft.Crosslight.UI.DataVisualization</strong> and <strong>Intersoft.Crosslight.UI.DataVisualization.iOS</strong> assembly.</li>
<li>Android project: Add <strong>Intersoft.Crosslight.UI.DataVisualization</strong> and <strong>Intersoft.Crosslight.UI.DataVisualization.Android</strong> assembly.</li>
</ul>
<p>Now you&#8217;re ready to begin writing some codes.</p>
<h1>Preparing the ViewModel</h1>
<p>Let’s prepare the ViewModel that will provide the data to the chart. I&#8217;m going to create a <em>ColumnViewModel</em> class inside the <em>CrosslightCharting.Core/ViewModels</em> folder, and write really simple code to initialize the <em>Chart model</em>. Here&#8217;s how.</p><pre class="crayon-plain-tag">using Intersoft.Crosslight.UI.DataVisualization;
using Intersoft.Crosslight.ViewModels;

namespace CrosslightCharting.Core
{
    public class ColumnViewModel : ViewModelBase&lt;ColumnSeries&gt;
    {
        private Chart _chart;

        public Chart Chart
        {
            get { return _chart; }
            set
            {
                _chart = value;
                OnPropertyChanged("Chart");
            }
        }

        public ColumnViewModel()
        {
            InitializeChart();
        }

        private void InitializeChart()
        {
            this.Chart = new Chart();
            this.Chart.Title.Text = "Agile Sprint Status";

            // setup series for In Progress
            Series inProgressSeries = new ColumnSeries();
            inProgressSeries.Title = "In Progress";
            inProgressSeries.Items = new List&lt;DataPoint&gt;();
            inProgressSeries.Items.Add(new DataPoint("Android", 70));
            inProgressSeries.Items.Add(new DataPoint("iOS", 42));
            inProgressSeries.Items.Add(new DataPoint("WinPhone", 20));
            this.Chart.Series.Add(inProgressSeries);

            // setup series for Resolved
            Series resolvedSeries = new ColumnSeries();
            resolvedSeries.Title = "Resolved";
            resolvedSeries.Items.Add(new DataPoint("Android", 53));
            resolvedSeries.Items.Add(new DataPoint("iOS", 32));
            resolvedSeries.Items.Add(new DataPoint("WinPhone", 40));
            this.Chart.Series.Add(resolvedSeries);
        }
    }
}</pre><p>As you can see, all we did is simply initializing the chart in the ViewModel and populated two <em>ColumnSeries</em> for it, and add the data points for each series which will be displayed side-by-side. Crosslight Charting library includes <em>component models</em> that you can consume in the shared Core project. The <em>Chart model </em>represents the data source required for the chart, and also provides a wealth of chart configuration and settings. The <em>Series</em>, <em>ColumnSeries</em>, and <em>DataPoint</em> are another example of the component models available in the Charting library.</p>
<p>For the sake of simplicity, the above sample uses static data points as the <em>items source</em> for each series. If your data points are heavily reused across your application, you can definitely refactor the data points into a repository or data manager class which you can easily consume with a simple method call. Later, you can learn more about it from my sample project.</p>
<p>It&#8217;s also noteworthy to point out that changes to the <em>Chart model</em> will automatically propagated to the view, thanks to the powerful binding architecture of Crosslight. This means you can add or remove <em>Series</em> dynamically in your app. Of course, you can also set the <em>items source</em> of the <em>Series</em> later in the app&#8217;s cycle, such as after fetching data from the server in most real-world scenarios. Better yet, changes you made to the <em>Chart model</em> will not be only propagated to the view, they will be also smoothly animated from the current point to the new point. Absolutely no additional code needed, it just works!</p>
<p>For your reference, here&#8217;s a code snippet how to initialize the items source of a Series combined with an async data load.</p><pre class="crayon-plain-tag">protected override async void Navigated(NavigatedParameter parameter)
{
    this.Chart.Series.First().Items = await this.Repository.GetAgileStatusAsync("In Progress");
}</pre><p>That&#8217;s pretty cool, right?</p>
<p>Crosslight Charting emphasizes not only on powerful charting capabilities, but also provides developers with easy-to-use and intuitive APIs, so you can get things done without having to worry about the heavy work. If you notice, you don&#8217;t necessarily need to define the dependent and independent axes for the chart, since Crosslight Charting comes with automatic axis detection that generates meaningful axis and range, purely based on the given data. Simply beautiful.</p>
<p>&nbsp;</p>
<h1>Preparing the BindingProvider</h1>
<p>Since our ViewModel and <em>Chart model</em> is ready, let&#8217;s prepare the <em>Binding Provider</em> which will bind the C<em>hart model</em> to the view. This is where the magic will happen.</p>
<p>Simply create a new Crosslight Binding Provider using the item templates built into Visual Studio (Windows) or Xamarin Studio (Mac). I&#8217;ll call this <em>ColumnBindingProvider</em>, and I&#8217;ll put it inside the CrosslightCharting.Core/BindingProviders folder.</p><pre class="crayon-plain-tag">#region Usings

using Intersoft.Crosslight;
using Intersoft.Crosslight.UI.DataVisualization;

#endregion

namespace CrosslightCharting.Core
{
    public class ColumnBindingProvider : BindingProvider
    {
        #region Constructors

        public ColumnBindingProvider()
        {
            this.AddBinding("ChartView", ChartProperties.ChartProperty, new BindingDescription("Chart", BindingMode.TwoWay));
        }

        #endregion
    }
}</pre><p>There&#8217;s not much to explain here as the code is self explanatory. It simply binds the <em>ChartView</em> to the <em>Chart</em> property of the ViewModel. That&#8217;s it. Now you have the ViewModel with complete data populated as well as the BindingProvider.</p>
<h1>Creating the Chart for iOS</h1>
<p>You&#8217;re now ready to create the ViewController that will host the chart in iOS. I&#8217;ll create a new ViewController called <em>ColumnViewController</em> inside the CrosslightCharting.iOS/ViewControllers folder. Here&#8217;s the <em>ColumnViewController </em>file:</p><pre class="crayon-plain-tag">#region Usings

using CrosslightCharting.Core;
using Intersoft.Crosslight;
using Intersoft.Crosslight.UI.DataVisualization.iOS;

#endregion

namespace CrosslightCharting.iOS
{
    [ImportBinding(typeof(ColumnBindingProvider))]
    public partial class ColumnViewController : UIChartViewController&lt;ColumnViewModel&gt;
    {
        protected override void InitializeView()
        {
            base.InitializeView();

            this.NavigationItem.Title = "Column Series";
        }
    }
}</pre><p>As you see from the code above, the ViewController contains almost nothing except for the BindingProvider and the ViewModel I&#8217;ve just created before. Also note that you need to subclass the <em>UIChartViewController</em> class. The UIChartViewController provides a ChartView property which returns the instance of UIChartView that it manages. It also automatically registers the <em>ChartView</em> as an identifier, allowing you to easily bind to the chart view in the binding provider.</p>
<p>Simply run the project to see the Crosslight Charting in action.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/10/Simulator-Screen-Shot-October-21-2015-2.46.47-PM.png"><img class=" size-medium wp-image-4783 aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/10/Simulator-Screen-Shot-October-21-2015-2.46.47-PM-169x300.png" alt="Simulator Screen Shot October 21, 2015, 2.46.47 PM" width="169" height="300" /></a></p>
<p>You&#8217;ve just created your first Crosslight Charting application in iOS. Congratulations! Well, how about the Android platform?</p>
<h1>Creating the Chart for Android</h1>
<p>Well, since you&#8217;ve prepared the ViewModel and the BindingProvider, so, as you guessed it, all you need to do, is just to provide the &#8220;view&#8221; for Android platform. Let&#8217;s create an Activity for that. I&#8217;ll call it <em>ColumnActivity</em>, and put it inside the CrosslightCharting.Android/Activities folder.</p><pre class="crayon-plain-tag">#region Usings

using Android.App;
using Intersoft.Crosslight.Android;
using CrosslightCharting.Core;
using Intersoft.Crosslight;

#endregion

namespace CrosslightCharting.Android
{
    [Activity(Label = "Column Series")]		
    [ImportBinding(typeof(ColumnBindingProvider))]
    public class ColumnActivity : Activity&lt;ColumnViewModel&gt;
    {
        protected override int ContentLayoutId
        {
            get
            {
                return Resource.Layout.ColumnSeriesLayout;
            }
        }
    }
}</pre><p>Again, nothing&#8217;s here except for the ViewModel and the BindingProvider we&#8217;ve created earlier. As you can see, I&#8217;ve provided a layout for this activity by creating an Android layout file inside the CrosslightCharting.Android/Resources/Layout folder, called <em>ColumnSeriesLayout.axml</em>. Let&#8217;s see how this file looks like.</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="@android:color/white"
    android:gravity="center"&gt;
    &lt;Intersoft.Crosslight.UI.DataVisualization.Android.ChartView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/ChartView" /&gt;
&lt;/LinearLayout&gt;</pre><p>The layout is simply a ChartView that covers the entire screen. I&#8217;ve also put a white background to get better visibility of the chart. Android version is done. Let&#8217;s see it in action.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/10/Nexus-5-Lollipop-Screenshot-2.png"><img class="aligncenter wp-image-4787 size-medium" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/10/Nexus-5-Lollipop-Screenshot-2-169x300.png" alt="Nexus 5 Lollipop Screenshot 2" width="169" height="300" /></a></p>
<p>&nbsp;</p>
<p>Now, I want you to pay attention to how Crosslight Charting manages to create the axes automatically for you, and define the &#8220;smart&#8221; ranges for those axes that fits the screen nicely. Also notice that the legend is automatically generated for you based on the given data points. How cool is that? See, I told you that it works consistently between iOS and Android platform.</p>
<p>And if you need to customize anything about the Chart, whether its data source, series, or other settings, you do it only once in the  ViewModel. At this point, I hope you&#8217;ve started to get the point how Crosslight works in overall, and how it lives to its highly acclaimed <em>100% shared UI logic</em>.</p>
<h1>Learning more about Crosslight Charting</h1>
<p>You&#8217;ve successfully created a column chart with Crosslight Charting. In addition to column charts, Crosslight Charting also supports many other chart types such as area, bar, doughnut, line, pie, scatter, step area, and much more.</p>
<p>If you&#8217;re interested in learning more, I highly suggest you to check out the list of topics here:</p>
<ul>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Understanding+Chart+Series">Understanding chart series</a></li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Understanding+Chart+Axis">Understanding chart axis</a></li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Understanding+Chart+Legend">Understanding chart legend</a></li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Understanding+Chart+Title">Understanding chart title</a></li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Configuring+Chart+Appearance">Configuring chart appearance</a></li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Understanding+Animation">Understanding animation</a></li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Enabling+Zoom">Enabling zoom</a></li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Using+Data+Annotation">Using data annotation</a></li>
</ul>
<p>I also highly recommend you to check out the samples directly to see all of the features hands-on. It is available in the Git repository in this <a href="http://git.intersoftsolutions.com/projects/CROS-SUPP/repos/charting-sample/browse">link</a>.</p>
<p>You can also find the source code to this our Git repository <a href="http://git.intersoftsolutions.com/projects/CT/repos/crosslightcharting/browse">here</a>.</p>
<p>Till next post,</p>
<p>Cheers<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/10/getting-started-with-crosslight-charting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exciting iOS Visual Goodies in Crosslight vNext</title>
		<link>http://blog.intersoftsolutions.com/2015/04/exciting-ios-visual-crosslight-vnext/</link>
		<comments>http://blog.intersoftsolutions.com/2015/04/exciting-ios-visual-crosslight-vnext/#comments</comments>
		<pubDate>Wed, 01 Apr 2015 03:25:33 +0000</pubDate>
		<dc:creator><![CDATA[Jimmy Petrus]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[UI Components]]></category>

		<guid isPermaLink="false">http://blog.intersoftpt.com/?p=4418</guid>
		<description><![CDATA[Building on rock-solid foundation, the next major iteration of Crosslight will continue to offer new components and features that make cross-platform apps development even easier and more rapidly. There are a number of key areas that we&#8217;re focusing in the upcoming release which include data [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/04/IMG_1648-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="IMG_1648.PNG" style="float:right; margin:0 0 10px 10px;" data-attachment-id="4460" data-orig-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/04/IMG_1648.png" data-orig-size="994,1408" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="IMG_1648.PNG" data-image-description="" data-medium-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/04/IMG_1648-211x300.png" data-large-file="http://blog.intersoftsolutions.com/wp-content/uploads/2015/04/IMG_1648-722x1024.png" /><p>Building on rock-solid foundation, the next major iteration of Crosslight will continue to offer new components and features that make cross-platform apps development even easier and more rapidly. There are a number of key areas that we&#8217;re focusing in the upcoming release which include data access, enterprise frameworks, form builders, modern UI components based on latest platforms, as well as new component category that will surely boost your decelopment productivity even further.</p>
<p>In this post, I will give you a sneak preview of the upcoming features particularly for the iOS platform.</p>
<h1 class="">Sliding Parallax Animation</h1>
<p>Since its initial release, Crosslight includes a rich drawer navigation component with sliding animation available for all platforms. The next release will include many visual improvements for the drawer navigation. Specifically for the iOS platform, we&#8217;ll be adding a nice, modern parallax effect alongside with the drawer slide animation. See the example below.</p>
<div style="width: 320px; " class="wp-video"><video class="wp-video-shortcode" id="video-4418-8" width="320" height="590" loop="1" autoplay="1" preload="metadata" controls="controls"><source type="video/mp4" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/drawer-parallax.mp4?_=8" /><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/drawer-parallax.mp4">http://blog.intersoftpt.com/wp-content/uploads/2015/03/drawer-parallax.mp4</a></video></div>
<p>It&#8217;s worth noted that the parallax velocity can be customized according to your desire. It also supports the right-side drawer with consistent experience.</p>
<h1 class="">Stunning Spring Animation</h1>
<p class="">Yep, you read it right! With just a simple property set, you can now quickly add a compelling spring animation to your drawer navigation apps. No wrestling through hundred lines of code and tedious animation works. The built-in spring  animation also handles rotation well when the drawer was opened, then recalculate the new scale size based on the updated orientation — all in buttery-smooth animation.</p>
<div style="width: 320px; " class="wp-video"><video class="wp-video-shortcode" id="video-4418-9" width="320" height="590" loop="1" autoplay="1" preload="metadata" controls="controls"><source type="video/mp4" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/drawer-spring-animation.mp4?_=9" /><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/drawer-spring-animation.mp4">http://blog.intersoftpt.com/wp-content/uploads/2015/03/drawer-spring-animation.mp4</a></video></div>
<h1 class="">New Visual Effect Settings for Table View</h1>
<p class="">In addition to stunning animations, the next release will also include a vast array of new, iOS 8-esque visual effects that can be applied to the table view with just a single property set.</p>
<p class="">Unlike the conventional approach which will require you to create a custom cell template just to apply the vibrancy effect, Crosslight&#8217;s enhanced table view lets you apply a visual effect to the entire table view content by simply specifying the type of the effect you wish to apply. No tedious workaround necessary. So if you&#8217;ve got dozens of table view in existing projects, you&#8217;ll really appreciate this handy time-saving feature.</p>
<p><a href="file:///Users/jimmypetrus/Library/Containers/com.blogo.Blogo/Data/Library/Caches/com.blogo.Blogo/1426929857_full.png" target="_blank"><img class="aligncenter full" title="" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/1426929891_thumb.png" alt="" align="middle" /></a></p>
<p>Furthermore, you can also easily apply the gorgeous vibrancy effect to the selection background, which beautifully blends together with the new spring layout of drawer navigation.</p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/1426929978_full.png" target="_blank"><img class="full aligncenter" title="" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/1426929978_thumb.png" alt="" align="middle" /></a><br />
Alternatively, if you prefer a solid color for the table view content (which still looks great with the parallax background btw), you might want to apply a subtle vibrancy effect to the table separator, just like how Apple did it in some of their interfaces such as in the Notification Center.</p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/1426929152_full.png" target="_blank"><img class="full aligncenter" title="" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/1426929152_thumb.png" alt="" align="middle" /></a></p>
<h1 class="">More to Come</h1>
<p>We&#8217;ve got much more exciting stuff in the next major release of Crosslight. Beyond just UI components, the upcoming major release will also deliver the next generation data and enterprise framework which will transform the way you build reliable and scalable business-oriented apps, including support for comprehensive key scenarios on large-scale data sync. Furthermore, data access performance will never be the same again as we&#8217;re coming up with an advanced OData implementation supporting previously-impossible navigational query and aggregate projection — all programmable directly from the client.</p>
<p>Subscribe to our <a title="" href="http://blog.intersoftpt.com" target="_blank">blogs</a>, <a title="" href="https://www.facebook.com/IntersoftSolutions" target="_blank">Facebook</a> and <a title="" href="https://www.twitter.com/intersoftpt" target="_blank">Twitter</a> —stay tuned for our next updates.</p>
<p>Best,<br />
Jimmy</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/04/exciting-ios-visual-crosslight-vnext/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://blog.intersoftpt.com/wp-content/uploads/2015/03/drawer-parallax.mp4" length="5279693" type="video/mp4" />
<enclosure url="http://blog.intersoftpt.com/wp-content/uploads/2015/03/drawer-spring-animation.mp4" length="5035259" type="video/mp4" />
		</item>
	</channel>
</rss>
