<?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; 2015 R1</title>
	<atom:link href="http://blog.intersoftsolutions.com/category/2015-r1/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>Getting Started with Crosslight Charting</title>
		<link>http://blog.intersoftsolutions.com/2015/10/getting-started-with-crosslight-charting/</link>
		<comments>http://blog.intersoftsolutions.com/2015/10/getting-started-with-crosslight-charting/#comments</comments>
		<pubDate>Wed, 21 Oct 2015 06:25:00 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2015 R1]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Charting]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[UI Components]]></category>

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

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=4729</guid>
		<description><![CDATA[In my post last month, I mentioned about data optimization feature in Crosslight 4 which could greatly improve the overall performance and experience of your Crosslight apps. So here we are, this week’s post will feature this optimization feature, and you will learn how to [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/09/Extensible-Request-and-Response-Filters-604x270.jpg" class="attachment-post-thumbnail wp-post-image" alt="Extensible Request and Response Filters" style="float:right; margin:0 0 10px 10px;" /><p>In <a href="http://blog.intersoftsolutions.com/2015/08/editing-data-with-view-projection/" target="_blank">my post</a> last month, I mentioned about data optimization feature in Crosslight 4 which could greatly improve the overall performance and experience of your Crosslight apps. So here we are, this week’s post will feature this optimization feature, and you will learn how to apply it to your apps. Read on.</p>
<p>In Crosslight 4, we shipped a lot of <a href="http://intersoftsolutions.com/2015" target="_blank">new stunning components</a> like charting, barcode reader, dialog presenters and much more. But that’s not all. We also pay a lot of attention on small and unseen areas such as the data framework, logging, and view projection. In fact, no feature is too small. For instance, the new extensible filters in RestClient enable you to add request and response compression and make your apps work 75% faster, particularly if you’re building enterprise apps that sync relatively large data. Let’s see how it works.</p>
<p><a href="http://blog.intersoftsolutions.com/wp-content/uploads/2015/09/Extensible-Request-and-Response-Filters.jpg"><img class="alignnone wp-image-4740" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/09/Extensible-Request-and-Response-Filters.jpg" alt="Extensible Request and Response Filters" width="700" height="389" /></a></p>
<p>Adding a new request or response filter to the RestClient is extremely easy, thanks to the new, intuitive API. Here’s how:</p><pre class="crayon-plain-tag">this.GetService&lt;IActivatorService&gt;().Register&lt;IRestClient&gt;(
c =&gt;
{
    RestClient restClient = new RestClient(appSettings.RestServiceUrl);
    restClient.AddRequestFilter(new GZipRequestFilter());
    restClient.AddResponseFilter(new GZipResponseFilter());

    return restClient;
});</pre><p></p>
<blockquote><p>If you&#8217;re using <a href="http://developer.intersoftsolutions.com/display/crosslight/Building+Business+Apps+with+Enterprise+App+Framework" target="_blank">Crosslight App Framework</a>, you can simply add the code in the <a href="http://git.intersoftsolutions.com/projects/CROS-SUPP/repos/rest-filter-samples/browse/RestFilterSamples.Core/Infrastructure/AppService.cs" target="_blank">AppService class</a> where all container registrations are defined. The Rest client in the entire app will automatically have the filters applied.</p></blockquote>
<p>Since the filter is provided as interface, you can plug any capabilities you desire, whether it is a compression filter, an encryption filter, etc. In this case, let’s not reinvent the wheel. We’ll just grab an existing <a href="https://www.nuget.org/packages/Microsoft.Bcl.Compression/3.9.85" target="_blank">Microsoft.Bcl.Compression</a> library from NuGet. Here’s an example how we can extend a third-party library to work with our filter interface:</p><pre class="crayon-plain-tag">public class GZipRequestFilter : GZipFilter, IRestRequestFilter
{
    public void Filter(IRestRequest request)
    {
        request.AddHeader("Accept-Encoding", "gzip, deflate");
        Parameter requestBody = request.Parameters.Where(o =&gt; o.Type == RequestParameterType.RequestBody).FirstOrDefault();

        if (requestBody != null)
        {
            request.AddHeader("Content-Encoding", "gzip");
            requestBody.Value = this.Compress(requestBody.Value.ToString());
        }
    }
}

public class GZipResponseFilter : GZipFilter, IRestResponseFilter
{
    public void Filter(IRestResponse response)
    {
        Parameter contentEncoding = response.Headers.Where(o =&gt; o.Name == "Content-Encoding").FirstOrDefault();

        if (contentEncoding != null &amp;&amp; contentEncoding.Value.ToString().ToLowerInvariant() == "gzip")
            response.Content = this.Decompress(response.RawBytes);
    }
}</pre><p>As seen above, we can just extend an existing class, say, the <em>GZipFilter</em> class, then implement the <em>IRestRequestFilter</em> and <em>IRestResponseFilter</em>. Both interfaces require an implementation of Filter method, that&#8217;s where you perform the actual logic of the filter.</p>
<p>On the server-side, if you’re using IIS for the web server, then you can just enable the dynamic compression feature. Afterward, the WebAPI response will be automatically compressed.</p>
<p>One thing to note though, WebAPI doesn’t automatically recognize the compressed requests. Fortunately, Microsoft already has a NuGet package for that. So we&#8217;ll just grab the <a href="https://www.nuget.org/packages/Microsoft.AspNet.WebApi.MessageHandlers.Compression/" target="_blank">ASP.NET WebAPI Compression Support</a>, then add the following code to the WebAPI config class.</p><pre class="crayon-plain-tag">public static class WebApiConfig
{
    public static void Register(HttpConfiguration config)
    {
        // Web API configuration and services
        config.MessageHandlers.Insert(0, new ServerCompressionHandler(new GZipCompressor(), new DeflateCompressor()));
    }
}</pre><p>Pretty easy, right?</p>
<p>Based on performance test on one of the apps we built for our enterprise client, enabling the compression filters speed up our apps performance by nearly 4x. Previously, in certain case, the app took 9 minutes to synchronize a thousand of data over the Edge connection. With compression enabled, the app only took only 2 minutes to sync the same set of data over Edge, and only a few seconds over Wifi. The user couldn’t be happier. So we hope you can do the same too, your users will thank you so much.</p>
<p>To see the feature in action, <a href="http://git.intersoftsolutions.com/projects/CROS-SUPP/repos/rest-filter-samples/" target="_blank">pull the sample</a> from our Git, and play around with it. The feature is also fully documented, which you can find <a href="http://developer.intersoftsolutions.com/display/crosslight/Optimizing+Data+Access+Performance" target="_blank">here</a>. Happy optimizing!</p>
<p>Best,<br />
Jimmy</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/09/improving-crosslight-app-performance-with-compression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Crosslight 4 IDE Integration Features</title>
		<link>http://blog.intersoftsolutions.com/2015/08/new-crosslight-4-ide-integration-features/</link>
		<comments>http://blog.intersoftsolutions.com/2015/08/new-crosslight-4-ide-integration-features/#comments</comments>
		<pubDate>Mon, 24 Aug 2015 10:02:35 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2015 R1]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://blog.intersoftsolutions.com/?p=4716</guid>
		<description><![CDATA[Howdy ho! I’m back with another video. In this video I’m going to show you the new IDE integration features of Crosslight 4, and we’ll focus on VS 2015 support as well as the improved Crosslight Project Wizard. Watch the entire video to see everything [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/08/Screen-Shot-2015-08-25-at-10.24.00-AM-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="Screen Shot 2015-08-25 at 10.24.00 AM" style="float:right; margin:0 0 10px 10px;" /><p>Howdy ho! I’m back with another video.</p>
<p>In this video I’m going to show you the new IDE integration features of Crosslight 4, and we’ll focus on VS 2015 support as well as the improved Crosslight Project Wizard.</p>
<p>Watch the entire video to see everything that has been improved.</p>
<div style="clear: both;text-align: center">
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/nTivdH3kH0Q?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
</div>
<p>See you guys in the next video!</p>
<p>Cheers,<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/08/new-crosslight-4-ide-integration-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading Crosslight 3 to Crosslight 4</title>
		<link>http://blog.intersoftsolutions.com/2015/08/upgrading-crosslight-3-to-crosslight-4/</link>
		<comments>http://blog.intersoftsolutions.com/2015/08/upgrading-crosslight-3-to-crosslight-4/#comments</comments>
		<pubDate>Thu, 13 Aug 2015 10:02:01 +0000</pubDate>
		<dc:creator><![CDATA[Nicholas Lie]]></dc:creator>
				<category><![CDATA[2015 R1]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Crosslight 4]]></category>

		<guid isPermaLink="false">http://blog.intersoftpt.com/?p=4695</guid>
		<description><![CDATA[How are you guys? I’m sure you guys have heard a lot about all the exciting new stuff in Crosslight 4 and can’t wait to get your hands dirty. But, for existing Crosslight developers, you might be wondering how to upgrade your existing projects to [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/08/Screen-Shot-2015-08-13-at-11.08.03-PM-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="Screen Shot 2015-08-13 at 11.08.03 PM" style="float:right; margin:0 0 10px 10px;" /><p>How are you guys?</p>
<p>I’m sure you guys have heard a lot about all the exciting new stuff in Crosslight 4 and can’t wait to get your hands dirty. But, for existing Crosslight developers, you might be wondering how to upgrade your existing projects to use Crosslight 4?</p>
<p>That’s why I made this video. In this video, I’m going to show you how to upgrade your existing projects to use Crosslight 4. It’s quite simple actually, it only involves four simple steps. What are those steps? Watch my video to find out!</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='604' height='370' src='http://www.youtube.com/embed/Y1tIOgneiX8?version=3&#038;rel=1&#038;fs=1&#038;autohide=2&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0' allowfullscreen='true'></iframe></span></p>
<p>Oh yeah, you can follow the full upgrade guide here: <a href="http://developer.intersoftpt.com/display/crosslight/Crosslight+4+Upgrade+Guide" target="_blank">http://developer.intersoftpt.com/display/crosslight/Crosslight+4+Upgrade+Guide</a>. In case you missed out all the exciting goodies of Crosslight 4, it’s available here: <a href="http://developer.intersoftpt.com/display/crosslight/Crosslight+4.0+Release+Notes" target="_blank">http://developer.intersoftpt.com/display/crosslight/Crosslight+4.0+Release+Notes</a>.</p>
<p>It’s been a while since I made my last video tutorial. It feels great and I can’t wait to share more Crosslight tips and tricks for you guys!</p>
<p>See you in the next post.<br />
Nicholas Lie</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/08/upgrading-crosslight-3-to-crosslight-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Crosslight View Projection</title>
		<link>http://blog.intersoftsolutions.com/2015/08/introducing-crosslight-view-projection/</link>
		<comments>http://blog.intersoftsolutions.com/2015/08/introducing-crosslight-view-projection/#comments</comments>
		<pubDate>Mon, 10 Aug 2015 11:05:42 +0000</pubDate>
		<dc:creator><![CDATA[Jimmy Petrus]]></dc:creator>
				<category><![CDATA[2015 R1]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Crosslight]]></category>
		<category><![CDATA[Data Access]]></category>
		<category><![CDATA[view projection]]></category>
		<category><![CDATA[webapi]]></category>

		<guid isPermaLink="false">http://blog.intersoftpt.com/?p=4670</guid>
		<description><![CDATA[Couple weeks ago, we&#8217;ve finally released Premier Studio 2015, one of our most remarkable milestones. We shipped Crosslight 4 with a host of new exciting components, Visual Studio 2015 across all product lineup, and Windows Edge support for WebUI components. That&#8217;s not all. We also [...]]]></description>
				<content:encoded><![CDATA[<img width="604" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2015/08/Screen-Shot-2015-08-10-at-6.30.25-PM-604x270.png" class="attachment-post-thumbnail wp-post-image" alt="Order list" style="float:right; margin:0 0 10px 10px;" /><p>Couple weeks ago, we&#8217;ve finally released Premier Studio 2015, one of our most remarkable milestones. We shipped Crosslight 4 with a host of new exciting components, Visual Studio 2015 across all product lineup, and Windows Edge support for WebUI components. That&#8217;s not all. We also launched a fully redesigned website which was the result of months of redesign works. In case you missed the news, check out the full coverage on the release <a href="http://blog.intersoftpt.com/2015/07/intersoft-studio-2015-delivers-hundreds-new-features-and-enhancements-to-crosslight-asp-net-and-clientui/" target="_blank">here</a>, and the website redesign concept <a href="http://blog.intersoftpt.com/2015/07/intersoftwebsite-reimagined/" target="_blank">here</a>.</p>
<p>So now you&#8217;ve got the new Studio installed, what&#8217;s next? We&#8217;ve made available a wealth of resources to help you quickly get started. For the starting point, I recommend you to check out the <a href="http://developer.intersoftpt.com/display/crosslight/Crosslight+4.0+Release+Notes" target="_blank">release notes</a> and follow the links in the page. Over the next few weeks, we&#8217;ll blog around the new features introduced in this release, covering each of them in more practical way.</p>
<p>This week, I&#8217;d like to discuss about the new features in Crosslight data access components, and how you can leverage them to build faster, more reliable data intensive apps.</p>
<p>Displaying a list of data that includes information from several related tables is a very typical application scenario. Consider the order list in an order tracking app, it makes a good sense to show aggregated amount and shipping information along with the order item, perhaps something like this.</p>
<p><img class="alignnone size-full wp-image-4674" src="http://blog.intersoftpt.com/wp-content/uploads/2015/08/Screen-Shot-2015-08-10-at-6.30.25-PM.png" alt="Order list" width="375" /></p>
<p>Showing the list from orders table only is certainly straightforward, but how to include the related information? That&#8217;s easy, thanks to the data service component (both client &amp; server) included in Crosslight. Just use the <em>Includes</em> API in the query definition, so the related entities will be fetched automatically from the server, like so:</p><pre class="crayon-plain-tag">public override QueryDescriptor GetQueryDescriptor()
{
    QueryDescriptor queryDescriptor = this.GetBaseQueryDescriptor();
    queryDescriptor.Includes.Add("Customer");
    queryDescriptor.Includes.Add("Address1");

    return queryDescriptor;
}</pre><p>That works well in most cases, particularly for list with few included related entities. However, when you added more related entities to the list, the payload will become larger too, exponentially. This often leads to issues like: longer time to transfer the data, more overhead in entity processing, and more critically, larger memory allocation. But, that&#8217;s all natural due to the way related entities work. To understand how a response with related entities look like, take a look at the JSON below.</p><pre class="crayon-plain-tag">{
  "$id": "1",
  "$type": "Intersoft.Data.WebApi.QueryResult, Intersoft.Data.WebApi.v4",
  "AffectedRows": null,
  "InlineCount": null,
  "Results": [
    {
      "$id": "2",
      "Address1": {
        "$id": "3",
        "AddressID": 1092,
        "AddressLine1": "99700 Bell Road",
        "AddressLine2": null,
        "City": "Auburn",
        "StateProvince": "California",
        "CountryRegion": "United States",
        "PostalCode": "95603",
        "rowguid": "79cdd89c-3c91-48db-8277-46d04aad7251",
        "ModifiedDate": "2002-09-01T00:00:00.000",
        "CompleteAddress": "99700 Bell Road\nAuburn, California"
      },
      "Customer": {
        "$id": "4",
        "CustomerID": 29847,
        "NameStyle": false,
        "Title": "Mr.",
        "FirstName": "David",
        "MiddleName": null,
        "LastName": "Hodgson",
        "Suffix": null,
        "CompanyName": "Good Toys",
        "SalesPerson": "adventure-works\\linda3",
        "EmailAddress": "david16@adventure-works.com",
        "Phone": "969-555-0117",
        "PasswordHash": "+gtwbVycsIIj2loVtrHNRN6IBLl20lQpRK8+JhzxyEo=",
        "PasswordSalt": "AwqZdYk=",
        "rowguid": "fdd7d9cb-9a81-40fc-baf6-facde8da4923",
        "ModifiedDate": "2002-09-01T00:00:00.000"
      },
      "SalesOrderID": 71774,
      "RevisionNumber": 2,
      "OrderDate": "2015-06-01T00:00:00.000",
      "DueDate": "2015-06-13T00:00:00.000",
      "ShipDate": "2015-06-08T00:00:00.000",
      "ModifiedDate": "2015-06-08T00:00:00.000"
    }
}</pre><p>As seen in the above JSON, every included entity will be added as a child record in the server response. This allows the Crosslight entity manager to attach the records properly in the client side. In our simple test, the order list retrieved with the Includes approach took <a href="https://gist.github.com/jimmyps/f2e3968436ca1e66d2fd#file-salesorderheaders_includes-json" target="_blank">72 KB</a> in size.</p>
<blockquote><p>If you&#8217;re new to Crosslight or unfamiliar with the QueryDescriptor API, you might want to check out <a href="http://developer.intersoftpt.com/display/crosslight/Dynamic+Data+Access+with+Query+Descriptor" target="_blank">Dynamic Data Access with Query Descriptor</a>.</p></blockquote>
<p>Obviously, you can address the above issues with custom server query or custom views, which are well supported by Crosslight. But, creating custom query every time you need to display data is counter-productive and tedious at best, agree?</p>
<p>So what solution do we have in store? Read on.</p>
<h2>Enter View Projection.</h2>
<p>Building on our experiences in architecting large scale enterprise apps, and also based on our customer&#8217;s feedback, we are introducing a more efficient way to create a shaped view in Crosslight 4. Called view projection, you can easily create a data view comprised of various information from related tables into a single flat list – dramatically shrinking payload size and processing time. We believe this is a better, more efficient, and more reliable way to fetch and present data in Crosslight apps.</p>
<p>Using the same order list scenario above, we can now extend the order entity with new properties to contain the additional information we&#8217;d like to fetch, then simply add the new <em>Select</em> attribute to indicate which property and related table to fetch, like so:</p><pre class="crayon-plain-tag">public partial class SalesOrderHeader
{
    [Select("Address1.CompleteAddress")]
    public string ShipAddress { set; get; }

    [Select("Customer.CompanyName")]
    public string CustomerCompany { set; get; }
}</pre><p>By defining such a simple metadata in the client side, the server will automatically construct the query behind the scene. Back in the client, you&#8217;ll get the data with the additional information in a flat list, then simply bind it to a list view. Piece of cake.</p>
<p>Here&#8217;s the example result of the response.</p><pre class="crayon-plain-tag">{
  "$id": "1",
  "$type": "Intersoft.Data.WebApi.QueryResult, Intersoft.Data.WebApi.v4",
  "AffectedRows": null,
  "InlineCount": null,
  "Results": [
    {
      "$id": "2",
      "$type": "ViewProjectionSample.DomainModels.SalesOrderHeader, ViewProjectionSample.DomainModels",
      "SalesOrderID": 71774,
      "RevisionNumber": 2,
      "OrderDate": "2015-06-01T00:00:00.000",
      "DueDate": "2015-06-13T00:00:00.000",
      "ShipDate": "2015-06-08T00:00:00.000",
      "ModifiedDate": "2015-06-08T00:00:00.000",
      "SalesOrderDetails": [ ], 
      "Address": null,
      "Address1": null,
      "Customer": null,
      "ShipAddress": "99700 Bell Road\nAuburn, California",
      "CustomerCompany": "Good Toys"
    }
}</pre><p>As expected, the <em>Customer</em> and <em>Address</em> entities are no longer included in the returned result. Instead, the <em>ShipAddress</em> and <em>CustomerCompany</em> properties are simply filled with the requested information.</p>
<p>Per our test using the same order query, the view projection took only <a href="https://gist.github.com/jimmyps/ed2985415448d922c4dd#file-salesorderheaders_viewprojection-json" target="_blank">37 KB</a>, about half the size of the response size using Includes approach. If you build relatively complex data apps, this view projection alone could reduce the response size up to 75%.</p>
<p>That&#8217;s not all. Nested properties is also supported, so you can easily include any entity regardless of the depth, as long as their relationships are well defined. Here&#8217;s an example of nested property selection.</p><pre class="crayon-plain-tag">[Select("Product.Category.CategoryName")]
public string ProductCategory { set; get; }

[Select("Order.ShipToAddress.Country.Name")]
public string ShipCountry { set; get; }</pre><p>In addition to nested properties, the new Select attribute is also smart enough to do some heavy data aggregation and calculation. Say you want to include the order details count and total to the order list, you can specify the Select attribute like this:</p><pre class="crayon-plain-tag">[Select("SalesOrderDetails.OrderQty", Aggregate.Sum)]
public int ProductQuantity { set; get; }</pre><p>As expected, the returned result will look something like this:</p><pre class="crayon-plain-tag">{
  "$id": "1",
  "$type": "Intersoft.Data.WebApi.QueryResult, Intersoft.Data.WebApi.v4",
  "AffectedRows": null,
  "InlineCount": null,
  "Results": [
    {
      "$id": "2",
      "$type": "ViewProjectionSample.DomainModels.SalesOrderHeader, ViewProjectionSample.DomainModels",
      "SalesOrderID": 71774,
      "RevisionNumber": 2,
      "OrderDate": "2015-06-01T00:00:00.000",
      "DueDate": "2015-06-13T00:00:00.000",
      "ShipDate": "2015-06-08T00:00:00.000",
      "ModifiedDate": "2015-06-08T00:00:00.000",
      "SalesOrderDetails": [ ], 
      "Address": null,
      "Address1": null,
      "Customer": null,
      "ShipAddress": "99700 Bell Road\nAuburn, California",
      "CustomerCompany": "Good Toys",
      "ProductQuantity": 2
    }
}</pre><p>Unbelievably simple, isn&#8217;t it? We haven&#8217;t quite finished yet, read on.</p>
<p>How about using some mathematical operations along with the data aggregate, you asked. Well, we&#8217;ve got those covered too. Here&#8217;s a quick example:</p><pre class="crayon-plain-tag">[Select("SalesOrderDetails", "OrderQty * UnitPrice * (1 - UnitPriceDiscount)", Aggregate.Sum)]
public double SubTotal { set; get; }</pre><p>In addition to sum, as you might already have in mind, we also supported other aggregate options such as count, min, max, and average.</p>
<p>And if you just realized, we haven&#8217;t touch the server part even a bit, are we missing something? Nope. The server recognizes all these new Select metadata, thanks to the much improved WebApi component introduced in the new <a href="http://developer.intersoftpt.com/display/crosslightapi/Intersoft.Data.WebApi.v4+Assembly" target="_blank">Intersoft.Data.WebApi.v4</a> assembly.</p>
<blockquote><p>In fact, all you have to do at the server side is to update the Intersoft WebApi assemblies and the related Nuget packages to the latest version. Check out this <a href="http://developer.intersoftpt.com/display/crosslight/Crosslight+4+Upgrade+Guide" target="_blank">upgrade guide</a> for details.</p></blockquote>
<p>Last but not least, all the powerful new capabilities above are equally supported in Crosslight SQLite as well, so if you build sync-aware apps, the same metadata will work just fine, whether the app loads data from the remote server or local storage. In addition, the view projection has been carefully designed to support data editing and update scenario as well which I&#8217;ll cover in the next post.</p>
<p>We&#8217;ve designed Crosslight with strong focus on developer experience since the initial release. We continue to provide even greater developer experience in this new release, making the impossible possible with intuitive and simple API design.</p>
<p>We still have a lot of stories to cover around data access improvements, but for now, let&#8217;s pull <a href="http://git.intersoftpt.com/projects/CROS-SUPP/repos/view-projection-samples/browse" target="_blank">some samples</a> and see the demo of view projection features for yourself. If you have any questions, join us in <a href="http://intersoftpt.com/community/crosslight" target="_blank">our community forum</a>.</p>
<p>Best,<br />
Jimmy</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2015/08/introducing-crosslight-view-projection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
