<?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; kb-how-to-article</title>
	<atom:link href="http://blog.intersoftsolutions.com/category/kb-how-to-article/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>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>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>Creating Dockable View for iOS and Android</title>
		<link>http://blog.intersoftsolutions.com/2015/11/creating-dockable-view-for-ios-and-android/</link>
		<comments>http://blog.intersoftsolutions.com/2015/11/creating-dockable-view-for-ios-and-android/#comments</comments>
		<pubDate>Mon, 23 Nov 2015 11:51:49 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2015 R2]]></category>
		<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[2015 r2]]></category>
		<category><![CDATA[dockable]]></category>
		<category><![CDATA[dockable view]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[Mobile Development]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=5182</guid>
		<description><![CDATA[In my previous post, I&#8217;ve shown you how to use a header and footer with custom views in a list/table view. Now, what if I want to show a dockable view at the bottom of the screen? Let’s take the previous sample a bit further [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-1.05.53-PM-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="Screen Shot 2015-11-23 at 1.05.53 PM" style="float:right; margin:0 0 10px 10px;" /><p>In my previous <a href="http://blog.intersoftsolutions.com/2015/11/adding-header-and-footer-for-ios-tableview-and-android-listview/">post</a>, I&#8217;ve shown you how to use a header and footer with custom views in a list/table view. Now, what if I want to show a dockable view at the bottom of the screen? Let’s take the previous sample a bit further to look like the following.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.06.12-PM.png"><img class="alignnone size-large wp-image-5196" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.06.12-PM-1024x853.png" alt="Screen Shot 2015-11-23 at 2.06.12 PM" width="604" height="503" /></a></p>
<h1>Starting off</h1>
<p>To start off, I’ll just copy off the previous sample. If you haven’t read the <a href="http://blog.intersoftsolutions.com/2015/11/adding-header-and-footer-for-ios-tableview-and-android-listview/" target="_blank">previous post</a> on how to provide header and footer to your TableView / ListView, it is highly recommended for you to do so before continuing.</p>
<p>If you have done so, let’s move on.</p>
<h1>Creating dockable view on iOS</h1>
<p>To create the dockable view on iOS, you’ll need to do the following:</p>
<ul>
<li>Preparing custom table root view</li>
<li>Modifying the View</li>
<li>Modifying the View Controller</li>
</ul>
<h2>Preparing custom table root view</h2>
<p>To provide the custom table root view, you’ll need to create a new <strong>Crosslight iOS View for iPhone</strong>, which is accessible from the Item Templates, available after you’ve successfully installed Crosslight.</p>
<p>Right click on the Views in HeaderAndFooter.iOS/Views folder and select <strong>Add</strong>, <strong>New Item.</strong></p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.09.45-PM.png"><img class="alignnone size-full wp-image-5197" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.09.45-PM.png" alt="Screen Shot 2015-11-23 at 2.09.45 PM" width="970" height="408" /></a></p>
<p>Then choose, <strong>Crosslight iOS View for iPhone</strong>. Give it a name of <strong>CustomTableRootView</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.13.23-PM.png"><img class="alignnone size-large wp-image-5198" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.13.23-PM-1024x786.png" alt="Screen Shot 2015-11-23 at 2.13.23 PM" width="604" height="464" /></a></p>
<p>First, let’s try to create a the custom table root view. Open the <strong>CustomTableRootView.xib </strong>in Xcode Interface Builder.</p>
<h3>Adding the Docked View</h3>
<p>Drag a new <strong>View</strong> from the <strong>Object library</strong>, set the outlet as <strong>DockedView</strong>, and provide the following constraints:</p>
<ul>
<li><strong>Horizontal Space </strong><strong>Constraint</strong>: from <em>Superview.Trailing</em> equal to the <em>View.Trailing</em> with the following values.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.08-AM.png"><img class="alignnone size-large wp-image-5199" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.08-AM-1024x619.png" alt="Screen Shot 2015-11-23 at 11.28.08 AM" width="604" height="365" /></a></li>
<li><strong>Vertical Space Constraint</strong>: from <em>Superview.Bottom</em> equal to the <em>View.Bottom</em> with the following values.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.10-AM.png"><img class="alignnone size-large wp-image-5200" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.10-AM-1024x619.png" alt="Screen Shot 2015-11-23 at 11.28.10 AM" width="604" height="365" /></a></li>
<li><strong>Horizontal Space Constraint</strong>: from <em>DockedView.Leading</em> equal to the <em>Superview.Leading</em> with the following values.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.12-AM.png"><img class="alignnone size-large wp-image-5201" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-11.28.12-AM-1024x619.png" alt="Screen Shot 2015-11-23 at 11.28.12 AM" width="604" height="365" /></a></li>
</ul>
<p>Now that the docked view is ready, let’s drag a <strong>Label</strong>, set the outlet as <strong>TxtHeader</strong>, and drag a button, set the outlet as <strong>BthHeader</strong>. Both of them are given the previous outlet names, so that no code changes will be required in the <strong>BindingProvider</strong> side. If you wish, you can set the following constraints:</p>
<ul>
<li>Give the DockedView a height of 45.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-1.05.53-PM.png"><img class="alignnone size-large wp-image-5202" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-1.05.53-PM-1024x619.png" alt="Screen Shot 2015-11-23 at 1.05.53 PM" width="604" height="365" /></a></li>
<li>Vertically align the label as well as the button.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.19.44-PM.png"><img class="alignnone size-large wp-image-5203" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.19.44-PM-1024x774.png" alt="Screen Shot 2015-11-23 at 2.19.44 PM" width="604" height="457" /></a></li>
<li>Give an inner padding of 20.<br />
<a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.20.49-PM.png"><img class="alignnone size-large wp-image-5204" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.20.49-PM-1024x767.png" alt="Screen Shot 2015-11-23 at 2.20.49 PM" width="604" height="452" /></a></li>
</ul>
<p>That’s pretty much it. Let’s modify the View a bit.</p>
<h2>Modifying the View</h2>
<p>Let’s open the <strong>CustomTableRootView.cs </strong>and modify that a bit by adding a new <strong>ResizeTableView</strong> method.</p><pre class="crayon-plain-tag">using System;
using System.Drawing;
using System.Linq;
using CoreGraphics;
using Foundation;
using UIKit;

namespace HeaderAndFooter.iOS
{
    public partial class CustomTableRootView : UIView
    {
        #region Constructors

        public CustomTableRootView(IntPtr handle) : base(handle)
        {
        }

        #endregion

        #region Fields

        public static readonly UINib Nib = UINib.FromName("CustomTableRootView", NSBundle.MainBundle);

        #endregion

        #region Methods

        public static CustomTableRootView Create()
        {
            return (CustomTableRootView) Nib.Instantiate(null, null)[0];
        }


        internal void ResizeTableView(nfloat top)
        {
            var tableView = this.Subviews.FirstOrDefault(o =&gt; o is UITableView);
            tableView.Frame = new CGRect(0, top, tableView.Bounds.Width, this.Bounds.Height - top - this.DockedView.Bounds.Height);
        }

        #endregion
    }
}</pre><p>Here, we prepare a handy method to resize the table view when the view is used, called <strong>ResizeTableView</strong>. By calling this method, the <strong>TableView</strong> that contains this dock view will have its bounds re-adjusted. This is done so that the scrolling container in the <strong>TableView</strong> does not exceed the docked view. Take a closer a look at the contents of the method.</p>
<p>In line 36, we first search for the TableView that is added as a subview of the <strong>ViewController</strong>. In line 37, we set a new bounds for it, not changing the width at all, but just by adjusting the height by taking account the <strong>DockedView.Bounds.Height</strong> as well.</p>
<h2>Modifying the View Controller</h2>
<p>Next, open up the <strong>MainViewController.cs</strong>. Here’s the contents.</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;MainViewModel&gt;
    {
        #region Properties

        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; }
        }

        public override bool UseCustomRootView
        {
            get { return true; }
        }

        #endregion

        #region Methods

        protected override void InitializeView()
        {
            base.InitializeView();

            // set navigation title
            this.NavigationItem.Title = "Crosslight App";
        }

        protected override UIView GetCustomRootView()
        {
            return CustomTableRootView.Create();
        }

        public override void ViewWillLayoutSubviews()
        {
            base.ViewWillLayoutSubviews();

            // adjust tableview frame based on top layout guide	
            ((CustomTableRootView)this.View).ResizeTableView(this.TopLayoutGuide.Length);
        }

        #endregion
    }
}</pre><p>Here, we removed the overridden property for <strong>HeaderViewTemplate</strong>, since we’re going to use the new <strong>DockedView</strong> to replace the header. Therefore, we then override a new property called <strong>UseCustomRootView</strong> and return true.</p>
<p>After we&#8217;ve done that, we then override the <strong>GetCustomRootView()</strong> method to return the CustomTableRootView that we’ve just created by calling <strong>CustomTableRootView.Create()</strong>;</p>
<blockquote><p>The custom root view is one of the unique features introduced in Crosslight&#8217;s advanced <a href="http://developer.intersoftsolutions.com/display/crosslight/iOS+Table+View">UITableViewController</a>. It allows you to easily replace the root view with a custom one with just a few property sets, while still retaining the developer experience and automatic binding feature. In the case above, when <strong>UseCustomRootView</strong> is returning a true value, the <strong>GetCustomRootView</strong> method will be automatically called when the controller is initializing.</p></blockquote>
<p>Lastly, we override the <strong>ViewWillLayoutSubviews</strong> method. This method is called when a new subview is added to the <strong>ViewController</strong>, which can be done at any time, whether during <strong>ViewController</strong> creation or programmatically adding a subview at runtime, therefore, when the <strong>DockedView</strong> is added, we then call our handy method to resize the TableView so that the scrolling container wouldn’t “bleed” past the <strong>DockedView</strong>.</p>
<p>That’s it. Run the project and you should get the result similar to the following video.</p>
<div style="width: 400px; " class="wp-video"><video class="wp-video-shortcode" id="video-5182-5" width="400" height="360" loop="1" autoplay="1" preload="auto" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS1.mp4?_=5" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS1.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS1.mp4</a></video></div>
<h1>Creating dockable view on Android</h1>
<p>Now that we’ve finished the iOS version, let’s create the Android version. To create the docakble view on Android, you’ll need to complete the following:</p>
<ul>
<li>Preparing custom layout</li>
<li>Replacing the content layout in Activity</li>
</ul>
<h2>Preparing custom layout</h2>
<p>First things first, let’s create a new Android Layout, and let’s name it <strong>CustomLayout.axml</strong>. To do this, right click on the <strong>HeaderAndFooter.Android/Resources/layout</strong> folder.</p>
<p><img class="alignnone size-full wp-image-5208" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.47.11-PM.png" alt="Screen Shot 2015-11-23 at 2.47.11 PM" width="952" height="516" /></p>
<p>Select <strong>Add</strong>, <strong>New Item</strong>. Under <strong>Android</strong>, select <strong>Layout</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.47.50-PM.png"><img class="alignnone size-large wp-image-5209" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-23-at-2.47.50-PM-1024x785.png" alt="Screen Shot 2015-11-23 at 2.47.50 PM" width="604" height="463" /></a></p>
<p>Provide the layout for the <strong>CustomLayout.axml</strong> as follows.</p><pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
    &lt;LinearLayout
        android:id="@+id/Footer"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="vertical"&gt;
        &lt;LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="1px"
            android:background="#f2f2f2" /&gt;
        &lt;LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:paddingLeft="20dp"
            android:paddingRight="20dp"&gt;
            &lt;TextView
                android:id="@+id/TxtHeader"
                android:layout_width="fill_parent"
                android:layout_height="30dp"
                android:layout_weight="1"
                android:gravity="left"
                android:textSize="20sp" /&gt;
            &lt;Button
                android:id="@+id/BtnHeader"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" /&gt;
        &lt;/LinearLayout&gt;
    &lt;/LinearLayout&gt;
    &lt;ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@id/Footer" /&gt;
