<?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>Silverlight &#38; WCF RIA Services</title>
	<atom:link href="http://bachelorthesis.zdechovan.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bachelorthesis.zdechovan.com</link>
	<description>Bachelor Thesis About RIA Enterprise Applications (written by Lukáš Zdechovan, led by Ondrej Svačina)</description>
	<lastBuildDate>Sat, 29 May 2010 17:57:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>III. EF Model as a starting point of development</title>
		<link>http://bachelorthesis.zdechovan.com/iii-ef-model-as-a-starting-point-of-development/</link>
		<comments>http://bachelorthesis.zdechovan.com/iii-ef-model-as-a-starting-point-of-development/#comments</comments>
		<pubDate>Sat, 29 May 2010 17:57:41 +0000</pubDate>
		<dc:creator>Lukáš Zdechovan</dc:creator>
				<category><![CDATA[Nezaradené]]></category>
		<category><![CDATA[domain model]]></category>
		<category><![CDATA[doman-driven design]]></category>
		<category><![CDATA[Entity Framework]]></category>

		<guid isPermaLink="false">http://bachelorthesis.zdechovan.com/?p=295</guid>
		<description><![CDATA[If you are familiar with MDA, then you would maybe welcome this scenario, where you create a PIM and PSM with source code are then generated according to specified technology and platform.
However, Entity Framework is not about UML modelling of PIM, but has features to easily create entities, associations and inheritance between them in .NET [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_203" class="wp-caption alignleft" style="width: 160px"><img class="size-thumbnail wp-image-203" title="Doménový model" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/02/EntityDesignerDiagram02-150x150.png" alt="Doménový model" width="150" height="150" /><p class="wp-caption-text">EF Data model</p></div>
<p>If you are familiar with <a href="http://en.wikipedia.org/wiki/Model-driven_architecture">MDA</a>, then you would maybe welcome this scenario, where you create a <a href="http://en.wikipedia.org/wiki/Platform-independent_model">PIM </a>and <a href="http://en.wikipedia.org/wiki/Platform-specific_model">PSM </a>with source code are then generated according to specified technology and platform.</p>
<p>However, Entity Framework is not about UML modelling of PIM, but has features to easily create entities, associations and inheritance between them in .NET solutions.</p>
<p>You are able to generate DDL schema for database you choose and C# or VB code of entities is generated, as well. So you can look on EF as an <strong>OR/M</strong> solution, as a tool to create your <strong>Data Model</strong> or to be a starting point for <strong>Domain Model</strong> with specific domain/business logic implemented in partial classes.</p>
<p><span id="more-295"></span></p>
<p>This post belongs to <a style="text-decoration: underline; color: #70a529; padding: 0px; margin: 0px;" href="http://bachelorthesis.zdechovan.com/wcf-ria-services-mvvm-prism-lob-application-introduction/">RIA Services MVVM Prism LoB Application series</a>, read <a style="text-decoration: underline; color: #70a529; padding: 0px; margin: 0px;" href="http://bachelorthesis.zdechovan.com/wcf-ria-services-mvvm-prism-lob-application-introduction/">Introduction</a> post to find out more about it.</p>
<p>In my application I chosen Entity Framework as a Data Access Layer (also because I wanted to test its capabilities comparing to Linq2Sql). I was partly influenced also by stronger support of EF in domain service and metadata generation in WCF RIA Services.</p>
<p>You can create you model in two ways: either from scratch or from database. In my case, I didn&#8217;t want to create the database schema first, but actually I wanted to check how well the SQL DDL generation works.</p>
<p>Creating the model is similar to creation of UML Class Diagram. Inheritance works the same way, but I had to face a problem with some specific associations. Fortunately, message in the result was quite explainful, so I overcame all of these problems.</p>
<p>Here is the data model of my demo RIA LoB application:</p>
<div class="wp-caption alignnone" style="width: 160px"><a href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/02/EntityDesignerDiagram04.png"><img class=" " title="EF Data Model" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/02/EntityDesignerDiagram02-150x150.png" alt="EF Data Model" width="150" height="150" /></a><p class="wp-caption-text">EF Data Model</p></div>
<p>Have a look at the <a href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/05/TelecoSystems.edmx_.sql_1.txt">SQL DDL query</a> generated from my EF Data Model. What I appreciate the most is, that the query is pretty <strong>human readable</strong> <img src='http://bachelorthesis.zdechovan.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>We tend to separate parts of our solutions to separate projects, but keep in mind, that if you put a domainservice in a<strong> different project</strong> that your EF model is located, the<strong> checkbox to generate metadata will be disabled</strong>.</p>
<p>I <strong>reccommend</strong> to either create metadata on your own (its not difficult, but rather bothersome work) or to create domainservice in the model&#8217;s project with generated metadata and copy the domainservice afterwards to a new project.</p>
<p>The other thing you have to decide is, whether you want to keep the <strong>metadata</strong> within your model project or with the domainservice. For me, metadata is still a part of model, as it only describe the entities attributes more, so I tend to copy metadata files to a special metadata folder within the model project.</p>
<p>Read more&#8230;</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx">The ADO.NET Entity Framework Overview (MSDN)</a><br />
<a href="http://msdn.microsoft.com/en-us/library/bb399572.aspx">ADO.NET Entity Framework (MSDN)</a><br />
<a href="http://thedatafarm.com/LearnEntityFramework/book/table-of-contents/">Programming Entity Framework 4</a> (book)</p>
]]></content:encoded>
			<wfw:commentRss>http://bachelorthesis.zdechovan.com/iii-ef-model-as-a-starting-point-of-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight OOB &#8211; Under the hood</title>
		<link>http://bachelorthesis.zdechovan.com/silverlight-oob-under-the-hood/</link>
		<comments>http://bachelorthesis.zdechovan.com/silverlight-oob-under-the-hood/#comments</comments>
		<pubDate>Wed, 05 May 2010 09:01:53 +0000</pubDate>
		<dc:creator>Lukáš Zdechovan</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[Out of browser]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://bachelorthesis.zdechovan.com/?p=285</guid>
		<description><![CDATA[I&#8217;ve experienced several problems and I have to take a closer look on OOB, how it works and how we can for example install our silverlight application from CD.
Out of Browser is a feature of Silverlight 3+ Applications, where the user can install the application to the desktop and you as a developer can provide [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/05/Install_Package.png"><img class="alignleft size-full wp-image-287" style="margin: 0 10px;" title="OOB Silverlight RIA" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/05/Install_Package.png" alt="" width="128" height="128" /></a>I&#8217;ve experienced several problems and I have to take a closer look on OOB, how it works and how we can for example install our silverlight application from CD.</p>
<p><strong>Out of Browser </strong>is a feature of Silverlight 3+ Applications, where the user can install the application to the desktop and you as a developer can provide more functionality, especially when application is installed as trusted.</p>
<p>If you want to explore <strong>where</strong> the OOB applications are <strong>located</strong> in users hard drive, <strong>how</strong> they are <strong>launched</strong> and how to allow the user to install Silverlight Application from CD, continue reading.<span id="more-285"></span></p>
<h3>Important methods, properties for OOB in Silverlight</h3>
<p><a href="http://msdn.microsoft.com/en-us/library/system.windows.application.isrunningoutofbrowser(v=VS.95).aspx">Application.IsRunningOutOfBrowser</a> (Gets a value that indicates whether the application was launched from the out-of-browser state.)<br />
<a href="http://msdn.microsoft.com/en-us/library/system.windows.application.install(v=VS.95).aspx">Application.Install()</a> (Attempts to install the application so that it can run outside the browser.)<br />
<a href="http://msdn.microsoft.com/en-us/library/system.windows.application.installstate(VS.95).aspx">Application.InstallState</a> (Gets the current out-of-browser installation state of the application.)<br />
<a href="http://msdn.microsoft.com/en-us/library/system.windows.installstate(VS.95).aspx">InstallState Enumeration</a> (Defines constants that indicate the installation state of an application that is configured to run outside the browser.)</p>
<p>A complete guidance on <a href="http://msdn.microsoft.com/en-us/library/dd550721(VS.95).aspx">Out of Browser Support</a> in Silverlight.</p>
<h3>Where to find installed OOB applications?</h3>
<p>A list of all silverlight applications is available in a hidden folder<br />
<strong>C:\Users\{user name}\AppData\LocalLow\Microsoft\Silverlight\OutOfBrowser\</strong><br />
<em>Notice also a folder sibling &#8230;\Silverlight\is\ which is an isolated storage for running Silverlight apps.</em></p>
<p>Name of the files in this folder is done by the address of the location (e.g. localhost, microsoft.com). Most of these files are empty, but those which are installed for OOB mode has some information within. Open that file and you will see the <strong>ID</strong> of the application and the whole <strong>URL</strong> where the original (web version) is located. ID with name of file creates <strong>ApplicationID</strong> (e.g. 972856442.localhost, 3326975874.zdechovan.com) which we will use to launch our application in a section below.</p>
<h3>How to launch a Silverlight OOB?</h3>
<p>There is an application <strong>sllauncher.exe</strong>, that is used to launch Silverlight application in Out of Browser mode. This application is located in C:\Program Files\Microsoft Silverlight\sllauncher.exe.</p>
<p>To run a silverlight application you have to pass some parameters to this sllauncher, if you try to run it without any of them, you&#8217;ll see the <strong>usage</strong> pattern:</p>
<pre name="code" class="c-sharp">
SLLauncher.exe [app_id] [debug] [/install:&lt;file path to XAP&gt;]
[/emulate:&lt;file path to XAP&gt;] [/overwrite] /origin:&lt;original app uri&gt;
/uninstall /shortcut:&lt;desktop|startmenu|desktop+startmenu|none&gt; [/pid]
</pre>
<p>You can experiment with a lots of variations of parameters set up if you wish, for me, the most importat is to set a shortcut, which will launch our application. It&#8217;s because I experienced a problem, that after install from application the shortcut was corrupted and didn&#8217;t work.</p>
<p>Working shortcut should contain {path to sllauncher}/sllauncher.exe {ApplicationId} so for example C:\Program Files\Microsoft Silverlight\sllauncher.exe 972856442.localhost in my case.</p>
<p>If you want to debug your OOB application simply add a <strong>debug</strong> parameter.</p>
<p>I found an article <a href="http://timheuer.com/blog/archive/2010/03/25/using-sllauncher-for-silent-install-silverlight-application.aspx">Installing Silverlight applications without the browser involved</a> by Tim Heuer about how to use  sllauncher to install/uninstall a silverlight application.</p>
]]></content:encoded>
			<wfw:commentRss>http://bachelorthesis.zdechovan.com/silverlight-oob-under-the-hood/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>II. Prism solution based on the Biz App Template</title>
		<link>http://bachelorthesis.zdechovan.com/prism-solution-based-on-the-business-application-template/</link>
		<comments>http://bachelorthesis.zdechovan.com/prism-solution-based-on-the-business-application-template/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 20:37:10 +0000</pubDate>
		<dc:creator>Lukáš Zdechovan</dc:creator>
				<category><![CDATA[Samples]]></category>
		<category><![CDATA[Business Application Template]]></category>
		<category><![CDATA[Prism]]></category>

		<guid isPermaLink="false">http://bachelorthesis.zdechovan.com/?p=260</guid>
		<description><![CDATA[A couple words on Silverlight &#38; Modularity
If you browse the web you would find few articles on modular RIA Services applications.
Even if you visit the blog of Brad Abrams and open Business Apps Example for Silverlight 3 RTM and .NET RIA Services you will notice the post about Modular Development is not written yet.
This post [...]]]></description>
			<content:encoded><![CDATA[<h3>A couple words on Silverlight &amp; Modularity</h3>
<p>If you browse the web you would find few articles on modular RIA Services applications.<br />
Even if you visit the blog of Brad Abrams and open<a href="http://blogs.msdn.com/brada/archive/2009/08/02/business-apps-example-for-silverlight-3-rtm-and-net-ria-services-july-update-summary.aspx"> Business Apps Example for Silverlight 3 RTM and .NET RIA Services</a> you will notice the post about Modular Development is not written yet.</p>
<p>This post belongs to <a href="/wcf-ria-services-mvvm-prism-lob-application-introduction/">RIA Services MVVM Prism LoB Application series</a>, read <a href="/wcf-ria-services-mvvm-prism-lob-application-introduction/">Introduction</a> post to find out more about it.<br />
<span id="more-260"></span><br />
So what can we actually do? Look for the <a href="http://compositewpf.codeplex.com/wikipage?title=Getting%20Started&amp;referringTitle=Home&amp;ProjectName=compositewpf">Prism (Composite Application Library)</a>, <a href="http://mef.codeplex.com/">MEF</a> and <a href="http://caliburn.codeplex.com/">Caliburn framework</a>.</p>
<p>I find all of them very promising, MEF is focusing on design of<strong> extensible applications and components</strong> and is still in development (Preview, April 2010); Caliburn is a framework to support the development in many areas, but I find it also too &#8220;fresh&#8221; and not as well documented as Prism from Patterns&amp;Practices team.</p>
<h3>Prism + WCF RIA Services</h3>
<p>I chose <strong>Prism</strong> for my application, since it support modular development and provides some great features as <strong>UnityContainer, ServiceLocator, Commanding</strong> and other stuff. <em>You should be aware of some design patterns in order to understand how these works.</em></p>
<div id="attachment_263" class="wp-caption alignright" style="width: 273px"><img class="size-full wp-image-263" title="telecosystems solution" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/04/telecosystems-solution.png" alt="Solution" width="263" height="434" /><p class="wp-caption-text">Solution structure</p></div>
<p>I didn&#8217;t start from scratch and created a new solution with Silverlight Business Application Template. The Silverlight project will be our <strong>Shell</strong>. After that I created the Infrastructure project.</p>
<p>Then you can add a new Silverlight <strong>Module</strong> by creating a <strong>Silverlight Application</strong> project and made some changes in order to make it working as Prism Module.<br />
<strong>Important is</strong> to host it in your Web project and to enable RIA Link to that Web project; disable the create TestPage option.<br />
Then you have to create some folder (let&#8217;s say Web/Resources) and add there resources from Web project &#8220;as link&#8221; (the same links are in Shell project).</p>
<p>My first idea was to create<strong> separate Web project for each module</strong>, where Services+Metadata for coresponding Module could be placed, with one EF Model in different solution, but I didn&#8217;t make it work, so If you do, please let me know.</p>
<p>When I was on a half-way I finally found one example of <a href="http://blogs.msdn.com/dphill/archive/2009/08/17/prism-and-net-ria-services.aspx">Prism and .NET RIA Services</a> so you may study how it is done there (it helped me, as well).</p>
<p>If you are interested in how I implemented Prism in my WCF RIA application have a look on the <a href="http://telecosystems.codeplex.com/SourceControl/list/changesets">source code</a>.</p>
<p>I recommend to read the well written documentation of <a href="http://compositewpf.codeplex.com/wikipage?title=Getting%20Started&amp;referringTitle=Home&amp;ProjectName=compositewpf">Prism</a>. Some QuickStarts are also included in the library.</p>
<h3>Some code examples</h3>
<p>Now, lets see how to register a domaincontext in a module so it behaves like a singleton if you&#8217;ll follow some conventions. This is Initialize method from my ProjectsModule.cs class, which implements the IModule interface and holds as an initializator of the module.</p>
<pre name="code" class="c-sharp">
public void Initialize()
{
    //Register Domain Contexts which are being used in the module
    unityContainer.RegisterType(new InjectionConstructor());
    unityContainer.RegisterType(new InjectionConstructor());

    //Locate the base module view
    ProductsModuleView pmView = this.unityContainer.Resolve();
    //Locate the Main Shell region and add module view to it
    IRegion region = regionManager.Regions[RegionNames.MainRegion];
    region.Add(pmView, pmView.GetType().Name);
    region.Activate(pmView);

    //Register main module views with the Products's module region
    region = regionManager.Regions[MODULE_NAME + RegionNames.ModuleRegion];
    regionManager.RegisterViewWithRegion(
        MODULE_NAME + RegionNames.ModuleRegion,
        () =&gt; this.unityContainer.Resolve());
    regionManager.RegisterViewWithRegion(
        MODULE_NAME + RegionNames.ModuleRegion,
        () =&gt; this.unityContainer.Resolve());
}</pre>
<p>Let&#8217;s have a quick look on a Module Catalog which is placed in file ModuleCatalog.xaml and you can specify there what modules would you like to load, specify dependencies and whether the module should load on demand or immediately as it is available.</p>
<pre name="code" class="xml">
<cal:ModuleCatalog xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:cal="clr-namespace:Microsoft.Practices.Composite.Modularity;assembly=Microsoft.Practices.Composite">

    <cal:ModuleInfo Ref="TelecoSystems.Modules.Dashboard.xap"
                      ModuleName="Dashboard"
                      ModuleType="TelecoSystems.Modules.Dashboard.DashboardModule, TelecoSystems.Modules.Dashboard, Version=1.0.0.0"
                      InitializationMode="WhenAvailable"/>

    <cal:ModuleInfo Ref="TelecoSystems.Modules.Products.xap"
                      ModuleName="Products"
                      ModuleType="TelecoSystems.Modules.Products.ProductsModule, TelecoSystems.Modules.Products, Version=1.0.0.0"
                      InitializationMode="OnDemand"/>

    <cal:ModuleInfo Ref="TelecoSystems.Modules.Customers.xap"
                      ModuleName="Customers"
                      ModuleType="TelecoSystems.Modules.Customers.CustomersModule, TelecoSystems.Modules.Customers, Version=1.0.0.0"
                      InitializationMode="OnDemand"/>

    <cal:ModuleInfo Ref="TelecoSystems.Modules.Contracts.xap"
                      ModuleName="Contracts"
                      ModuleType="TelecoSystems.Modules.Contracts.ContractsModule, TelecoSystems.Modules.Contracts, Version=1.0.0.0"
                      InitializationMode="OnDemand">
        <cal:ModuleInfo.DependsOn>
            <sys:String>Products</sys:String>
            <sys:String>Customers</sys:String>
        </cal:ModuleInfo.DependsOn>
    </cal:ModuleInfo>

</cal:ModuleCatalog>
</pre>
<p>If you have any questions, append a comment to this post, please.</p>
]]></content:encoded>
			<wfw:commentRss>http://bachelorthesis.zdechovan.com/prism-solution-based-on-the-business-application-template/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>I. RIA Services MVVM Prism LoB App &#8211; Introduction</title>
		<link>http://bachelorthesis.zdechovan.com/wcf-ria-services-mvvm-prism-lob-application-introduction/</link>
		<comments>http://bachelorthesis.zdechovan.com/wcf-ria-services-mvvm-prism-lob-application-introduction/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 14:27:42 +0000</pubDate>
		<dc:creator>Lukáš Zdechovan</dc:creator>
				<category><![CDATA[Samples]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[WCF RIA Services]]></category>

		<guid isPermaLink="false">http://bachelorthesis.zdechovan.com/?p=253</guid>
		<description><![CDATA[Confused by the caption?
Translated to &#8220;human language&#8221;, a part of my bachelor thesis is implementation of modular business silverlight application build upon MVVM (Separated presentation) pattern and WCF RIA Services (simplifies the development of n-tier RIA solutions).
Application is published under open-source license and is located on CodePlex so you can download the source code and [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_254" class="wp-caption alignleft" style="width: 160px"><a class="lightbox" title="telecosystems screenshot" href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/04/telecosystems-screenshot.png"><img class="size-thumbnail wp-image-268" title="telecosystems screenshot" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/04/telecosystems-screenshot-150x150.png" alt="Screenshot" width="150" height="150" /></a><p class="wp-caption-text">Screenshot</p></div>
<h3>Confused by the caption?</h3>
<p>Translated to &#8220;human language&#8221;, a part of my bachelor thesis is implementation of <strong>modular business silverlight application</strong> build upon <strong>MVVM</strong> (Separated presentation) pattern and <strong>WCF RIA Services</strong> (simplifies the development of n-tier RIA solutions).</p>
<p>Application is published under open-source license and is located on <a href="http://telecosystems.codeplex.com/">CodePlex</a> so you can download the source code and explore how this or that was done.</p>
<p>I decided to write a few separate articles to describe the solution.</p>
<h3>List of articles</h3>
<ul>
<li><a href="/prism-solution-based-on-the-business-application-template/">Prism (Composite Application Library) solution structure based on the Business Application Template</a>.</li>
<li>Entity Framework Model as a starting point of development</li>
<li>DomainServices and Metadata</li>
<li>Implementation of Shell</li>
<li>Building GUI with MVVM pattern</li>
<li>Customizing Business Application Template Login Form</li>
<li>Charting, Exporting, Printing</li>
</ul>
<p>Note: I plan to publish at least one article every week, so come back in month or two if you are interested.</p>
<div id="attachment_269" class="wp-caption alignnone" style="width: 160px"><a class="lightbox" title="telecosystems-login" href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/04/telecosystems-login.png"><img class="size-thumbnail wp-image-269" title="telecosystems-login" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/04/telecosystems-login-150x150.png" alt="Teleco Systems Login Page" width="150" height="150" /></a><p class="wp-caption-text">Teleco Systems Login Page</p></div>
]]></content:encoded>
			<wfw:commentRss>http://bachelorthesis.zdechovan.com/wcf-ria-services-mvvm-prism-lob-application-introduction/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to: Create an advanced SketchFlow Prototype</title>
		<link>http://bachelorthesis.zdechovan.com/how-to-create-advanced-sketchflow-prototype/</link>
		<comments>http://bachelorthesis.zdechovan.com/how-to-create-advanced-sketchflow-prototype/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 11:22:04 +0000</pubDate>
		<dc:creator>Lukáš Zdechovan</dc:creator>
				<category><![CDATA[Samples]]></category>
		<category><![CDATA[Rich User Experience]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[SketchFlow]]></category>
		<category><![CDATA[UI prototype]]></category>

		<guid isPermaLink="false">http://bachelorthesis.zdechovan.com/?p=212</guid>
		<description><![CDATA[
I&#8217;m working on a Silverlight demo LoB application as a part of my bachelor thesis and I made a UI prototype with a couple of screens containing sample data and some basic functionality like navigating through screens, autocomplete boxes, some pop-up windows&#8230;
At first, check out the SketchFlow prototype (or just PDF exported document) which I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p><a class="lightbox" title="LoginSketch" href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/02/LoginSketch.PNG"><img class="size-thumbnail wp-image-195 alignleft" style="margin-left: 10px; margin-right: 10px; margin-top: 5px; margin-bottom: 5px;" title="Login Sketch" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/02/LoginSketch-150x150.PNG" alt="Login view sketch" width="150" height="150" /></a></p>
<p>I&#8217;m working on a<strong> Silverlight demo LoB application</strong> as a part of my bachelor thesis and I made a<strong> UI prototype </strong>with a couple of screens containing sample data and some basic functionality like navigating through screens, autocomplete boxes, some pop-up windows&#8230;</p>
<p>At first, check out the <a href="http://bachelorthesis.zdechovan.com/demoapp/sketchflow/">SketchFlow prototype</a> (or just <a href="http://bachelorthesis.zdechovan.com/demoapp/sketchflow/TelecoSystemsPrototype.pdf?updated=2010_03_12">PDF exported document</a>) which I&#8217;m going to describe here, to see whether the rest of article is interesting for you.</p>
<p>Download the <a title="SketchFlow prototype source code" href="http://bachelorthesis.zdechovan.com/demoapp/sketchflow/telecosystemsprototype.zip">source code</a> of the project.</p>
<p><span id="more-212"></span></p>
<h3>Why to do WPF/Silverlight UI prototypes in SketchFlow?</h3>
<p>We usually build the software for our customers and therefore we have to check regularly whether our work really meets their expectations.</p>
<p><strong>To avoid reconstruction</strong> of the user interface near the end of the development, project teams tends to do UI prototypes. This way we could get the feedback from our managers and customers about the basic design elements like layout, UI components used, data that is shown, etc.</p>
<p>SketchFlow enable to create UI mocks that looks like <strong>hand-drawn</strong>, but<strong> with real XAML elements and C#(or VB)</strong> code so there is a great chance, that in the end you can reuse a lot of the XAML code for the real project. Plus you can easily create <strong>Sample Data Sources</strong> with &#8220;lorem ipsum&#8221; style data.</p>
<p>To enrich the communication process between you and the customer there are some<strong> feedback</strong> controls to draw and write notes in the running prototype and then export it.</p>
<p>I will <strong>explore the whole process of creating SketchFlow prototype</strong> in the next couple sections.</p>
<h3>Basic Orientation in SketchFlow Project</h3>
<div id="attachment_214" class="wp-caption alignleft" style="width: 310px"><a class="lightbox" title="sketchflow overview" href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-overview.png"><img class="size-medium wp-image-214" title="sketchflow overview" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-overview-300x171.png" alt="Overview of Expression SketchFlow" width="300" height="171" /></a><p class="wp-caption-text">Overview of Expression SketchFlow</p></div>
<p>The most important parts of the environment are <strong>SketchStyles assets</strong>, that are actually styles applied on dozens of classic UI controls.</p>
<p>Another important tool is <strong>SketchFlow Map</strong> where you can create connected screens, organize component screens and visually tag them to express some king of grouping.</p>
<p>In the right panel there are by default <strong>Properties</strong> (of selected component) and<strong> Data</strong> panels. In Data panel you can create collections of sample data or import data sources from XML files.</p>
<p>In some cases you would like to create some basic animations of the content and this can be done with the<strong> animation panel</strong>.</p>
<p>If you can&#8217;t find some of these panels you can show them by the Window submenu in the Main menu.</p>
<h3>Create navigation screen with views as component screens</h3>
<p>At first, you should see the first blank screen in your project. You can place there some Sketchy controls to create the user interface on that screen.</p>
<div id="attachment_216" class="wp-caption alignleft" style="width: 310px"><a class="lightbox" title="sketchflow-map" href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-map.png"><img class="size-medium wp-image-216" title="sketchflow-map" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-map-300x106.png" alt="SketchFlow Map" width="300" height="106" /></a><p class="wp-caption-text">SketchFlow Map</p></div>
<p>This will be the first screen in your project and by clicking on buttons in the SketchFlow map you can <strong>create screens that are connected to this screen</strong>.</p>
<p>You can also create new screen separately and after that <strong>connect</strong> the screen to another existing screen.</p>
<p>To create a component screen I recommend to create some basic stuff at the source screen first, place it in some Grid and than raise context menu on that Grid in the Objects and Timeline panel and choose Make into component screen.</p>
<div id="attachment_217" class="wp-caption alignleft" style="width: 280px"><a class="lightbox" style="float: left" title="sketchflow-group" href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-group.png"><img class="size-medium wp-image-217" title="sketchflow-group" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-group-300x263.png" alt="Group UI controls into Layout element" width="270" height="245" /></a><p class="wp-caption-text">Group UI controls into Layout element</p></div>
<div id="attachment_218" class="wp-caption alignleft" style="width: 280px"><a class="lightbox" style="float: left" title="sketchflow-makeinto" href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-makeinto.png"><img class="size-medium wp-image-218" title="sketchflow-makeinto" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-makeinto-300x244.png" alt="Make element into..." width="270" height="230" /></a><p class="wp-caption-text">Make element into...</p></div>
<p><br style="clear: both;" /><br />
Then you can see in Objects and Timeline that the Grid changed to the &#8220;NewComponentName&#8221; and you can edit its contents and its code-behind in separated files.</p>
<p>In my case I have a TabControl in every screen (Products, Customers&#8230;)  and <strong>TabItems content</strong> is transformed to separate <strong>Component screens</strong>. I have the <strong>navigation</strong> of my app as a separate <strong>UserControl</strong>, to enable placing it in all Screens, but still edit it in one place.</p>
<p>To enable <strong>navigtion between the screens</strong> from the screen by clicking on some buttons, you have to open the context menu on selected button and choose <strong>Navigate To</strong> and selected the desired screen. Only screens to which current screen is connected could apper here.</p>
<h3>Create Sample Data and bind UI controls to it</h3>
<p>You can easily create new <strong>collections</strong> of sample data, that contains <strong>simple/complex properties and sub-collections</strong>. After creating a new property you should set the type and some details (size, max length, etc.).</p>
<div id="attachment_226" class="wp-caption alignleft" style="width: 310px"><a class="lightbox" title="sketchflow-sampledata" href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-sampledata.png"><img class="size-medium wp-image-226" title="sketchflow-sampledata" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-sampledata-300x160.png" alt="SketchFlow Sample Data" width="300" height="160" /></a><p class="wp-caption-text">SketchFlow Sample Data</p></div>
<p>There is also an option to <strong>edit</strong> pre-generated values and set the count of sample records in a collection.</p>
<p>Image type property should be linked to a directory that contains sample images.</p>
<p>Binding works the same way like in normal WPF/Silverlight project. I recommend to set the DataContext of the LayoutRoot grid to the <strong>ProjectDataSource</strong> and then just bind ItemsSource properties of ListBoxes, Grids on the screen to sample data collections.</p>
<h3>How to create sketchy controls that are not included in default SketchStyles</h3>
<div id="attachment_228" class="wp-caption alignleft" style="width: 310px"><a class="lightbox" title="sketchflow-applysketch" href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-applysketch.png"><img class="size-medium wp-image-228" title="sketchflow-applysketch" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-applysketch-300x197.png" alt="SketchFlow Apply sketchy resource" width="300" height="197" /></a><p class="wp-caption-text">SketchFlow Apply sketchy resource</p></div>
<p>There is limited amount of controls that could be drag&#8217;n'dropped from the SketchStyles panel.</p>
<p>In my prototype I used <strong>AutocompleteBox, DataPicker</strong> and maybe some other controls, that should be styled the sketchy way, as well.</p>
<p>A lot of these extra controls are <strong>derived or contain some primitive UI controls</strong>. AutocompleteBox is derived from standerd TextBox and therefore we can apply TextBox-Sketch resource to it.</p>
<p>In other controls we could at least change the Font to <strong>Buxton Sketch</strong> and set colors of control to grayscale ones.</p>
<h3>Publish the project, Export to Microsoft Word, Manage the Feedback</h3>
<p>In the Main menu, you can <strong>Package the SketchFlow project</strong> and that will export your prototype to a specified folder. Actually the only files you need for publishing on the web or to deliver to customer are Silverlight XAP file and an HTML document that hosts that Silverlight application. Show my <a href="http://bachelorthesis.zdechovan.com/demoapp/sketchflow/">published project</a>.</p>
<p>The other interesting function is <strong>Export to Microsoft Word</strong>, where the SketchFlow generates a Word document with the SketchFlow Map and all the Navigation and Component Screens. Show my <a href="http://bachelorthesis.zdechovan.com/demoapp/sketchflow/TelecoSystemsPrototype.pdf?updated=2010_03_12">exported document</a> saved as PDF.</p>
<div id="attachment_232" class="wp-caption alignleft" style="width: 310px"><a class="lightbox" title="sketchflow-feedback" href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-feedback.png"><img class="size-medium wp-image-232" title="sketchflow-feedback" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/03/sketchflow-feedback-300x178.png" alt="SketchFlow project Feedback" width="300" height="178" /></a><p class="wp-caption-text">SketchFlow project Feedback</p></div>
<p>In the running project, the user can navigate through the left sidebar or by clicking on buttons in screens.</p>
<p>In the left sidebar there is also a Feedback panel where the user can <strong>write, draw feedback</strong> and then <strong>export</strong> it and <strong>send</strong> the exported file to development team.</p>
<p>You as a developer could import/add feedback files from your customers (or managers) via the Feedback panel (on the left from the Objects and Timeline).</p>
<h3 style="clear:both;">Useful links about Expression SketchFlow</h3>
<p>In the end, I will share with you some links about SketchFlow I&#8217;ve already collected.</p>
<p><a href="http://blog.ondrejsv.com/post/How-to-Create-a-sketchy-Siverlight-GroupBox-in-BlendSketchFlow.aspx">How to: Create a sketchy Siverlight GroupBox in Blend/SketchFlow</a> (ondrejsv, 17th January 2010)</p>
<p><a href="http://blog.ondrejsv.com/post/How-to-Create-a-new-format-for-sample-data-in-BlendSketchFlow.aspx">How to: Create a new format for sample data in Blend/SketchFlow</a> (ondrejsv, 17th January 2010)</p>
<p><a href="http://www.infoq.com/articles/guest-simon-sketchflow">Using SketchFlow to Create Better Prototypes</a> (Simon Guest, 29th April 2009)</p>
<p><a href="http://silverzine.com/tutorials/getting-in-depth-with-sketchflow/">Getting in-depth with SketchFlow</a> (Alex Knight, 26th October 2009)</p>
<p><a href="http://videos.visitmix.com/MIX09/C01F">Sketch Flow: From Concept to Production &#8211; MIX &#8216;09 video</a> (Christian Schormann, 20th March 2009)</p>
<p><a href="http://franksworld.com/blog/archive/2009/08/27/11677.aspx">SketchFlow tutorial</a></p>
<p>Thanks for reading.</p>
<p>Download the <a title="SketchFlow prototype source code" href="http://bachelorthesis.zdechovan.com/demoapp/sketchflow/telecosystemsprototype.zip">source code</a> of this project.</p>
]]></content:encoded>
			<wfw:commentRss>http://bachelorthesis.zdechovan.com/how-to-create-advanced-sketchflow-prototype/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Application Architecture Guide</title>
		<link>http://bachelorthesis.zdechovan.com/application-architecture-guide/</link>
		<comments>http://bachelorthesis.zdechovan.com/application-architecture-guide/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 22:11:30 +0000</pubDate>
		<dc:creator>Lukáš Zdechovan</dc:creator>
				<category><![CDATA[Patterns]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[architecture]]></category>

		<guid isPermaLink="false">http://bachelorthesis.zdechovan.com/?p=186</guid>
		<description><![CDATA[ Patterns&#38;Practices team released the second version of .NET Application Architecture Guide, which provides guidance for architecture principles, design principles and trusted patterns.
It helps developers and architects to build more effective, high quality .NET applications.
It is also a good overview of software architecture for students.
Read .NET Application Architecture Guide PDF (on MSDN)
]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-187 alignright" style="margin-top: 5px; margin-bottom: 5px; margin-left: 10px; margin-right: 10px;" title="Patterns and practices logo" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/02/patternspracticeslogo.PNG" alt="Patterns and practices logo" width="190" height="39" /> <a href="http://msdn.microsoft.com/en-us/practices/default.aspx">Patterns&amp;Practices</a> team released the second version of <a href="http://msdn.microsoft.com/en-us/library/dd673617.aspx">.NET Application Architecture Guide</a>, which provides guidance for architecture principles, design principles and trusted patterns.</p>
<p>It helps developers and architects to build more effective, high quality .NET applications.</p>
<p>It is also a<strong> good overview of software architecture</strong> for students.</p>
<p>Read <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ce40e4e1-9838-4c89-a197-a373b2a60df2&amp;DisplayLang=en">.NET Application Architecture Guide PDF</a> (<a href="http://msdn.microsoft.com/en-us/library/dd673617.aspx">on MSDN</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://bachelorthesis.zdechovan.com/application-architecture-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit Testing of Silverlight LoB Applications</title>
		<link>http://bachelorthesis.zdechovan.com/unit-testing-of-silverlight-lob-applications/</link>
		<comments>http://bachelorthesis.zdechovan.com/unit-testing-of-silverlight-lob-applications/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 11:52:20 +0000</pubDate>
		<dc:creator>Lukáš Zdechovan</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[SilverlightTest]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://bachelorthesis.zdechovan.com/?p=163</guid>
		<description><![CDATA[Unit testing has become rather important in the last decade as the need for quality code increased. It is also an essential part of Test-Driven Design which is a part of Extreme Programming.
Probably the most common approach to do unit testing in .NET solutions is by creating special Tests projects in a pair to the [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_164" class="wp-caption alignleft" style="width: 160px"><img class="size-full wp-image-164" title="The Art of Unit Testing book cover" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/02/unit-testing.jpg" alt="Book cover" width="150" height="186" /><p class="wp-caption-text">Book cover</p></div>
<p>Unit testing has become rather important in the last decade as the need for quality code increased. It is also an essential part of Test-Driven Design which is a part of Extreme Programming.</p>
<p>Probably the most common approach to do unit testing in .NET solutions is by creating special Tests projects in a pair to the library we want to test and perform the testing in <a href="http://www.nunit.org/">NUnit </a>. In Silverlight projects we would like to test the business domain logic on the server and the ViewModel classes on the Silverlight client side.</p>
<p>If you haven&#8217;t ever used unit testing read an excellent book <a href="http://www.artofunittesting.com/">The Art of Unit Testing</a> with examples in C# which will guide through both the theory of unit testing and practical examples. There were also a presentation of <a href="http://microsoftpdc.com/Sessions/CL32">Developing Testable Silverlight Application</a> at the Microsoft PDC conference.</p>
<p><em>Note: I plan to enlarge this article later with a real example of Testable Silverlight Application.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://bachelorthesis.zdechovan.com/unit-testing-of-silverlight-lob-applications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Domain-driven design books</title>
		<link>http://bachelorthesis.zdechovan.com/domain-driven-design-books/</link>
		<comments>http://bachelorthesis.zdechovan.com/domain-driven-design-books/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 11:14:42 +0000</pubDate>
		<dc:creator>Lukáš Zdechovan</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[domain model]]></category>
		<category><![CDATA[doman-driven design]]></category>
		<category><![CDATA[Eric Evans]]></category>
		<category><![CDATA[Jimmy Nilsson]]></category>

		<guid isPermaLink="false">http://bachelorthesis.zdechovan.com/?p=143</guid>
		<description><![CDATA[Domain model is a pattern for an object-oriented approach for organizing business logic.
Let me introduce you 2 books which deal with this pattern, previously briefly described in the P of EAA book written by Martin Fowler.
Domain-Driven Design: Tackling Complexity in the Heart of Software
The book offers readers a systematic approach to domain-driven design, presenting an [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/domain-model/">Domain model</a> is a pattern for an object-oriented approach for organizing business logic.<br />
Let me introduce you 2 books which deal with this pattern, previously briefly described in the <a href="/patterns-of-enterprise-application-architecture/">P of EAA</a> book written by Martin Fowler.</p>
<div id="attachment_144" class="wp-caption alignleft" style="width: 160px"><a href="http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215"><img class="size-thumbnail wp-image-144" title="Domain-driven design book cover" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/02/domaindrivendesign-150x150.jpg" alt="Domain-driven design" width="150" height="150" /></a><p class="wp-caption-text">Domain-driven design</p></div>
<p><a href="http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215">Domain-Driven Design: Tackling Complexity in the Heart of Software</a></p>
<p>The book offers readers a systematic approach to <strong>domain-driven design</strong>, presenting an extensive set of design <strong>best practices</strong>, experience-based techniques, and fundamental principles that facilitate the development of software projects facing<strong> complex domains</strong>. Intertwining design and development practice, this book incorporates numerous examples based on actual projects to illustrate the application of domain-driven design to real-world software development.</p>
<p style="text-align: right;"><em>from the back cover</em></p>
<p style="text-align: right;"><em><br />
</em></p>
<p style="text-align: left;">
<p style="text-align: left;">
<div id="attachment_146" class="wp-caption alignleft" style="width: 160px"><a href="http://www.amazon.com/Applying-Domain-Driven-Design-Patterns-Examples/dp/0321268202"><img class="size-thumbnail wp-image-146" title="Applying domain-driven design book cover" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/02/applying-ddd--150x150.jpg" alt="Applying DDD and patterns" width="150" height="150" /></a><p class="wp-caption-text">Applying DDD</p></div>
<p><a href="http://www.amazon.com/Applying-Domain-Driven-Design-Patterns-Examples/dp/0321268202">Applying Domain-Driven Design and Patterns: With Examples in C# and .NET</a><em> </em></p>
<p style="text-align: left;">Applying Domain-Driven Design and Patterns is the first complete, <strong>practical guide</strong> to leveraging <strong>patterns</strong>, <strong>domain-driven design</strong>, and <strong>test-driven development</strong> in .NET environments. Drawing on seminal work by Martin Fowler and Eric Evans, Jimmy Nilsson shows how to customize real-world architectures for any .NET application. You&#8217;ll learn how to prepare domain models for application infrastructure; support business rules; provide persistence support; plan for the presentation layer and UI testing; and design for service orientation or aspect orientation.</p>
<p style="text-align: right;"><em>description of the book at Amazon</em></p>
]]></content:encoded>
			<wfw:commentRss>http://bachelorthesis.zdechovan.com/domain-driven-design-books/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Enable associated entities to load with base entity</title>
		<link>http://bachelorthesis.zdechovan.com/enable-associated-entities-to-load-with-base-entity/</link>
		<comments>http://bachelorthesis.zdechovan.com/enable-associated-entities-to-load-with-base-entity/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 17:04:02 +0000</pubDate>
		<dc:creator>Lukáš Zdechovan</dc:creator>
				<category><![CDATA[Samples]]></category>
		<category><![CDATA[.NET RIA Services]]></category>
		<category><![CDATA[domain model]]></category>
		<category><![CDATA[Entity Framework]]></category>

		<guid isPermaLink="false">http://bachelorthesis.zdechovan.com/?p=104</guid>
		<description><![CDATA[ I encoutered a problem, when I wanted to load Employees entities also with some associated entities at once, from the well-known AdwentureWorks database model (in Entity Framework) via DomainService/Context in a .NET RIA Services SL Application.
So if you encountered the same problem, that initially your associated/referenced entities are null when loaded, read more to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-132" style="margin: 10px;" title="Associated entitites" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/01/association.png" alt="Associated entitites" width="150" height="81" /> I encoutered a problem, when I wanted to load Employees entities also with some associated entities at once, from the well-known AdwentureWorks database model (in Entity Framework) via DomainService/Context in a .NET RIA Services SL Application.</p>
<p>So if you encountered the same problem, that initially your <strong>associated/referenced entities are null</strong> when loaded, read more to see how to solve this issue.</p>
<p><span id="more-104"></span>A week ago, I wanted to bind the DataGrid with Employees from AdventureWorks DB with contact information as FistName, LastName, etc. <a href="http://msdn.microsoft.com/en-us/library/ms124714.aspx">Contact</a> is with <a href="http://msdn.microsoft.com/en-us/library/ms124432.aspx">Employee table</a> associated by ContactID foreign key, so in SQL I would go for inner join (or left outer join) on these two tables.</p>
<p>In my Data Model I had the Employee entity with navigation property Contact.</p>
<p>But when you load it by a service query in your domain context on the client, you&#8217;ll basicly populate your domain context Employees collection with data. Navigation property to Manager is working since, this is also an already laoded Employee entity. But all the other navigation properties like Contact are null. Of course, this is logical, since you probably want don&#8217;t want to transfer a large amount of data, you know, all the associated entities, which you usually do not need.</p>
<p>The usual scenario is that you have a list of entities and you download some detail only after one is selected, for example. In my problem, I had to either change the domain model in way, that Employee entity will contain some of the Contact attributes, but that&#8217;s not correct.</p>
<p>So what you actually have to do, to download entities also with specified associated entities?</p>
<p>At first, open the metadata class for the domain service.<br />
Find the Contact navigation property in the Employee entity class. Add [Include] attribute above the property. This way we tell Ria Services to change the query to get Employee also with associated Contact entity.</p>
<pre class="c-sharp">[Include]
public Entity&lt;Contact&gt; Contact;</pre>
<p>Now change the Domain service class retrieve method to include the Contact.</p>
<pre class="c-sharp">return this.ObjectContext.Employees.Include("Contact");</pre>
]]></content:encoded>
			<wfw:commentRss>http://bachelorthesis.zdechovan.com/enable-associated-entities-to-load-with-base-entity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Localization of Silverlight Business Application (sample)</title>
		<link>http://bachelorthesis.zdechovan.com/localization-of-silverlight-business-application/</link>
		<comments>http://bachelorthesis.zdechovan.com/localization-of-silverlight-business-application/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 16:55:03 +0000</pubDate>
		<dc:creator>Lukáš Zdechovan</dc:creator>
				<category><![CDATA[Samples]]></category>
		<category><![CDATA[.NET RIA Services]]></category>
		<category><![CDATA[Localization]]></category>

		<guid isPermaLink="false">http://bachelorthesis.zdechovan.com/?p=99</guid>
		<description><![CDATA[
Although it looks that localization of Silverlight Business Applications is not worth of writing a post, there are some really inconspicuous problems which you have to resolve.
If you want to localize the application by creating resource files of strings for a particual language (AppStrings.sk-SK.resx, AppString.de-DE.resx) you should definitely read this post (with sample source-code) to [...]]]></description>
			<content:encoded><![CDATA[<div class="mceTemp" style="text-align: left;">
<div id="attachment_102" class="wp-caption alignleft" style="width: 150px"><img class="size-full wp-image-102" title="Illustration - flags" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/01/100-countries1.png" alt="Illustration" width="140" height="114" /><p class="wp-caption-text">Illustration</p></div>
<p>Although it looks that localization of S<strong>ilverlight Business Applications</strong> is not worth of writing a post, there are some really inconspicuous problems which you have to resolve.</div>
<p>If you want to localize the application by creating resource files of strings for a particual language (AppStrings.sk-SK.resx, AppString.de-DE.resx) you should definitely read this post (with sample source-code) to not get into trouble.</p>
<p><span id="more-99"></span></p>
<p>At first I create a New project with Business Application Template.<br />
<img class="size-full wp-image-111" style="margin: 10px;" title="Business Application Template" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/01/1-template.png" alt="Business Application Template" width="584" height="70" /><br />
The strings resource files are in the template located in both Client and Server (Web) projects.<br />
<img class="alignleft size-full wp-image-112" style="margin: 10px;" title="Resource files" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/01/2-resourcefiles.png" alt="Resource files" width="263" height="530" /></p>
<p>The most important resource is the ApplicationStrings.resx file, in which almost all the strings from the client side are stored.</p>
<p>Strings which are used in the login and registration form are stored on the server side in RegistrationDataResources.resx.</p>
<p>To localize the strings you have to create copies of desired resource file with an appropriate sufix according to the culture, so slovak copy of AppStrings will be ApplicationStrings.<strong>sk-SK</strong>.resx. Do the same to all resource files in the project and translate them to your language.</p>
<p style="text-align: left;">Don&#8217;t add resource files to the Web\Resources directory in the client project, because in this folder should be placed just links to files in Resources folder in Web project. Link to a file si added by adding Existing item to client side Web\Resources and choosing &#8220;Add as link&#8221; option.<a href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/01/3-add-links.png"><img class="aligncenter size-thumbnail wp-image-113" style="margin-top: 6px; margin-bottom: 6px;" title="Add as a link" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/01/3-add-links-150x150.png" alt="Add as a link" width="150" height="150" /></a> Till now, we did similar work we do in ASP.NET applications when localizing them.</p>
<p>To test whether it works add following line to App.xaml.cs</p>
<pre name="code" class="c-sharp">
...
using System.Threading;
using System.Globalization;
...
private void Application_Startup(object sender, StartupEventArgs e)
{
    // This will enable you to bind controls in XAML files to WebContext.Current
    // properties
    this.Resources.Add("WebContext", WebContext.Current);

    // This will automatically authenticate a user when using windows authentication
    // or when the user chose "Keep me signed in" on a previous login attempt
    WebContext.Current.Authentication.LoadUser(this.Application_UserLoaded, null);

    //Change current culture to slovak, just for the test
    Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = new CultureInfo("sk-SK");</strong>

    // Show some UI to the user while LoadUser is in progress
    this.InitializeRootVisual();
}
</pre>
<p>Run the project and you&#8217;ll not see any localized string there.</p>
<p>Now, you&#8217;ll have to do a bit of manual work to make your localization working. At first, unload your client side project by right-click on a project and select &#8220;Unload Project&#8221;.<br />
Navigate to the project folder in your filesystem and open the .csproj file in notepad or similar text editor.<br />
Locate &lt;SupportedCultures&gt; element a place there all the culture that you want to have in your app separated by comma (&lt;SupportedCultures&gt;en-US,sk-SK&lt;/SupportedCultures&gt;).</p>
<p>Reload the project back, build it and run. Localization should work.</p>
<div id="attachment_117" class="wp-caption aligncenter" style="width: 310px"><a href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/01/4-localized-page1.png"><img class="size-medium wp-image-117" title="Localized page" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/01/4-localized-page1-300x167.png" alt="Localized page" width="300" height="167" /></a><p class="wp-caption-text">Localized page</p></div>
<p>Now, let&#8217;s look on how to localize new strings, which are not stored as resources. In this template, not localized are &#8220;Home page content&#8221; and &#8220;About page content&#8221; strings.</p>
<p>I created new resourcefiles HomeView.resx and AboutView.resx plus sk-SK localized equivalents and rebuild the project. In those I will store my strings for each view. To enable use of these resoruces in these views, add some piece of code to the ResourceWrapper.cs Helper class, which holds as a StaticResource in the XAMLs.<br />
<em>Note: Your resources are in Assets.Resources namespace in this case.</em></p>
<pre name="code" class="c-sharp">
using Assets.Resources;
...
public sealed class ResourceWrapper
{
private static SecurityQuestions securityQuestions = new SecurityQuestions();
private static HomeView homeView = new HomeView();
private static AboutView aboutView = new AboutView();
...
public HomeView HomeViewStrings
{ get { return homeView; } }

public AboutView AboutViewStrings
{ get { return aboutView; } }
</pre>
<p><span style="font-style: normal;">Then in our XAMLs we may use our ResourceWrapper properties HomeViewStrings and AboutViewStrings to bind to desired string.</span></p>
<pre name="code" class="xml">
&lt;TextBlock ... Text="{Binding Path=HomeViewStrings.HomeContent, Source={StaticResource ResourceWrapper}}" /&gt;
</pre>
<div id="attachment_119" class="wp-caption aligncenter" style="width: 394px"><img class="size-full wp-image-119" title="Localized content" src="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/01/5-localized-content.png" alt="Localized content" width="384" height="167" /><p class="wp-caption-text">Localized content</p></div>
<p><span style="font-style: normal;">You can localize the whole application this way, so I hope this article was helpful.</span></p>
<p><span style="font-style: normal;"><strong>Remember what is the most important:</strong></span></p>
<ol>
<li><span style="font-style: normal;">Change the project file in text editor to allow the client to support different cultures (via SupportedCultures XML node).</span></li>
<li><span style="font-style: normal;">Login and registration resources are stored in the Web project.</span></li>
<li><span style="font-style: normal;">Add your own resourcefiles also to ResourceWrapper.cs Helper class to allow binding to it in XAML file.</span></li>
<li><span style="font-style: normal;">I recommend to set the Access Modifier in default resource files to &#8220;Public&#8221; (default is internal) and for culture-specific resource files to &#8220;No-code generation&#8221;, because we don&#8217;t need it in these.</span></li>
</ol>
<p><a href="http://bachelorthesis.zdechovan.com/wp-content/uploads/2010/01/LocalizedSilverlightApp.zip">Download source code</a> of the sample. (Silverlight 4, .NET 4.0, VS 2010)</p>
<p>If you find some errors in my sample or you would like to share your knowledge about localization, some new ideas, etc, please leave comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://bachelorthesis.zdechovan.com/localization-of-silverlight-business-application/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