&lt;/RelativeLayout&gt;</pre><p>Let’s take a closer look. Here, we’ve used a <strong>RelativeLayout</strong> as the root <strong>ViewGroup </strong>and we’ve added 2 major elements to the <strong>RelativeLayout</strong>, which is a <strong>LinearLayout</strong> that will act as our <strong>DockedView</strong> and <strong>ListView</strong>.</p>
<blockquote><p>At a glance, you might be wondering why the <strong>ListView</strong> is defined after the <strong>LinearLayout</strong>. This is purely for build purposes. The XML parser parses the text from top to bottom. Since in the <strong>ListView</strong>, we’ve defined<strong> android:layout_above=“@id/Footer”,</strong> the build will fail if the LinearLayout is not defined beforehand. Hence, the <strong>ListView</strong> is defined after the <strong>LinearLayout</strong>.</p></blockquote>
<p>One important thing to notice that the <strong>ListView’s</strong> id is set to<strong> @android:id/list</strong>. This conforms the standard method to override the built-in ListActivity&#8217;s layout in native Android development itself. For more information on that topic, click <a href="http://developer.android.com/reference/android/app/ListActivity.html" target="_blank">here</a>. This is done because in the <strong>ListActivity</strong> class, you can reference the <strong>ListView</strong> as simply as calling <strong>this.ListView</strong>, however since you’ve overridden the whole layout, then the <strong>ListView</strong> must be re-referenced this way so that the Android understands. Everything else is just standard Android layouting process.</p>
<h2>Replacing the content layout in Activity</h2>
<p>After the layout is prepared, let’s modify some codes in the Activity. Open up <strong>MainActivity.cs</strong> inside <strong>HeaderAndFooter.Android/Activities</strong> folder and see the contents as follows.</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;MainViewModel&gt;
    {
        #region Properties

        protected override int ContentLayoutId
        {
			get { return Resource.Layout.CustomLayout; }
        }

        protected override int FooterLayoutId
        {
            get { return Resource.Layout.CustomFooter; }
        }

        public override ListViewInteraction InteractionMode
        {
            get { return ListViewInteraction.Navigation; }
        }

        #endregion

        #region Methods

        protected override void InitializeView()
        {
            base.InitializeView();

            this.RegisterViewIdentifier("TableView", this.ListView);
        }

        #endregion
    }
}</pre><p>In the <strong>ContentLayoutId </strong>property, we’ve replaced the old layout to the new <strong>CustomLayout</strong> that we’ve created earlier and we’ve also removed the <strong>HeaderLayoutId</strong>. You’ve completed the Android version. Let’s run this project and you should get the result similar to the following.</p>
<div style="width: 400px; " class="wp-video"><video class="wp-video-shortcode" id="video-5182-6" width="400" height="360" loop="1" autoplay="1" preload="auto" controls="controls"><source type="video/mp4" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android1.mp4?_=6" /><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android1.mp4">http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android1.mp4</a></video></div>
<h1>Wrapping Up</h1>
<p>You’ve seen how easy and elegant it is to provide a dockable view to your table view on iOS as well as list view on Android. Achieving the same task without Crosslight would be really tedious and time consuming. The dockable view also comes with automatic binding support, so you can take advantage of native binding process with whatever layout you have. Nice and simple.</p>
<p>You can find the code to the sample here:<br />
<a href="http://git.intersoftsolutions.com/projects/CT/repos/crosslightdockableview/browse" target="_blank">http://git.intersoftsolutions.com/projects/CT/repos/crosslightdockableview/browse</a>. To use this sample, you’ll need at least <a href="http://git.intersoftsolutions.com/projects/CROS/repos/updates/browse/Crosslight4_0_5000_323" target="_blank">Crosslight build 4.0.5000.323</a> and above.</p>
<p>See you in the next post,<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/11/creating-dockable-view-for-ios-and-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/iOS1.mp4" length="668912" type="video/mp4" />
<enclosure url="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Android1.mp4" length="305590" 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;" /><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-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/iOS-header-footer.mp4?_=7" /><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-8" 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?_=8" /><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 Form Builder</title>
		<link>http://blog.intersoftsolutions.com/2015/11/getting-started-with-crosslight-form-builder/</link>
		<comments>http://blog.intersoftsolutions.com/2015/11/getting-started-with-crosslight-form-builder/#comments</comments>
		<pubDate>Mon, 09 Nov 2015 07:04:40 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[kb-how-to-article]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=4873</guid>
		<description><![CDATA[After we’ve improved our customer experience several months ago, we’ve started receiving many great feedbacks from you, our valued customers. One of the feedback that we received is how to get started with the Crosslight Form Builder. We then realized that this feature is a [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/FormBuilder.001-604x270.jpeg" class="attachment-post-thumbnail wp-post-image" alt="FormBuilder.001" style="float:right; margin:0 0 10px 10px;" /><p>After we’ve <a href="http://blog.intersoftsolutions.com/2015/10/introducing-intersofts-new-customer-experience/" target="_blank">improved our customer experience</a> several months ago, we’ve started receiving many great feedbacks from you, our valued customers. One of the feedback that we received is how to get started with the Crosslight Form Builder. We then realized that this feature is a “hidden gem” supported in Crosslight, and most of our customers didn’t realize of its tremendous value in creating functional forms in a very short time. This post will help you learn more about the Crosslight Form Builder and get started.</p>
<h1>What is Crosslight Form Builder?</h1>
<p>Crosslight Form Builder is a built-in cross-platform form bulider framework that helps developers to create native forms easily with UI aesthetics that conforms to each platform’s user interface guidelines. The metadata definiton itself is shared amongst other platforms as well, resulting in a clean, functional form in minutes.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/1446436054_full1.png" target="_blank"><img class="aligncenter" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/1446436054_thumb1.png" alt="" width="700" align="middle" /></a></p>
<p>Several features of the Crosslight Form Builder:</p>
<ul>
<li>Simple, metadata-based form</li>
<li>Intuitive section and property definitions</li>
<li>Built-in validation support</li>
<li>Customizable appearance</li>
<li>Cross-platform native forms on iOS, Android and Windows Phone.</li>
<li>Customizable behaviors</li>
<li>Functional forms in 5 minutes.</li>
</ul>
<h1>Creating a driver pickup form</h1>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/FormBuilder.001.jpeg"><img class="alignnone size-large wp-image-4960" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/FormBuilder.001-1024x768.jpeg" alt="FormBuilder.001" width="604" height="453" /></a></p>
<p>To demonstrate Crosslight Form Builder capabilities, we will create a simple taxi order form, which consists of two sections: <strong>Passenger Details</strong> and <strong>Taxi Choice</strong>. In <strong>Passenger Details</strong>, we’ll have two form fields: <strong>Name</strong> and <strong>Pickup Time</strong> whereas in <strong>Taxi Choice</strong> we’ll have <strong>Car Type</strong> and <strong>Airport</strong> choices. In overall, our form structure looks like this:</p>
<ul>
<li>Passenger Details
<ul>
<li>Name</li>
<li>Pickup Time</li>
</ul>
</li>
<li>Taxi Choice
<ul>
<li>Car Type</li>
<li>Airport</li>
</ul>
</li>
</ul>
<p>Now that we have our form fields, how can we translate that form using Form Builder?</p>
<h1>Readying the project</h1>
<p>As always, let’s start off from the Blank project created using Crosslight Project Wizard. Let’s name this project as <strong>CrosslightFormBuilder.</strong></p>
<h2>Creating the form metadata</h2>
<p>As we have established earlier, you need to create 2 sections, with 2 property each. And that’s exactly how our form metadata looks like. Let’s create a new Model file that will contain our model as well as the form metadata. I’m going to give it a name of <em>Order.cs</em> and place it under <em>CrosslightFormBuilder.Core/Models</em> folder. Let’s begin by creating the model.</p><pre class="crayon-plain-tag">public class Order : ModelBase
{
    #region Fields

    private CarType _carType;
    private bool _isAirport;
    private string _name;
    private DateTime _pickupTime;

    #endregion

    #region Properties

    public CarType CarType
    {
        get { return _carType; }
        set
        {
            if (_carType != value)
            {
                _carType = value;
                OnPropertyChanged("CarType");
            }
        }
    }

    public bool IsAirport
    {
        get { return _isAirport; }
        set
        {
            if (_isAirport != value)
            {
                _isAirport = value;
                OnPropertyChanged("IsAirport");
            }
        }
    }

    public string Name
    {
        get { return _name; }
        set
        {
            if (_name != value)
            {
                _name = value;
                OnPropertyChanged("Name");
            }
        }
    }

    public DateTime PickupTime
    {
        get { return _pickupTime; }
        set
        {
            if (_pickupTime != value)
            {
                _pickupTime = value;
                OnPropertyChanged("PickupTime");
            }
        }
    }

    #endregion
}</pre><p>The <em>Order</em> model derive from <em>ModelBase </em>that is shipped by default in project creation using Crosslight Project Wizard. This class contains the necessary implementations that automatically implements <em>INotifyPropertyChanged</em>, <em>INotifyDataErrorInfo</em>, as well as <em>IDataValidation</em> needed for binding and validation purposes.</p>
<p>All you need is to provide the necessary properties, as shown in the code above, and don&#8217;t forget to trigger the <em>OnPropertyChanged</em> method in the property setter to reflect data changes to the UI. This is the standard <a href="https://msdn.microsoft.com/en-us/library/ff798384.aspx">MVVM-enabled property</a> that is required for data binding to work properly.</p>
<p>Next up, let&#8217;s create the form metadata definition. Still in the same file, first we need to create the sections. Simply prepare two classes that will act as the sections. We&#8217;ll call this <strong>PassengerDetailsSection</strong> and <strong>TaxiChoiceSection</strong>.</p><pre class="crayon-plain-tag">public class PassengerDetailsSection
{
    #region Fields

    [Display(Caption = "Name")]
    [Editor(EditorType.AutoDetect)]
    [Layout(Style = LayoutStyle.RightDetail)]
    public string Name;

    [Display(Caption = "Pickup Time")]
    [Editor(EditorType.DateTime)]
    [Layout(Style = LayoutStyle.RightDetail)]
    [Binding(StringFormat = "{0:d MMM, HH:mm}", Mode = BindingMode.TwoWay)]
    public DateTime PickupTime;

    #endregion
}</pre><p></p><pre class="crayon-plain-tag">public class TaxiChoiceSection
{
    #region Fields

    [Display(Caption = "Car Type")]
    [Editor(EditorType.AutoDetect)]
    [Layout(Style = LayoutStyle.RightDetail)]
    public CarType CarType;

    [Display(Caption = "Airport?")]
    [Editor(EditorType.Switch)]
    [Layout(Style = LayoutStyle.RightDetail)]
    public bool IsAirport;

    #endregion
}</pre><p>Take a look at the code above. It is recommended that fields definitions has the same name as your property to be able to perform binding automatically. There are many attributes that you can choose from to decorate each fields. You can easily customize the appearance, layout, behavior, editor to use, interactivity, binding, and more. If you would like to explore them all, check out these articles:</p>
<ul>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Supported+Editor+Types">Supported Editor Types</a></li>
<li><a href="http://developer.intersoftsolutions.com/display/crosslight/Configuring+Editor+Behaviors">Configuring Editor Behaviors</a></li>
</ul>
<p>Also, if you notice, we have defined an enum for the car type. Form Builder automatically supports the use of enums in the form, so you don&#8217;t have to create the picker for it. Simply define the editor as <em>AutoDetect</em> and it will create the appropriate editor automatically.</p>
<p>The <em>CarType</em> enum is defined inside the <em>CrosslightFormBuilder.Core/Models</em> folder and is simply defined as follows.</p><pre class="crayon-plain-tag">public enum CarType
{
    Standard,
    Executive
}</pre><p>Now that you have both sections ready, simply create the form by using the following code. Let&#8217;s call this <em>OrderFormMetadata</em>.</p><pre class="crayon-plain-tag">[Form(Title = "Order Form")]
public class OrderFormMetadata
{
    #region Fields
    
    [Section(Header = "Passenger Details")]
    public PassengerDetailsSection PassengerDetails;

    [Section(Header = "Taxi Choice")]
    public TaxiChoiceSection TaxiChoiceSection;

    #endregion
}</pre><p>The <em>OrderFormMetadata </em>class also contains the fields with the section class types we&#8217;ve previously defined. You can also adjust the section header by decorating the fields with the <em>SectionAttribute </em>and fill out the <em>Header </em>property. You can also automatically set the title of the form with any caption you like. In this case, I&#8217;ll just simply define it as &#8220;Order Form&#8221;. This will displayed on top of the navigation controller on iOS, and Activity title on Android.</p>
<h2>Creating the ViewModel</h2>
<p>Just like any other MVVM apps, you will need to create the <em>ViewModel</em> layer that holds the business logic for the view. To do this, simply create a new <em>OrderViewModel</em> class file inside the <em>CrosslightFormBuilder.Core/ViewModels</em> folder. Its content are as follows.</p><pre class="crayon-plain-tag">#region Usings

using System;
using System.Text;
using Intersoft.Crosslight;
using Intersoft.Crosslight.Input;
using Intersoft.Crosslight.ViewModels;

#endregion

namespace CrosslightFormBuilder.Core.ViewModels
{
    public class OrderViewModel : EditorViewModelBase&lt;Order&gt;
    {
        #region Properties

        /// &lt;summary&gt;
        /// Gets the type of the form metadata associated to the editor.
        /// &lt;/summary&gt;
        /// &lt;value&gt;
        /// The type of the form metadata.
        /// &lt;/value&gt;
        public override Type FormMetadataType
        {
            get { return typeof(OrderFormMetadata); }
        }

        #endregion

        #region Methods

        /// &lt;summary&gt;
        /// Executes the save command.
        /// &lt;/summary&gt;
        /// &lt;param name="parameter"&gt;Parameter.&lt;/param&gt;
        protected override void ExecuteSave(object parameter)
        {
            this.Validate();

            if (!this.HasErrors)
            {
                StringBuilder passengerDetails = new StringBuilder();
                passengerDetails.Append("Name: " + this.Item.Name + "\n");
                passengerDetails.Append("Pickup Time: " + this.Item.PickupTime + "\n");
                passengerDetails.Append("Going to the airport? " + this.Item.IsAirport + "\n");
                passengerDetails.Append("Car Type: " + this.Item.CarType);

                this.MessagePresenter.Show(passengerDetails.ToString(), "Confirm Order", new[] {"Yes", "No"}, selection =&gt;
                {
                    if (selection == 0) //Yes
                    {
                        this.ToastPresenter.Show("Your order has been placed.");
                    }
                    else
                    {
                        this.ToastPresenter.Show("You cancelled the order.");
                    }
                });
            }
            else
            {
                this.MessagePresenter.Show(this.ErrorMessage);
            }

        }
        

        /// &lt;summary&gt;
        /// Called when this instance is navigated.
        /// &lt;/summary&gt;
        /// &lt;param name="parameter"&gt;Parameter.&lt;/param&gt;
        public override void Navigated(NavigatedParameter parameter)
        {
            base.Navigated(parameter);

            this.Item = new Order();
            this.Item.PickupTime = DateTime.Now;
        }

        #endregion
    }
}</pre><p>Let&#8217;s take it slowly from above. First things first, to use the Crosslight Form Builder, it&#8217;s highly recommended to use our built-in <em>EditorViewModelBase&lt;TModel&gt;</em> as this <em>ViewModel</em> holds the important data operations that can be done automatically at the background, such as performing save and validation, which we&#8217;ll explore in just a moment.</p>
<p>In the <em>ViewModel</em>, we&#8217;ve also overridden the <em>FormMetadataType</em> property. This will tell the Form Builder which class holds the <em>FormAttribute</em> that will act as the form.</p>
<p>In the next section, we&#8217;ve also overridden the <em>ExecuteSave</em> method. Inside the method, you&#8217;ll see that we&#8217;ve called the <em>Validate</em> method. This will validate the form with the conditions we&#8217;ve specified as our form validation. We&#8217;ll discuss the form validation in the next section. Next, if the form has no errors, then we can proceed with our business logic. In this case, I&#8217;m going to display the inputted data and display them using Crosslight Message Presenter. So when the <strong>Done </strong>button is pressed, the <em>ExecuteSave</em> method will be called.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/FormBuilder.002.jpeg"><img class="alignnone size-large wp-image-4961" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/FormBuilder.002-1024x768.jpeg" alt="FormBuilder.002" width="604" height="453" /></a></p>
<p>Last but not least, we&#8217;ve also instantiated our <em>Order</em> model as new item for the Form Builder.</p>
<h1>Enabling form validation</h1>
<p>To enable form validation, there are several things to be done. First, open up the model file. In our <em>Order</em> model, override the <em>Validate</em> method.</p><pre class="crayon-plain-tag">public override void Validate()
{
    base.Validate();
    this.ClearAllErrors();

    if (string.IsNullOrEmpty(this.Name))
        this.SetError("Please enter your name.", "Name required");
}</pre><p>Here, we set the error when the user did not enter their name in the form. The <em>ClearAllErrors</em> method should be called to reset the validation state. If any of the validation hits the condition, then <em>SetError</em> will be called, which in turn be displayed using Message Presenter that we&#8217;ve defined previously in <em>ExecuteSave</em> method.</p><pre class="crayon-plain-tag">protected override void ExecuteSave(object parameter)
{
    this.Validate();

    if (!this.HasErrors)
    {
        ...
    }
    else
    {
        this.MessagePresenter.Show(this.ErrorMessage);
    }
}</pre><p>This is why it&#8217;s very important to use the built-in <em>EditorViewModelBase</em> shipped with Crosslight, since Crosslight has taken care of these details in the background, leaving you to focus only on your business logic.</p>
<h1>Creating the Views</h1>
<p>After you&#8217;re done set the M and VM in MVVM, let&#8217;s set up the Vs. We&#8217;ll proceed by creating the Views on iOS and Android that consumes the ViewModel. Right click on the <strong>ViewController</strong> folder in <strong>CrosslightFormBuilder.iOS</strong> project and choose <strong>Add</strong>, <strong>New File</strong>.</p>
<p><img class="alignnone size-full wp-image-5297" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-25-at-11.16.42-PM.png" alt="Screen Shot 2015-11-25 at 11.16.42 PM" width="1098" height="428" /></p>
<p>In the dialog that appears, choose <strong>Crosslight</strong> and select <strong>Crosslight iOS Form View Controller</strong>. Give it a name of <strong>OrderViewController</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-25-at-11.33.37-PM.png"><img class="alignnone size-large wp-image-5301" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-25-at-11.33.37-PM-1024x777.png" alt="Screen Shot 2015-11-25 at 11.33.37 PM" width="604" height="458" /></a></p>
<p>In the newly created <strong>OrderViewController.cs</strong> file, simply specify the <em>TViewModel</em> as <strong>OrderViewModel</strong> that you&#8217;ve just created and remove this line.</p><pre class="crayon-plain-tag">[ImportBinding (typeof(TBindingProvider))]</pre><p>The <strong>ImportBindingAttribute</strong> is used only when you want to add additional bindings to the form, which we&#8217;re not going to use in this scenario.</p>
<p>In addition, the <strong>DetermineNavigationMode</strong> overload method and the preferred content size can be completely removed since our app is not targeting iPad.</p>
<p>Here&#8217;s the final content of the <strong>OrderViewController.cs.</strong></p><pre class="crayon-plain-tag">using CrosslightFormBuilder.Core.ViewModels;
using Intersoft.Crosslight.iOS;

namespace CrosslightFormBuilder.iOS.ViewControllers
{
    [Register("OrderViewController")]
    public class OrderViewController : UIFormViewController&lt;OrderViewModel&gt;
    {
    }
}</pre><p>As seen above, it&#8217;s really only a simple class definition remaining since all the heavy lifting is done by the <strong>UIFormViewController</strong> class itself.</p>
<p>You&#8217;ve finished the iOS views. Let&#8217;s move on to Android.</p>
<p>Begin by right clicking on the <strong>Activities</strong> folder in the <strong>CrosslightFormBuilder.Android</strong> project. Select <strong>Add</strong>, <strong>New File</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-25-at-11.31.17-PM.png"><img class="alignnone size-large wp-image-5299" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-25-at-11.31.17-PM-1024x305.png" alt="Screen Shot 2015-11-25 at 11.31.17 PM" width="604" height="180" /></a></p>
<p>&nbsp;</p>
<p>In the preceding dialog, select <strong>Crosslight</strong>, then <strong>Crosslight Android Form Activity</strong>, give it a name of <strong>OrderActivity</strong>.</p>
<p>Similar to iOS, remove this line</p><pre class="crayon-plain-tag">[ImportBinding (typeof(TBindingProvider))]</pre><p>And set the <em>TViewModel</em> to <strong>OrderViewModel</strong>. Since we&#8217;ll not be using any binding providers for now. If you notice in the <strong>OrderActivity.cs</strong> file we have just created, we have these codes.</p><pre class="crayon-plain-tag">protected override int MenuLayoutId {
    get { return Resource.Menu.editing_actions_id; }
}</pre><p>This means we need to provide the action bar options to be used with the Activity. This defines the actions that resides in the Action Bar of Android Activity, usually located on the top right hand corner of the screen. In this case, we want to set it as the <strong>Save</strong> button. To do that, right-click on the <strong>Resource/layout</strong> folder in the <strong>CrosslightFormBuilder.Android</strong> project. Click <strong>Add</strong>, <strong>New File</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-25-at-11.55.02-PM.png"><img class="alignnone size-large wp-image-5302" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-25-at-11.55.02-PM-1024x249.png" alt="Screen Shot 2015-11-25 at 11.55.02 PM" width="604" height="147" /></a></p>
<p>&nbsp;</p>
<p>From the dialog, select <strong>Android</strong>, <strong>Layout</strong>. Give it a name of <strong>actionbareditinglayout</strong>.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-25-at-11.56.04-PM.png"><img class="alignnone size-large wp-image-5303" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Screen-Shot-2015-11-25-at-11.56.04-PM-1024x776.png" alt="Screen Shot 2015-11-25 at 11.56.04 PM" width="604" height="458" /></a></p>
<p>Use the following code.</p><pre class="crayon-plain-tag">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;item
        android:id="@+id/SaveButton"
        android:title="@string/Save"
        android:showAsAction="ifRoom|withText" /&gt;
&lt;/menu&gt;</pre><p>On the 5th line, you&#8217;ll see @string/Save. This corresponds to the key of the string value that&#8217;s located inside the <strong>strings.xml</strong> file. You can find this file inside the <strong>Resources/values</strong> folder. Simply add this line as a child of the <em>resources</em> node.</p><pre class="crayon-plain-tag">&lt;string name="Save"&gt;Done&lt;/string&gt;</pre><p>Back to the <strong>OrderActivity.cs</strong>, we can now use the new layout that we&#8217;ve created as <em>MenuLayoutId</em> so that it&#8217;ll appear on the ActionBar. Change it to</p><pre class="crayon-plain-tag">protected override int MenuLayoutId
{
    get { return Resource.Layout.actionbareditinglayout; }
}</pre><p>You&#8217;re done with the views. One last thing before running the project.</p>
<h1>Setting the Root ViewModel</h1>
<p>Since you have everything ready, the last thing to do is tell the app which ViewModel to use as the root ViewModel. To do this, open up <strong>AppService.cs</strong> located inside <strong>CrosslightFormBuilder.Core/Infrastructure</strong> folder. In the OnStart method, change the root ViewModel to OrderViewModel.</p><pre class="crayon-plain-tag">protected override void OnStart(StartParameter parameter)
{
    base.OnStart(parameter);
    this.SetRootViewModel&lt;OrderViewModel&gt;();
}</pre><p>You&#8217;re now ready to run the project. See that the validation works as well. Here&#8217;s how it looks like when the user hit the <strong>Done</strong> button and no <em>Name</em> is entered.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/FormBuilder.003.jpeg"><img class="alignnone size-large wp-image-4963" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/FormBuilder.003-1024x768.jpeg" alt="FormBuilder.003" width="604" height="453" /></a></p>
<h1>A deeper look at the result</h1>
<p>Let&#8217;s take a deeper look at the resulting form created with Crosslight Form Builder. As you might have already noticed, the forms generated by Crosslight Form Builder are unlike any other. With Crosslight Form Builder, in just minutes, developers can easily build gorgeous-looking forms and provides the best user experience with mobile forms.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Form-Builder.004.jpeg"><img class="alignnone size-large wp-image-4967" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/Form-Builder.004-1024x768.jpeg" alt="Form Builder.004" width="604" height="453" /></a></p>
<p>Just look at the screenshot above. The date time picker resulted from Crosslight Form Builder displays native inline iOS date picker, and the native Android date time picker as well.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/FormBuilder.005.jpeg"><img class="alignnone size-large wp-image-4971" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/11/FormBuilder.005-1024x768.jpeg" alt="FormBuilder.005" width="604" height="453" /></a></p>
<p>Not only that, take a look at the automatic enum picker provided by Crosslight Form Builder. In Android, it shows a modal dialog with the choices, and on iOS, it performs push navigation that allows the user to choose between the choices. iOS users and Android users will definitely appreciate this native behavior exhibited by the form.</p>
<p>Creating this definition takes only minutes, saving you lots of time and money on development and implementation, while still providing ultra-great user experience. Other cross-platform frameworks might offer quick-and-dirty solution to the date time picker by showing small modal dialogs that hardly complies with each platforms UI guidelines. This is the power of the Crosslight Form Builder.</p>
<h1>Where to go from here?</h1>
<p>After you&#8217;ve completed this short tutorial blog post, I would definitely recommend you to jump in to the <em>FormBuilderSamples</em>, where you can easily explore various editors Form Builder can support as well as various customizability for each editor with different layouts as well. Check out the Form Builder Samples <a href="http://developer.intersoftsolutions.com/display/crosslight/Form+Builder+Samples">here</a>.</p>
<h1>Summing up</h1>
<p>I hope this post helps you to learn Crosslight Form Builder and get started with it. In the next post, I&#8217;ll enhance the Form Builder to add minimum value to the Pickup Time as well as extending the Form Builder with our own custom views, complete with binding capabilities.</p>
<p>You can find the source files for this project in our Git repository here: <a href="http://git.intersoftsolutions.com/projects/CT/repos/crosslightformbuilder/browse">http://git.intersoftsolutions.com/projects/CT/repos/crosslightformbuilder/browse</a>.</p>
<p>To learn more about the Crosslight Form Builder, check out these links in the Developer Center:<a title="Building Rich Data Entry Form" href="http://developer.intersoftsolutions.com/display/crosslight/Building+Rich+Data+Entry+Form" target="_blank"><br />
</a></p>
<ul>
<li><a title="" href="http://developer.intersoftsolutions.com/display/crosslight/Building+Rich+Data+Entry+Form" target="_blank">Building Rich Data Entry Form</a></li>
<li><a title="" href="http://developer.intersoftsolutions.com/display/crosslight/Form+Builder+Overview" target="_blank">Form Builder Overview</a></li>
<li><a title="" href="http://developer.intersoftsolutions.com/display/crosslight/Supported+Editor+Types" target="_blank">Supported Editor Types</a></li>
<li><a title="" href="http://developer.intersoftsolutions.com/display/crosslight/Configuring+Editor+Behaviors" target="_blank">Configuring Editor Behaviors</a></li>
<li><a title="" href="http://developer.intersoftsolutions.com/display/crosslight/Enabling+Form+Interactivity" target="_blank">Enabling Form Interactivity</a></li>
<li><a title="" href="http://developer.intersoftsolutions.com/display/crosslight/Extending+Form+Builder" target="_blank">Extending Form Builder</a></li>
<li><a title="" href="http://developer.intersoftsolutions.com/display/crosslight/Form+Metadata+Example" target="_blank">Form Metadata Example</a></li>
<li><a title="" href="http://developer.intersoftsolutions.com/display/crosslight/Presenting+a+Form+with+EditorViewModel" target="_blank">Presenting a Form with EditorViewModel</a></li>
</ul>
<p>Should you have any questions, feel free to <a href="http://www.intersoftsolutions.com/Crosslight#livechat" target="_blank">initiate a live chat session</a> with us on our website, or, leave your comments below and let me know what you think!</p>
<p>See you in the next post!<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/11/getting-started-with-crosslight-form-builder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implement GridViewFragment on Android</title>
		<link>http://blog.intersoftsolutions.com/2015/03/implement-gridviewfragment-on-android/</link>
		<comments>http://blog.intersoftsolutions.com/2015/03/implement-gridviewfragment-on-android/#comments</comments>
		<pubDate>Wed, 25 Mar 2015 09:42:32 +0000</pubDate>
		<dc:creator><![CDATA[martinlie]]></dc:creator>
				<category><![CDATA[2014-r2]]></category>
		<category><![CDATA[intersoft-blog]]></category>
		<category><![CDATA[kb-how-to-article]]></category>
		<category><![CDATA[Reference Samples]]></category>

		<guid isPermaLink="false">http://blog.intersoftpt.com/?p=4441</guid>
		<description><![CDATA[This topic describes how you can easily display your data in a grid view for Android in Crosslight apps. You will learn how to configure GridFragment and create the binding provider for GridFragment. If you haven&#8217;t familiar with simple list in Crosslight, please check out Displaying Simple List. It is expected [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/03/Tablet-604x270.jpg" class="attachment-post-thumbnail wp-post-image" alt="Tablet" style="float:right; margin:0 0 10px 10px;" /><p>This topic describes how you can easily display your data in a grid view for Android in Crosslight apps. You will learn how to configure GridFragment and create the binding provider for GridFragment. If you haven&#8217;t familiar with simple list in Crosslight, please check out <a href="http://developer.intersoftpt.com/display/crosslight/Displaying+Simple+List#DisplayingSimpleList-DisplayingSimpleListoniOS" target="_blank" rel="nofollow">Displaying Simple List</a>. It is expected that you have successfully displayed a simple list and created the required View Model before continuing. <a href="http://developer.intersoftpt.com/display/crosslight/Implement+GridViewFragment+on+Android" target="_blank">Learn more</a>.</p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/Phone.jpg"><img class="aligncenter wp-image-4444" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/Phone.jpg" alt="Android Phone" width="299" height="500" /></a></p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/Tablet.jpg"><img class="aligncenter wp-image-4445" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/Tablet.jpg" alt="Android Tablet" width="500" height="292" /></a></p>
<p>The sample code is available to download in our Git server <a href="http://git.intersoftpt.com/projects/CROS-SUPP/repos/android-gridview/browse" target="_blank">here</a>. Feel free to leave any comment or feedback.</p>
<p>Cheers,<br />
Martin Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/03/implement-gridviewfragment-on-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implement Circular Image on ListView</title>
		<link>http://blog.intersoftsolutions.com/2015/03/how-to-implement-circular-image-on-listview/</link>
		<comments>http://blog.intersoftsolutions.com/2015/03/how-to-implement-circular-image-on-listview/#comments</comments>
		<pubDate>Wed, 25 Mar 2015 09:19:11 +0000</pubDate>
		<dc:creator><![CDATA[martinlie]]></dc:creator>
				<category><![CDATA[2014-r2]]></category>
		<category><![CDATA[intersoft-blog]]></category>
		<category><![CDATA[kb-how-to-article]]></category>
		<category><![CDATA[Reference Samples]]></category>

		<guid isPermaLink="false">http://blog.intersoftpt.com/?p=4438</guid>
		<description><![CDATA[Nowadays, you can see a lot of mobile apps displaying circular image on list view. This how-to topic shows how you can customize the appearance and presentation of cell template with image in a table view to achieve round corner in iOS, Android and Windows platforms. Learn [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/03/circular-image-on-Android-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="circular-image-on-Android" style="float:right; margin:0 0 10px 10px;" /><p>Nowadays, you can see a lot of mobile apps displaying circular image on list view. This how-to topic shows how you can customize the appearance and presentation of cell template with image in a table view to achieve round corner in iOS, Android and Windows platforms. <a href="http://developer.intersoftpt.com/display/crosslight/Implement+Circular+Image+on+ListView" target="_blank">Learn more</a>.</p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/circular-image-on-iOS.png"><img class="aligncenter wp-image-4451" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/circular-image-on-iOS.png" alt="circular-image-on-iOS" width="301" height="500" /></a></p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/circular-image-on-Android.png"><img class="aligncenter wp-image-4450" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/circular-image-on-Android.png" alt="circular-image-on-Android" width="300" height="500" /></a></p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/circular-image-on-WinPhone.png"><img class="aligncenter wp-image-4439" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/circular-image-on-WinPhone.png" alt="circular-image-on-WinPhone" width="300" height="500" /></a></p>
<p>The sample code is available to download in our Git server <a href="http://git.intersoftpt.com/projects/CROS-SUPP/repos/listview-with-circular-image/browse" target="_blank">here</a>. Feel free to leave any comment or feedback.</p>
<p>Cheers,<br />
Martin Lie</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/03/how-to-implement-circular-image-on-listview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implement Data Synchronization using Crosslight Enterprise Framework</title>
		<link>http://blog.intersoftsolutions.com/2015/03/implement-data-synchronization-using-crosslight-enterprise-framework/</link>
		<comments>http://blog.intersoftsolutions.com/2015/03/implement-data-synchronization-using-crosslight-enterprise-framework/#comments</comments>
		<pubDate>Tue, 03 Mar 2015 09:03:54 +0000</pubDate>
		<dc:creator><![CDATA[martinlie]]></dc:creator>
				<category><![CDATA[2014-r2]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[intersoft-blog]]></category>
		<category><![CDATA[kb-how-to-article]]></category>
		<category><![CDATA[Reference Samples]]></category>

		<guid isPermaLink="false">http://blog.intersoftpt.com/?p=4405</guid>
		<description><![CDATA[This how-to topic describes how to implement data synchronization using Crosslight Enterprise Framework. There is no doubt that data synchronization has becoming essential requirement in today&#8217;s business apps that allows online offline synschronization. This post guides you how to implement data synchronization by creating a new [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/03/2015-03-02-09-34-09-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="2015-03-02-09-34-09" style="float:right; margin:0 0 10px 10px;" /><p>This how-to topic describes how to implement data synchronization using Crosslight Enterprise Framework. There is no doubt that data synchronization has becoming essential requirement in today&#8217;s business apps that allows online offline synschronization.</p>
<p>This post guides you how to implement data synchronization by creating a new Crosslight app from the <a href="http://developer.intersoftpt.com/display/crosslight/Business+Template">Crosslight Business Template</a>. You will learn how to enable the local data storage feature, configure the synchronization settings, preparing the domain models, and calling the synchronization API to perform two-way data sync. <a href="http://developer.intersoftpt.com/display/crosslight/Implement+Data+Synchronization+using+Crosslight+Enterprise+Framework" target="_blank">Learn more</a>.</p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/2015-03-02-09-34-09.png" target="_blank"><img class="aligncenter wp-image-4406" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/2015-03-02-09-34-09-622x1024.png" alt="2015-03-02-09-34-09" width="304" height="500" /></a></p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/2015-03-02-09-35-28.png" target="_blank"><img class="aligncenter wp-image-4407" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/2015-03-02-09-35-28-622x1024.png" alt="2015-03-02-09-35-28" width="304" height="500" /></a></p>
<p>You can download the sample code from our Git server <a href="http://git.intersoftpt.com/projects/CROS-SUPP/repos/synchronization-sample/browse" target="_blank">here</a>. Feel free to leave your comment or feedback if any.</p>
<p>Cheers,<br />
Martin Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/03/implement-data-synchronization-using-crosslight-enterprise-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Crosslight Business Apps with Local Data Storage (SQLite)</title>
		<link>http://blog.intersoftsolutions.com/2015/03/create-crosslight-business-apps-with-local-data-storage-sqlite/</link>
		<comments>http://blog.intersoftsolutions.com/2015/03/create-crosslight-business-apps-with-local-data-storage-sqlite/#comments</comments>
		<pubDate>Tue, 03 Mar 2015 08:14:18 +0000</pubDate>
		<dc:creator><![CDATA[martinlie]]></dc:creator>
				<category><![CDATA[2014-r2]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[intersoft-blog]]></category>
		<category><![CDATA[kb-how-to-article]]></category>
		<category><![CDATA[Reference Samples]]></category>

		<guid isPermaLink="false">http://blog.intersoftpt.com/?p=4402</guid>
		<description><![CDATA[This blog post shows you in-depth how to create apps that use SQLite as its local data storage using Crosslight Business Template. You will learn how to configure SQLite for the first time, setting up the domain model through Intersoft Entity Designer and add some [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/03/2015-03-02-09-29-43-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="2015-03-02-09-29-43" style="float:right; margin:0 0 10px 10px;" /><p>This blog post shows you in-depth how to create apps that use SQLite as its local data storage using Crosslight Business Template. You will learn how to configure SQLite for the first time, setting up the domain model through Intersoft Entity Designer and add some simple settings and code to enable SQLite. <a href="http://developer.intersoftpt.com/pages/viewpage.action?pageId=16812361" target="_blank">Learn more</a>.</p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/2015-03-02-09-29-43.png" target="_blank"><img class="aligncenter wp-image-4403" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/2015-03-02-09-29-43-622x1024.png" alt="2015-03-02-09-29-43" width="304" height="500" /></a></p>
<p>We have made the sample code available to be downloaded from out Git server <a href="http://git.intersoftpt.com/projects/CROS-SUPP/repos/sqlite-sample-businesstemplate/browse" target="_blank">here</a>. Feel free to post any comment or feedback.</p>
<p>Cheers,<br />
Martin Lie</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/03/create-crosslight-business-apps-with-local-data-storage-sqlite/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Crosslight SQLite for Local Data Storage</title>
		<link>http://blog.intersoftsolutions.com/2015/03/using-crosslight-sqlite-for-local-data-storage/</link>
		<comments>http://blog.intersoftsolutions.com/2015/03/using-crosslight-sqlite-for-local-data-storage/#comments</comments>
		<pubDate>Mon, 02 Mar 2015 09:36:45 +0000</pubDate>
		<dc:creator><![CDATA[martinlie]]></dc:creator>
				<category><![CDATA[2014-r2]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[intersoft-blog]]></category>
		<category><![CDATA[kb-how-to-article]]></category>
		<category><![CDATA[Reference Samples]]></category>

		<guid isPermaLink="false">http://blog.intersoftpt.com/?p=4390</guid>
		<description><![CDATA[This blog post will discuss topic on how you can use Crosslight SQLite as a local data storage for your apps. Before you start using Crosslight SQLite, it is recommended that you have basic knowledge about data binding and MVVM design pattern. Learn more. We have [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/03/2015-03-02-09-25-49-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="2015-03-02-09-25-49" style="float:right; margin:0 0 10px 10px;" /><p>This blog post will discuss topic on how you can use Crosslight SQLite as a local data storage for your apps. Before you start using Crosslight SQLite, it is recommended that you have basic knowledge about <a href="http://developer.intersoftpt.com/display/crosslight/Understanding+Data+Binding+and+MVVM+Design+Pattern" target="_blank">data binding and MVVM design pattern</a>. <a href="http://developer.intersoftpt.com/display/crosslight/Using+Crosslight+SQLite+for+Local+Data+Storage" target="_blank">Learn more</a>.</p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/2015-03-02-09-25-49.png"><img class="aligncenter wp-image-4391" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/2015-03-02-09-25-49-622x1024.png" alt="2015-03-02-09-25-49" width="304" height="500" /></a></p>
<p><a href="http://blog.intersoftpt.com/wp-content/uploads/2015/03/2015-03-02-09-25-58.png"><img class="aligncenter wp-image-4392" src="http://blog.intersoftpt.com/wp-content/uploads/2015/03/2015-03-02-09-25-58-622x1024.png" alt="2015-03-02-09-25-58" width="304" height="500" /></a></p>
<p>We have created a sample that lets you learn how to create SQLite tables with capability to insert, update and delete the record, use LINQ Query and custom SQL Query and many more. The sample code can be downloaded from our Git server <a href="http://git.intersoftpt.com/projects/CROS-SUPP/repos/sqlite-sample/browse" target="_blank">here</a>.</p>
<p>Happy Learning!</p>
<p>Cheers,<br />
Martin Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/03/using-crosslight-sqlite-for-local-data-storage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
