<?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>Akash Kava &#187; C#</title>
	<atom:link href="http://akashkava.com/blog/category/programming/cs/feed/" rel="self" type="application/rss+xml" />
	<link>http://akashkava.com/blog</link>
	<description>Founder of NeuroSpeech</description>
	<lastBuildDate>Tue, 10 Apr 2012 18:00:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Entity Atoms Flex Edition released</title>
		<link>http://akashkava.com/blog/428/entity-atoms-flex-edition-released/</link>
		<comments>http://akashkava.com/blog/428/entity-atoms-flex-edition-released/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 18:00:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[Entity]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[Flex Mobile]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linq]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[RIA Services]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/428/entity-atoms-flex-edition-released/</guid>
		<description><![CDATA[We are happy to announce release of Entity Atoms Flex Edition, which provides client frameworks and tools for ASP.NET MVC and RIA Services to access Entity Framework on any mobile platforms. Microsoft’s latest Entity Framework makes it very easy to setup complex transactional applications. However in order to extend Change Set, Authorization and Audit controls [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/428/entity-atoms-flex-edition-released/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Entity+Atoms+Flex+Edition+released";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F428%2Fentity-atoms-flex-edition-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F428%2Fentity-atoms-flex-edition-released%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We are happy to announce release of <a href="http://entityatoms.neurospeech.com/" target="_blank">Entity Atoms Flex Edition</a>, which provides client frameworks and tools for ASP.NET MVC and RIA Services to access Entity Framework on any mobile platforms.</p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto" src="http://store.neurospeech.com/products/entityatoms/screenshot" width="590" height="284" /></p>
<p>Microsoft’s latest Entity Framework makes it very easy to setup complex transactional applications. However in order to extend Change Set, Authorization and Audit controls to all mobile platforms Entity Atoms was designed.</p>
<p>Currently, only Flex Edition is available for download, Flex Edition lets you create Flex Mobile application that can execute on any mobile platform.</p>
<p>We are going to release new native framework and tools for major mobile platforms very soon.</p>
<h1>Key Highlights</h1>
<ul>
<li>Extend Entity Framework to all platforms using RIA Services </li>
<li>Simple LINQ Expression Rules to enable Security </li>
<li>Enable Table Audits/History including Cascade Delete </li>
<li>Customizable Code Generator (Flex, Android, C#, VB.net) </li>
<li>Simple Client and Server side validations </li>
<li>Easy Access to related entities (navigation properties) </li>
<li>JSON Endpoint with Date Handling </li>
<li>Additional UI Elements for Flex Mobile </li>
<li>Advanced Search (Search navigation properties) </li>
<li>Full ChangeSet management at Client Side </li>
<li>Unit Of Work pattern at Client Side </li>
</ul>
<h2>System Requirements</h2>
<ul>
<li>Windows 7, Windows Vista Service Pack 2,Windows XP Professional. </li>
<li>Microsoft .NET Framework 4.0 and above. </li>
<li>Microsoft Visual Studio 2010 </li>
<li>Flash Builder 4.6 </li>
<li>MS SQL Express 2005 onwards or MySQL or Oracle </li>
</ul>
<h3><a href="http://store.neurospeech.com/products/entityatoms/download" target="_blank">Click here to Download Free Demo</a></h3>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F428%2Fentity-atoms-flex-edition-released%2F&amp;title=Entity%20Atoms%20Flex%20Edition%20released"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/428/entity-atoms-flex-edition-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MEF vs. Unity in composite application (Prism)</title>
		<link>http://akashkava.com/blog/391/mef-vs-unity-in-composite-application-prism/</link>
		<comments>http://akashkava.com/blog/391/mef-vs-unity-in-composite-application-prism/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 07:40:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[MEF]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Prism]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/?p=391</guid>
		<description><![CDATA[This article describes differences between MEF and Unity which may help you in deciding which technology you must use while making composite application. Both technologies are useful and easy to understand, and offer a rich set of features that can make integration of various software components very easy. However, both being little different in functioning [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/391/mef-vs-unity-in-composite-application-prism/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "MEF+vs.+Unity+in+composite+application+%28Prism%29";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F391%2Fmef-vs-unity-in-composite-application-prism%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F391%2Fmef-vs-unity-in-composite-application-prism%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This article describes differences between MEF and Unity which may help you in deciding which technology you must use while making composite application.
</p>
<p>Both technologies are useful and easy to understand, and offer a rich set of features that can make integration of various software components very easy. However, both being little different in functioning they offer exact same level of features but choosing wrong one can lead to chaos.
</p>
<p>So we will drill down to differences between their operations.
</p>
<div>
<table style="border-collapse:collapse" border="0">
<colgroup>
<col style="width:284px"/>
<col style="width:344px"/></colgroup>
<tbody valign="top">
<tr style="background: #d9d9d9">
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  solid #d9d9d9 0.5pt; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Unity</p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  solid #d9d9d9 0.5pt; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>MEF</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Unity creates new instance of type by default.</p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>MEF creates singleton instance of type by default.</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Unity does not require registration for classes. This means you can instantiate any other third party type.</p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>MEF requires Export attribute to be specified on the class. MEF cannot create instance of third party type unless it defines Export.</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Unity requires type registration in code for interface types.</p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>No registration, simple Export attribute does it all.</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Unity container can compose IUnityContainer property in the composed class where you can further access it easily in your own scope. This behavior is not useful for Plugin architecture as getting access to IUnityContainer may result in full access to your application.</p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>MEF does not allow composition of CompositionContainer, which blocks access to MEF in your own scope if you do not have CompositionContainer. This is useful in Plugin architecture where third party code has limited access to your application. </p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Unity offers injection method mechanism, that can define IUnityContainer parameter and get the unity container object, with which you can compose other private properties manually.</p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>MEF can only compose public properties, this is dangerous as anyone can change public property and make application crash easily.</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Inside your application&#8217;s framework code, Unity serves the best as it gives you full control over type hierarchy, lifecycle and allows you to utilize third party components easily without writing much of code. </p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Inside your application, MEF will put lots of restrictions in which your framework can operate as it cannot easily compose third party components and it will force you to write numerous attributes in your code without which it will fail drastically.</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Mostly, User Interface objects like your View, or UserControl or any UIElement can never be shared as no UIElement can have two parents at same time. So default behavior of Unity to create a new instance of type is very helpful.</p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Default behavior of MEF will create only one single instance of UI object, that will lead to trouble, not only that, if UI object is third party tool, MEF will not compose it. You can create multiple copies of exported type by specifying one more attribute called [PartCreationPolicy(Shared)], however it is very time comsuming and tedious to define this one every UI related type we create.</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Unity does allow singleton objects, but for that you have to register an instance to the container.</p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>MEF by default creates singleton object only.</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Unity does not allow multiple registrations for same instance in same scope sharing same interface but different type. </p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>MEF allows multiple singleton objects of different type sharing same interface.</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Unity works best for MVVM, as composing user interface parts can be very easy with unity.</p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>MEF does not work great with MVVM as it will create singleton objects that will behave strangely in runtime and lead to UI failure.</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>Unity is not good for Modularity, as composing IUnityContainer will offer more control of unity lifecycle to third party modules.</p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>MEF is good for Modularity, as it will not allow modification of composition thus offering great deal of security between modules.</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  solid #d9d9d9 0.5pt; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>So, to develop a framework, MVVM Crud application and a UI framework, Unity is the best.</p>
</td>
<td vAlign="middle" style="padding-top: 2px; padding-left: 2px; padding-bottom: 2px; padding-right: 2px; border-top:  none; border-left:  none; border-bottom:  solid #d9d9d9 0.5pt; border-right:  solid #d9d9d9 0.5pt">
<p>To expose some functionality of your application for third party modules to register and access limited functionality, MEF is the best.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p> <br />
 </p>
<p>Following is outline of how your application should be,
</p>
<p>Unity Container must compose and manage your application&#8217;s framework, UI and MEF modules.
</p>
<p>MEF will only expose limited functionality from Unity Container to third party modules.
</p>
<p>No module, through MEF should have access to unity container at all.
</p>
<p><img src="http://akashkava.com/blog/wp-content/uploads/2011/04/042711_0740_MEFvsUnityi12.png" alt=""/>
	</p>
<p>Thank you for reading this article, please put your suggestions below in the comment. I do not intend to make any specific rules and regulations here but I am suggesting the architecture based on the differences I have outlined.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F391%2Fmef-vs-unity-in-composite-application-prism%2F&amp;title=MEF%20vs.%20Unity%20in%20composite%20application%20%28Prism%29"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/391/mef-vs-unity-in-composite-application-prism/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>UI Atoms 1.7.5 Released</title>
		<link>http://akashkava.com/blog/387/ui-atoms-1-7-5-released/</link>
		<comments>http://akashkava.com/blog/387/ui-atoms-1-7-5-released/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 09:04:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Customize]]></category>
		<category><![CDATA[DataForm]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/387/ui-atoms-1-7-5-released/</guid>
		<description><![CDATA[We are happy to announce new release of UI Atoms 1.7.5 with following new features. New AtomDataForm Control Tabs in AtomForm and AtomDataForm Lambda Binding Extensions Introducing new Control AtomDataForm AtomForm did support UI Validations, however Microsoft RIA Services Client has some inbuilt validation and support for IEditableObject. So we created a new AtomDataForm that [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/387/ui-atoms-1-7-5-released/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "UI+Atoms+1.7.5+Released";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F387%2Fui-atoms-1-7-5-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F387%2Fui-atoms-1-7-5-released%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We are happy to announce new release of UI Atoms 1.7.5 with following new features.</p>
<ol>
<li>New AtomDataForm Control </li>
<li>Tabs in AtomForm and AtomDataForm </li>
<li>Lambda Binding Extensions </li>
</ol>
<h2>Introducing new Control AtomDataForm</h2>
<p>AtomForm did support UI Validations, however Microsoft RIA Services Client has some inbuilt validation and support for IEditableObject. So we created a new AtomDataForm that supports RIA Services validation and IEditableObject support.</p>
<ol>
<li>AtomDataForm supports object with IEditableObject interface and fires event for BeginEdit, CancelEdit and EndEdit </li>
<li>AtomDataForm displays items in read only mode unless Edit button is clicked </li>
<li>After edit button is clicked, Save and Cancel button appear for you to persist changes or cancel changes </li>
<li>AtomDataForm contains UI Element (TextBox, ComboBox etc) as children, so you can easily define child ui element in your xaml as shown in sample below </li>
<li>AtomDataForm supports Tabbed layout, for that you can insert your items within AtomDataFormTab as shown in example below </li>
<li>Following sample illustrates Tabs, but you can also create simple user interface without tab as well </li>
<li>You can also use AtomDataFormGroup to group items in to a headered group </li>
<li>Every child element of AtomDataForm can be accessed in code behind file easily because they appear as a variables when you define x:Name property </li>
<li>AtomDataForm supports CanChangeDataContext property, which is false when the form is in edit mode </li>
<li>You can easily reuse any third party control within AtomDataForm, AtomDataFormGroup and AtomDataFormTab </li>
</ol>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:4af705bb-bc40-4470-8c60-7e87ee7745ca" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">AtomDataForm Sample</div>
<div style="background: #ddd; max-height: 500px; overflow: auto">
<ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap">
<li><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm</span> </li>
<li>   <span style="color:#ff0000"> Grid.Column</span><span style="color:#0000ff">=&quot;1&quot;</span> </li>
<li>   <span style="color:#ff0000"> DataContext</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> SelectedItem</span><span style="color:#0000ff">,</span><span style="color:#ff0000">ElementName</span><span style="color:#0000ff">=dataGrid}&quot; &gt;</span></li>
<li>            <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; 1st Tab&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#ff0000"> Header</span><span style="color:#0000ff">=&quot;Default&quot;&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span> </li>
<li>           <span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Name:&quot;</span> </li>
<li>           <span style="color:#ff0000"> Text</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> ProductName</span><span style="color:#0000ff">,</span><span style="color:#ff0000"> Mode</span><span style="color:#0000ff">=TwoWay}&quot;/&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomToggleButtonBar</span> </li>
<li>           <span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Type:&quot;</span></li>
<li>           <span style="color:#ff0000"> SelectedItem</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> ProductType</span><span style="color:#0000ff">,</span><span style="color:#ff0000">Mode</span><span style="color:#0000ff">=TwoWay}&quot;&gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">sys</span><span style="color:#0000ff">:</span><span style="color:#a31515">String</span><span style="color:#0000ff">&gt;</span><span style="color:#a31515">Product</span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">sys</span><span style="color:#0000ff">:</span><span style="color:#a31515">String</span><span style="color:#0000ff">&gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">sys</span><span style="color:#0000ff">:</span><span style="color:#a31515">String</span><span style="color:#0000ff">&gt;</span><span style="color:#a31515">Service</span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">sys</span><span style="color:#0000ff">:</span><span style="color:#a31515">String</span><span style="color:#0000ff">&gt;</span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomToggleButtonBar</span><span style="color:#0000ff">&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span></li>
<li>           <span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Folder:&quot;&gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm.CommandBox</span><span style="color:#0000ff">&gt;</span></li>
<li>                <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">Button</span><span style="color:#ff0000"> Content</span><span style="color:#0000ff">=&quot;&#8230;&quot;/&gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm.CommandBox</span><span style="color:#0000ff">&gt;</span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">TextBox</span><span style="color:#0000ff">&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#0000ff">&gt;</span></li>
<li>            <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; 2nd Tab&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#ff0000"> Header</span><span style="color:#0000ff">=&quot;General&quot;&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span> </li>
<li>           <span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Email:&quot;</span>  </li>
<li>           <span style="color:#ff0000"> Text</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> Email</span><span style="color:#0000ff">,</span><span style="color:#ff0000"> Mode</span><span style="color:#0000ff">=TwoWay}&quot;/&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#0000ff">&gt;</span></li>
<li>            <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; 3rd Conditional Tab&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; This tab will be visible only if Product&#39;s </span></li>
<li>    <span style="color:#008000">IsTypeService is true&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span> </li>
<li>       <span style="color:#ff0000"> Header</span><span style="color:#0000ff">=&quot;Service&quot;</span> </li>
<li>       <span style="color:#ff0000"> IsEnabled</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> IsTypeService}</span><span style="color:#0000ff">&quot;&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span> </li>
<li>           <span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Service Details:&quot;/&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#0000ff">&gt;</span></li>
<li>&nbsp;</li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; 4th Conditional Tab&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#008000">&lt;!&#8211; This tab will be visible only if Product&#39;s </span></li>
<li>    <span style="color:#008000">IsTypeProduct is true&#8211;&gt;</span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span> </li>
<li>       <span style="color:#ff0000"> Header</span><span style="color:#0000ff">=&quot;Product&quot;</span> </li>
<li>       <span style="color:#ff0000"> IsEnabled</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> IsTypeProduct}</span><span style="color:#0000ff">&quot;&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span><span style="color:#ff0000"> ns</span><span style="color:#0000ff">:</span><span style="color:#ff0000">AtomDataForm.Label</span><span style="color:#0000ff">=&quot;Product Details:&quot;</span> <span style="color:#0000ff"> &gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm.CommandBox</span><span style="color:#0000ff">&gt;</span></li>
<li>                <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">Button</span><span style="color:#ff0000"> Content</span><span style="color:#0000ff">=&quot;Search&quot;/&gt;</span></li>
<li>            <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm.CommandBox</span><span style="color:#0000ff">&gt;</span></li>
<li>        <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">TextBox</span><span style="color:#0000ff">&gt;</span></li>
<li>                <span style="color:#a31515"></span></li>
<li>    <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataFormTab</span><span style="color:#0000ff">&gt;</span></li>
<li>            <span style="color:#a31515"></span></li>
<li><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">ns</span><span style="color:#0000ff">:</span><span style="color:#a31515">AtomDataForm</span><span style="color:#0000ff">&gt;</span></li>
</ol></div>
</p></div>
</p></div>
<p>In above sample you can notice following things,</p>
<ol>
<li>Header property of AtomDataFormTab is displayed in the title section on the top </li>
<li>AtomDataFormTab contains children and each child can have properties as below
<ol>
<li>ns:AtomDataForm.Label displays label on left side </li>
<li>ns:AtomDataForm.Description displays description on bottom </li>
<li>ns:AtomDataForm.Title displays title on the top of control </li>
<li>ns:AtomDataForm.CommandBox displays a UI Element on the right corner, usually a search button or expand button </li>
</ol>
</li>
<li>AtomDataFormTab supports IsEnabled binding, you can bind this property to show/hide the tab as shown in the example above </li>
<li>Every child elemen of either AtomDataForm , AtomDataFormTab or AtomDataFormGroup supports Visibility and IsEnabled binding
<ol>
<li>If Visibility is bound and it results in Collapsed then entire form item is not displayed </li>
<li>IsEnabled binding can enable/disable the editable control </li>
</ol>
</li>
</ol>
<p>Following is screenshot of Tabbed AtomDataForm in edit mode</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2011/04/AtomDataForm.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="AtomDataForm" border="0" alt="AtomDataForm" src="http://akashkava.com/blog/wp-content/uploads/2011/04/AtomDataForm_thumb.png" width="367" height="275" /></a></p>
<h2>Introducing Lambda Binder Extensions</h2>
<p>Writing binding expressions with conditions and converters can be very complex especially rewriting many and same logic at different classes. Now UI Atoms support, Lambda Binding Extensions which lets you do binding within the code without creating any complex IValueConverter implementation.</p>
<h3>Bind Method Extension</h3>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:e332ae3d-d3f7-4a80-9c53-c235f4c6914e" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">Element Property Binding</div>
<div style="background: #ddd; max-height: 300px; overflow: auto">
<ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;">
<li>theForm.Bind(<span style="color:#2b91af">AtomDataForm</span>.HeaderProperty,</li>
<li>    () =&gt; <span style="color:#0000ff">string</span>.Format(<span style="color:#a31515">&quot;{0} ({1})&quot;</span>,</li>
<li>            productName.Text,</li>
<li>            typeToggleButtonBar.SelectedItem</li>
<li>        ));</li>
</ol></div>
</p></div>
</p></div>
<p>This will bind theForm’s Header property to an expression that will combine properties of two different elements. And this will also automatically update when any of bound source or its property will change.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:3002cb7e-bef1-4f9b-9df1-b62ba184b9b3" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">DataContext Property Binding</div>
<div style="background: #ddd; max-height: 300px; overflow: auto">
<ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;">
<li>theForm.Bind(<span style="color:#2b91af">AtomDataForm</span>.HeaderProperty, </li>
<li>    () =&gt; <span style="color:#0000ff">string</span>.Format(<span style="color:#a31515">&quot;{0} ({1})&quot;</span>,</li>
<li>            theForm.DataContext.Property(<span style="color:#a31515">&quot;ProductName&quot;</span>),</li>
<li>            theForm.DataContext.Property(<span style="color:#a31515">&quot;ProductType&quot;</span>)</li>
<li>        ));</li>
</ol></div>
</p></div>
</p></div>
<p>Assuming, we may not have property information at design time, but we know that DataContext will be set to an object containing properties, then we can write Property extension method as shown above.</p>
<h3>BindVisibility Method Extension</h3>
<p>Visibility converters are very frequent so we created a BindVisibility extension method that will let you specify a boolean expression that will be converted to Visibility on the fly.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:a064c496-433a-43e7-a96f-5b55bd5a8449" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">BindVisibility Extension</div>
<div style="background: #ddd; max-height: 300px; overflow: auto">
<ol style="background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;">
<li>productTab.BindVisibility(</li>
<li>    () =&gt; </li>
<li>        typeToggleButtonBar.SelectedIndex == 0);</li>
</ol></div>
</p></div>
</p></div>
<p>These extensions can be used anywhere in any third party controls as well.</p>
<h3>Download Now</h3>
<p><a href="http://uiatoms.neurospeech.com/v1/download/UIAtoms2010Demo.zip" target="_blank">Click here</a> to download your free demo copy of NeuroSpeech UI Atoms 1.7.5</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F387%2Fui-atoms-1-7-5-released%2F&amp;title=UI%20Atoms%201.7.5%20Released"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/387/ui-atoms-1-7-5-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lambda Binder for WPF and Silverlight</title>
		<link>http://akashkava.com/blog/382/lamda-binder-for-wpf-and-silverlight/</link>
		<comments>http://akashkava.com/blog/382/lamda-binder-for-wpf-and-silverlight/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 10:19:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Binding]]></category>
		<category><![CDATA[Expression]]></category>
		<category><![CDATA[Lambda]]></category>
		<category><![CDATA[Linq]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[MultiBinding]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/382/lamda-binder-for-wpf-and-silverlight/</guid>
		<description><![CDATA[LambdaBinder class helps in creating complex binding expressions without having to create IValueConverter and IMultiValueConverter, it lets you write inline expresions with advanced binding scenarios. Lets say, you have two TextBox for first and last name and you want a Title to be displayed as addition of both. So lets say, you can write it [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/382/lamda-binder-for-wpf-and-silverlight/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Lambda+Binder+for+WPF+and+Silverlight";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F382%2Flamda-binder-for-wpf-and-silverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F382%2Flamda-binder-for-wpf-and-silverlight%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>LambdaBinder class helps in creating complex binding expressions without having to create IValueConverter and IMultiValueConverter, it lets you write inline expresions with advanced binding scenarios.</p>
<p>Lets say, you have two TextBox for first and last name and you want a Title to be displayed as addition of both.</p>
<p>So lets say, you can write it as follow,</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:9061959b-fde6-475a-bf14-95c7053acc05" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">Adding Two Properties</div>
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px;">title.Bind(<span style="color:#2b91af">TextBlock</span>.TextProperty, <br />     () =&gt; firstName.Text + <span style="color:#a31515">&quot; &quot;</span> + lastName.Text);</div>
</p></div>
</p></div>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:be7019f9-9dce-4972-870e-e80107dfd84c" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">Formatting Properties</div>
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px;">title.Bind(<span style="color:#2b91af">TextBlock</span>.TextProperty, <br />     () =&gt; <span style="color:#0000ff">string</span>.Format(<span style="color:#a31515">&quot;{0} {1}&quot;</span>, <br />         firstName.Text, lastName.Text));</div>
</p></div>
</p></div>
<p>You can pass on the Linq expression to Bind extension method of LamdaBinder and that will convert and set binding so that anytime if firstName or lastName is modified, the title will be updated automatically.</p>
<p>Assuming I want some hypothetical visibility logic, for example, only if the firstName is entered, lastName should be visible.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:5714191b-945b-42ad-ab19-bb35ba18d822" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">Conditional Visibility Binding</div>
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px;">lastName.Bind(<span style="color:#2b91af">TextBox</span>.VisibilityProperty, <br />     () =&gt; firstName.Text.Length &gt; 0 ? <span style="color:#2b91af">Visibility</span>.Visible : <br />         <span style="color:#2b91af">Visibility</span>.Collapsed);</div>
</p></div>
</p></div>
<p>You can also use this to avoid writing IValueConverters and do inline binding in code very easily.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:3581c9f9-18d6-4824-97c5-f4d710e7ecd4" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">Lambda Binder</div>
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px;"><span style="color:#0000ff">public</span> <span style="color:#0000ff">static</span> <span style="color:#0000ff">class</span> <span style="color:#2b91af">LambdaBinder</span><br /> {</p>
<p>     <span style="color:#0000ff">public</span> <span style="color:#0000ff">static</span> <span style="color:#0000ff">void</span> Bind(<br />         <span style="color:#0000ff">this</span> <span style="color:#2b91af">DependencyObject</span> dest, <br />         <span style="color:#2b91af">DependencyProperty</span> destProperty, <br />         <span style="color:#2b91af">Expression</span>&lt;Func&lt;<span style="color:#0000ff">object</span>&gt;&gt; func)<br />     {<br />         <span style="color:#2b91af">MultiBinding</span> b = <span style="color:#0000ff">new</span> <span style="color:#2b91af">MultiBinding</span>();<br />         b.Converter = <span style="color:#0000ff">new</span> <span style="color:#2b91af">MultiDelegateConverter</span>(func.Compile());<br />         <span style="color:#2b91af">LambdaBindingBuilder</span> bb = <span style="color:#0000ff">new</span> <span style="color:#2b91af">LambdaBindingBuilder</span>(b);<br />         bb.Visit(func.Body);<br />         <span style="color:#2b91af">BindingOperations</span>.SetBinding(dest, destProperty, b);<br />     }</p>
<p> }</p>
<p> <span style="color:#0000ff">public</span> <span style="color:#0000ff">class</span> <span style="color:#2b91af">LambdaBindingBuilder</span> : <span style="color:#2b91af">ExpressionVisitor</span><br /> {<br />     <span style="color:#0000ff">private</span> <span style="color:#2b91af">MultiBinding</span> multiBinding;</p>
<p>     <span style="color:#0000ff">private</span> <span style="color:#0000ff">string</span> lastPath = <span style="color:#0000ff">null</span>;</p>
<p>     <span style="color:#0000ff">public</span> LambdaBindingBuilder(<span style="color:#2b91af">MultiBinding</span> mb)<br />     {<br />         <span style="color:#0000ff">this</span>.multiBinding = mb;<br />     }</p>
<p>     <span style="color:#0000ff">protected</span> <span style="color:#0000ff">override</span> System.Linq.Expressions.<span style="color:#2b91af">Expression</span> VisitMember(<span style="color:#2b91af">MemberExpression</span> node)<br />     {<br />         <span style="color:#2b91af">PropertyInfo</span> p = node.Member <span style="color:#0000ff">as</span> <span style="color:#2b91af">PropertyInfo</span>;<br />         <span style="color:#0000ff">if</span> (p != <span style="color:#0000ff">null</span>) {<br />             <span style="color:#0000ff">if</span> (<span style="color:#0000ff">string</span>.IsNullOrWhiteSpace(lastPath))<br />             {<br />                 lastPath = p.Name;<br />             }<br />             <span style="color:#0000ff">else</span> {<br />                 lastPath = p.Name + <span style="color:#a31515">&quot;.&quot;</span> + lastPath;<br />             }<br />         }<br />         <span style="color:#2b91af">FieldInfo</span> f = node.Member <span style="color:#0000ff">as</span> <span style="color:#2b91af">FieldInfo</span>;<br />         <span style="color:#0000ff">if</span> (f != <span style="color:#0000ff">null</span>) { <br />             <span style="color:#2b91af">Binding</span> b = <span style="color:#0000ff">new</span> <span style="color:#2b91af">Binding</span>(lastPath);<br />             b.Source = System.Linq.Expressions.<span style="color:#2b91af">Expression</span>.Lambda&lt;Func&lt;<span style="color:#0000ff">object</span>&gt;&gt;(node).Compile()();<br />             multiBinding.Bindings.Add(b);<br />             lastPath = <span style="color:#0000ff">null</span>;<br />         }<br />         <span style="color:#0000ff">return</span> <span style="color:#0000ff">base</span>.VisitMember(node);<br />     }</p>
<p>     <span style="color:#0000ff">protected</span> <span style="color:#0000ff">override</span> System.Linq.Expressions.<span style="color:#2b91af">Expression</span> VisitConstant(<span style="color:#2b91af">ConstantExpression</span> node)<br />     {<br />         <span style="color:#0000ff">if</span> (!<span style="color:#0000ff">string</span>.IsNullOrWhiteSpace(lastPath)) {<br />             <span style="color:#2b91af">Binding</span> b = <span style="color:#0000ff">new</span> <span style="color:#2b91af">Binding</span>(lastPath);<br />             b.Source = node.Value;<br />             multiBinding.Bindings.Add(b);<br />             lastPath = <span style="color:#0000ff">null</span>;<br />         }<br />         <span style="color:#0000ff">return</span> <span style="color:#0000ff">base</span>.VisitConstant(node);<br />     }<br /> }</p>
<p> <span style="color:#0000ff">public</span> <span style="color:#0000ff">class</span> <span style="color:#2b91af">MultiDelegateConverter</span> : <span style="color:#2b91af">IMultiValueConverter</span><br /> {<br />     <span style="color:#0000ff">private</span> Func&lt;<span style="color:#0000ff">object</span>&gt; func;</p>
<p>     <span style="color:#0000ff">public</span> MultiDelegateConverter(Func&lt;<span style="color:#0000ff">object</span>&gt; func)<br />     {<br />         <span style="color:#0000ff">this</span>.func = func;<br />     }</p>
<p>     <span style="color:#0000ff">public</span> <span style="color:#0000ff">object</span> Convert(<span style="color:#0000ff">object</span>[] values, <br />         <span style="color:#2b91af">Type</span> targetType, <br />         <span style="color:#0000ff">object</span> parameter, <br />         System.Globalization.<span style="color:#2b91af">CultureInfo</span> culture)<br />     {<br />         <span style="color:#0000ff">return</span> func();<br />     }</p>
<p>     <span style="color:#0000ff">public</span> <span style="color:#0000ff">object</span>[] ConvertBack(<span style="color:#0000ff">object</span> value, <br />         <span style="color:#2b91af">Type</span>[] targetTypes, <br />         <span style="color:#0000ff">object</span> parameter, <br />         System.Globalization.<span style="color:#2b91af">CultureInfo</span> culture)<br />     {<br />         <span style="color:#0000ff">throw</span> <span style="color:#0000ff">new</span> <span style="color:#2b91af">NotImplementedException</span>();<br />     }<br /> }</div>
</p></div>
</p></div>
<p>&#160;</p>
<p>LambdaBinder is part of UI Atoms suite. At NeuroSpeech, we do research on UI and we are coming up with more interesting featues in UI Atoms.</p>
<p>Please <a href="http://uiatoms.neurospeech.com/silverlight/" target="_blank">Click Here</a> to download latest update of UI Atoms with AtomForm including Tabs in the form.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F382%2Flamda-binder-for-wpf-and-silverlight%2F&amp;title=Lambda%20Binder%20for%20WPF%20and%20Silverlight"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/382/lamda-binder-for-wpf-and-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detach Entities Recursively and Attach to New DomainContext in Entity Framework and RIA Services</title>
		<link>http://akashkava.com/blog/379/detach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services/</link>
		<comments>http://akashkava.com/blog/379/detach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 08:03:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[EF]]></category>
		<category><![CDATA[EF4]]></category>
		<category><![CDATA[Entity]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[RIA Services]]></category>
		<category><![CDATA[Services]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/?p=379</guid>
		<description><![CDATA[Entity Framework and RIA Services do not allow Entities to be added/removed from cross containers. In order to move Entity from one DomainContext/ObjectContext to another DomainContext/ObjectContext, we need to recursively detach the object graph and attach it to other DomainContext/ObjectContext. Object Graph Single entity can be easily detached and attached from EntitySet where it belongs, [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/379/detach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Detach+Entities+Recursively+and+Attach+to+New+DomainContext+in+Entity+Framework+and+RIA+Services";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F379%2Fdetach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F379%2Fdetach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Entity Framework and RIA Services do not allow Entities to be added/removed from cross containers. In order to move Entity from one DomainContext/ObjectContext to another DomainContext/ObjectContext, we need to recursively detach the object graph and attach it to other DomainContext/ObjectContext.</p>
<h2>Object Graph</h2>
<p>Single entity can be easily detached and attached from EntitySet where it belongs, but the problem comes when navigation properties of entity are not empty. Entity object along with navigation properties is called Object Graph because if you notice, navigation property’s navigation property will contain reference to same entity and that will result in endless recursive code for Detach/Attach.</p>
<h2>An entity with the same identity already exists in the EntitySet</h2>
<p>When you try to detach entity from old DomainContext/ObjectContext and attach it to DomainContext/ObjectContext, it may give you an error that entity with same identity already exists and it will throw an exception. In this case we will just simply reuse the existing entity instead of attaching the entity we have.</p>
<h2>Entity cannot be attached to this EntityContainer because it is already attached to another EntityContainer</h2>
<p>In case of ObjectGraph, your root level entity is already detached, but navigation properties are not detached, and while you try to attach your root level entity, it will throw same error for entities that exist in navigation properties.&#160; Because detach method does not recursively detach every entity from navigation properties.</p>
<h2>Attach/Detach Extension Methods</h2>
<p>Finally after brainstorming little, I made following class that will allow you to recursively detach/attach object graphs from DomainContext. You can replace DomainContext to ObjectContext to use it inside Entity Framework.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:1357a75c-1e52-42b7-8917-81a262c881ac" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">DomainContext Extensions</div>
<div style="background: #ddd; overflow: auto">
<ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap">
<li><span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;summary&gt;</span></li>
<li style="background: #f3f3f3"><span style="color:#808080">///</span><span style="color:#008000"> DomainContext Extensions</span></li>
<li><span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;/summary&gt;</span></li>
<li style="background: #f3f3f3"><span style="color:#0000ff">public</span> <span style="color:#0000ff">static</span> <span style="color:#0000ff">class</span> <span style="color:#2b91af">DomainContextExtensions</span> {</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;summary&gt;</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> Recursively Attaches entity loaded from Other DomainContext to </span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> current specified DomainContext</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;/summary&gt;</span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;param name=&quot;context&quot;&gt;</span><span style="color:#008000">DomainContext where entity will be attached</span><span style="color:#808080">&lt;/param&gt;</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;param name=&quot;entity&quot;&gt;</span><span style="color:#008000">Entity loaded from other DomainContext</span><span style="color:#808080">&lt;/param&gt;</span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;returns&gt;&lt;/returns&gt;</span></li>
<li>    <span style="color:#0000ff">public</span> <span style="color:#0000ff">static</span> <span style="color:#2b91af">Entity</span> Attach(<span style="color:#0000ff">this</span> <span style="color:#2b91af">DomainContext</span> context, <span style="color:#2b91af">Entity</span> entity)</li>
<li style="background: #f3f3f3">    {</li>
<li>        <span style="color:#0000ff">if</span> (entity == <span style="color:#0000ff">null</span> || entity.EntityState != <span style="color:#2b91af">EntityState</span>.Detached)</li>
<li style="background: #f3f3f3">            <span style="color:#0000ff">return</span> entity;</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">        <span style="color:#2b91af">Entity</span> newEntity = entity;</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">        <span style="color:#2b91af">Entity</span>[] list = <span style="color:#0000ff">new</span> <span style="color:#2b91af">Entity</span>[] { entity };</li>
<li>        <span style="color:#0000ff">foreach</span> (<span style="color:#2b91af">Entity</span> c <span style="color:#0000ff">in</span> context.EntityContainer.LoadEntities(list, </li>
<li style="background: #f3f3f3">            <span style="color:#2b91af">LoadBehavior</span>.MergeIntoCurrent))</li>
<li>        {</li>
<li style="background: #f3f3f3">            newEntity = c;</li>
<li>            <span style="color:#0000ff">break</span>;</li>
<li style="background: #f3f3f3">        }</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">        <span style="color:#008000">// recursively attach all entities..</span></li>
<li>        <span style="color:#2b91af">Type</span> entityType = <span style="color:#0000ff">typeof</span>(<span style="color:#2b91af">Entity</span>);</li>
<li style="background: #f3f3f3">&nbsp;</li>
<li>        <span style="color:#008000">// get all navigation properties&#8230;</span></li>
<li style="background: #f3f3f3">        <span style="color:#2b91af">Type</span> type = entity.GetType();</li>
<li>        <span style="color:#0000ff">foreach</span> (<span style="color:#0000ff">var</span> item <span style="color:#0000ff">in</span> type.GetProperties())</li>
<li style="background: #f3f3f3">        {</li>
<li>            <span style="color:#0000ff">if</span> (entityType.IsAssignableFrom(item.PropertyType))</li>
<li style="background: #f3f3f3">            {</li>
<li>                <span style="color:#2b91af">Entity</span> navEntity = Attach(context, item.GetValue(entity, <span style="color:#0000ff">null</span>) </li>
<li style="background: #f3f3f3">                    <span style="color:#0000ff">as</span> <span style="color:#2b91af">Entity</span>);</li>
<li>                item.SetValue(newEntity,navEntity, <span style="color:#0000ff">null</span>);</li>
<li style="background: #f3f3f3">                <span style="color:#0000ff">continue</span>;</li>
<li>            }</li>
<li style="background: #f3f3f3">            <span style="color:#0000ff">if</span> (item.PropertyType.Name.StartsWith(<span style="color:#a31515">&quot;EntityCollection&quot;</span>))</li>
<li>            {</li>
<li style="background: #f3f3f3">                <span style="color:#2b91af">IEnumerable</span> coll = item.GetValue(entity, <span style="color:#0000ff">null</span>) <span style="color:#0000ff">as</span> <span style="color:#2b91af">IEnumerable</span>;</li>
<li>                <span style="color:#2b91af">List</span>&lt;<span style="color:#2b91af">Entity</span>&gt; newList = <span style="color:#0000ff">new</span> <span style="color:#2b91af">List</span>&lt;<span style="color:#2b91af">Entity</span>&gt;();</li>
<li style="background: #f3f3f3">                <span style="color:#0000ff">foreach</span> (<span style="color:#2b91af">Entity</span> child <span style="color:#0000ff">in</span> coll)</li>
<li>                {</li>
<li style="background: #f3f3f3">                    newList.Add(Attach(context, child));</li>
<li>                }</li>
<li style="background: #f3f3f3">                <span style="color:#0000ff">dynamic</span> dcoll = item.GetValue(newEntity,<span style="color:#0000ff">null</span>);</li>
<li>                <span style="color:#0000ff">foreach</span> (<span style="color:#0000ff">dynamic</span> child <span style="color:#0000ff">in</span> newList)</li>
<li style="background: #f3f3f3">                {</li>
<li>                    dcoll.Add(child);</li>
<li style="background: #f3f3f3">                }</li>
<li>            }</li>
<li style="background: #f3f3f3">        }</li>
<li>        <span style="color:#0000ff">return</span> newEntity;</li>
<li style="background: #f3f3f3">    }</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;summary&gt;</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> Recursively detaches entities from DomainContext, this </span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> method detaches every navigation properties</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> of current Entity as well.</span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;/summary&gt;</span></li>
<li>    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;param name=&quot;context&quot;&gt;&lt;/param&gt;</span></li>
<li style="background: #f3f3f3">    <span style="color:#808080">///</span><span style="color:#008000"> </span><span style="color:#808080">&lt;param name=&quot;entity&quot;&gt;&lt;/param&gt;</span></li>
<li>    <span style="color:#0000ff">public</span> <span style="color:#0000ff">static</span> <span style="color:#0000ff">void</span> Detach(<span style="color:#0000ff">this</span> <span style="color:#2b91af">DomainContext</span> context, <span style="color:#2b91af">Entity</span> entity)</li>
<li style="background: #f3f3f3">    {</li>
<li>        <span style="color:#0000ff">if</span> (entity == <span style="color:#0000ff">null</span> || entity.EntityState == <span style="color:#2b91af">EntityState</span>.Detached)</li>
<li style="background: #f3f3f3">            <span style="color:#0000ff">return</span>;</li>
<li>        <span style="color:#2b91af">EntitySet</span> nes = context.EntityContainer.GetEntitySet(entity.GetType());</li>
<li style="background: #f3f3f3">        nes.Detach(entity);</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">        <span style="color:#2b91af">Type</span> entityType = <span style="color:#0000ff">typeof</span>(<span style="color:#2b91af">Entity</span>);</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">        <span style="color:#008000">// get all navigation properties&#8230;</span></li>
<li>        <span style="color:#2b91af">Type</span> type = entity.GetType();</li>
<li style="background: #f3f3f3">        <span style="color:#0000ff">foreach</span> (<span style="color:#0000ff">var</span> item <span style="color:#0000ff">in</span> type.GetProperties())</li>
<li>        {</li>
<li style="background: #f3f3f3">            <span style="color:#0000ff">if</span> (entityType.IsAssignableFrom(item.PropertyType))</li>
<li>            {</li>
<li style="background: #f3f3f3">                Detach(context,item.GetValue(entity, <span style="color:#0000ff">null</span>) <span style="color:#0000ff">as</span> <span style="color:#2b91af">Entity</span>);</li>
<li>                <span style="color:#0000ff">continue</span>;</li>
<li style="background: #f3f3f3">            }</li>
<li>            <span style="color:#0000ff">if</span> (item.PropertyType.Name.StartsWith(<span style="color:#a31515">&quot;EntityCollection&quot;</span>))</li>
<li style="background: #f3f3f3">            {</li>
<li>                <span style="color:#2b91af">IEnumerable</span> coll = item.GetValue(entity, <span style="color:#0000ff">null</span>) <span style="color:#0000ff">as</span> <span style="color:#2b91af">IEnumerable</span>;</li>
<li style="background: #f3f3f3">                <span style="color:#0000ff">foreach</span> (<span style="color:#2b91af">Entity</span> child <span style="color:#0000ff">in</span> coll)</li>
<li>                {</li>
<li style="background: #f3f3f3">                    Detach(context,child);</li>
<li>                }</li>
<li style="background: #f3f3f3">            }</li>
<li>        }</li>
<li style="background: #f3f3f3">    }</li>
<li>&nbsp;</li>
<li style="background: #f3f3f3">}</li>
</ol></div>
</p></div>
</p></div>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F379%2Fdetach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services%2F&amp;title=Detach%20Entities%20Recursively%20and%20Attach%20to%20New%20DomainContext%20in%20Entity%20Framework%20and%20RIA%20Services"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/379/detach-entities-recursively-and-attach-to-new-domaincontext-in-entity-framework-and-ria-services/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Enabling Tracing in Silverlight with UI Atoms</title>
		<link>http://akashkava.com/blog/307/enabling-tracing-in-silverlight-with-ui-atoms/</link>
		<comments>http://akashkava.com/blog/307/enabling-tracing-in-silverlight-with-ui-atoms/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 15:44:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Trace]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/307/enabling-tracing-in-silverlight-with-ui-atoms/</guid>
		<description><![CDATA[UI Atoms 2010 v1.9 update now includes Trace API for developers to log information on screen just like normal .NET application. Diagnostics Trace API Microsoft .NET provided Trace API to help in troubleshoot problems which is of great help at time of development. But Silverlight developers are disappointed for not being able to trace in [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/307/enabling-tracing-in-silverlight-with-ui-atoms/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Enabling+Tracing+in+Silverlight+with+UI+Atoms";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F307%2Fenabling-tracing-in-silverlight-with-ui-atoms%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F307%2Fenabling-tracing-in-silverlight-with-ui-atoms%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p align="justify">UI Atoms 2010 v1.9 update now includes Trace API for developers to log information on screen just like normal .NET application.</p>
<h2 align="justify">Diagnostics Trace API</h2>
<p align="justify">Microsoft .NET provided Trace API to help in troubleshoot problems which is of great help at time of development. But Silverlight developers are disappointed for not being able to trace in Silverlight apps. However running apps on multiple platform isn’t quite easy, and different user experiences on different platforms raise unexpected issues. Such issues are difficult to resolve as deployed client computer may not have development tools available to troubleshoot and see application logs.</p>
<blockquote><p align="justify">Trace.WriteLine(“ Hello World “);</p>
</blockquote>
<p align="justify">We sure miss Trace in Silverlight, so we decided to add similar diagnostics API in Silverlight.</p>
<h2 align="justify">Trace Viewer</h2>
<p align="justify">In Silverlight, as it runs inside a browser, there is no way to see any trace information not only this, on different platforms like Mac, it may be too difficult for no technical user to install and enable remote debugging.</p>
<p align="justify">So we decided to include a visual component that can be put anywhere on screen, just like “Output” pane in visual studio. Its developer’s choice to fit the Trace Viewer. Its pretty simple Text View control, where in you can see lines of log automatically scrolling down as log grows.</p>
<h2>AtomTraceView</h2>
<p align="justify">UI Atoms’s AtomTraceView control works well with Silverlight as well as WPF, in WPF it uses inbuilt Trace functionality and displays trace information to user, and in Silverlight we have added custom API, that is used to display Trace information. Syntax is pretty simple.</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">Grid</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">Grid.RowDefintions</span><span class="kwrd">&gt;</span>
       <span class="kwrd">&lt;</span><span class="html">RowDefinition</span><span class="kwrd">/&gt;</span>
       <span class="kwrd">&lt;</span><span class="html">RowDefinition</span> <span class="attr">Height</span><span class="kwrd">=&quot;200&quot;</span><span class="kwrd">/&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">Grid.RowDefintions</span><span class="kwrd">&gt;</span>

   <span class="kwrd">&lt;</span><span class="html">MyUserControl</span><span class="kwrd">/&gt;</span>

   <span class="kwrd">&lt;</span><span class="html">AtomTraceView</span> <span class="attr">Grid</span>.<span class="attr">Row</span><span class="kwrd">=&quot;1&quot;</span><span class="kwrd">/&gt;</span>

<span class="kwrd">&lt;</span><span class="html">Grid</span><span class="kwrd">&gt;</span></pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p align="justify">This way you can include AtomTraceView at the bottom of your page and it will display all traces programmed by the developer.</p>
<h2 align="justify">Limited API</h2>
<p align="justify">However, .NET Trace API is very huge, and it is extensible, but Trace API offered by UI Atoms as of now is very limited, not by the design but by implications, Silverlight itself is very limited platform, this is just an Add-on for users to troubleshoot their apps.</p>
<h2>Trace Statements in Silverlight</h2>
<p>In order to write Trace statements, you have to import following namespace,</p>
<blockquote>
<p><font color="#333333">using NeuroSpeech.UIAtoms.Core;</font></p>
</blockquote>
<p>Then you can write following statements and they will appear in AtomTraceView Control.</p>
<pre class="csharpcode">AtomTrace.WriteLine(<span class="str">&quot; Hello World &quot;</span>);

AtomTrace.WriteLine( exception.ToString() );

AtomTrace.WriteLine( <span class="kwrd">string</span>.Format(<span class="str">&quot;{0},{1} Coordinates&quot;</span>, x, y) );</pre>
<p>&#160;</p>
<p>The AtomTrace class exists for both Silverlight and WPF, so it becomes easier to write your logs with AtomTrace instead of Trace, so your code can be shared on both Silverlight as well as WPF.</p>
<h2>Trace and Multithreading</h2>
<p align="justify">Trace statements can be accessed by thread in Silverlight app, however the sequence in which it will appear can not be guaranteed because it depends upon the processor and scheduling algorithm used in thread pool of Silverlight application.</p>
<h2>Custom Trace Listener</h2>
<p>Just similar to .NET, we have included&#160; AtomTraceListener class, which you can derive and customize trace information according to your need as well as it has Traced event, which you can implement and get trace notifications anywhere..</p>
<h2>&#160;</h2>
<h2>Future of Trace API in Silverlight</h2>
<p align="justify">When Trace API will be included by Microsoft in future edition of Silverlight, we may plan to remove Trace API, to be consistent with the Silverlight development workflow, this API has been enabled only to write shared code between WPF and Silverlight environment. However otherwise, we plan to make tracing more rich with UI Atoms. But for now, it is very helpful for everyone.</p>
<h2>Live Demo</h2>
<p><a href="http://go.neurospeech.com/10" target="_blank"><strong><font size="4">Click Here</font></strong></a> to see live demo of Tracing in Silverlight.</p>
<p><strong><a href="http://go.neurospeech.com/4" target="_blank"><font size="4">Click Here</font></a></strong> to download demo version of UI Atoms 2010.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F307%2Fenabling-tracing-in-silverlight-with-ui-atoms%2F&amp;title=Enabling%20Tracing%20in%20Silverlight%20with%20UI%20Atoms"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/307/enabling-tracing-in-silverlight-with-ui-atoms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Measurement Unit Conversion for WPF and Silverlight</title>
		<link>http://akashkava.com/blog/300/measurement-unit-conversion-for-wpf-and-silverlight/</link>
		<comments>http://akashkava.com/blog/300/measurement-unit-conversion-for-wpf-and-silverlight/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 15:25:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Conversion]]></category>
		<category><![CDATA[Measurement]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight 4 RC]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[Unit]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/300/measurement-unit-conversion-for-wpf-and-silverlight/</guid>
		<description><![CDATA[Scientific calculations often require measurement unit conversion and demand high accuracy. Although it may be very easy to google around the web and get some formula, however when we looked into SI units and its Unit Guide, then we realized that even units with same name have little different value in different countries and continents. [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/300/measurement-unit-conversion-for-wpf-and-silverlight/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Measurement+Unit+Conversion+for+WPF+and+Silverlight";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F300%2Fmeasurement-unit-conversion-for-wpf-and-silverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F300%2Fmeasurement-unit-conversion-for-wpf-and-silverlight%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Scientific calculations often require measurement unit conversion and demand high accuracy. Although it may be very easy to google around the web and get some formula, however when we looked into SI units and its Unit Guide, then we realized that even units with same name have little different value in different countries and continents.</p>
<p>So we decided to bring them all into User Interface control for WPF and Silverlight.</p>
<ol>
<li>Which allows Developer to adhere to one standard unit.</li>
<li>Which allows users to choose unit of their own choice.</li>
<li>See the conversion while editing the value.</li>
</ol>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/MeasurementControlPart1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MeasurementControlPart1" border="0" alt="MeasurementControlPart1" src="http://akashkava.com/blog/wp-content/uploads/2010/06/MeasurementControlPart1_thumb.png" width="583" height="490" /></a> </p>
<p>&#160;</p>
<p>The following sample code displays how to use these unit converters in Silverlight and WPF.</p>
<h3>Properties</h3>
<p>Each of the measurement unit converter controls has four properties as mentioned below.</p>
<h4>DisplayValue Property:</h4>
<p>This is the editable value displayed in the text box, and user can directly modify this value by either using up/down arrow buttons or by typing in the value. The display value works in conjunction with the type of unit that is selected in Display Unit ID property.</p>
<h4>DisplayUnitID Property:</h4>
<p>Every measurement unit has different ID assigned by our developers to uniquely identify alpha numeric ID within the set of units. For example, meter and centimeter are IDs of Length. However you do not have to remember these IDs, when you edit your UI in Visual Studio, you can configure these IDs in the property editor. End user can visually modify Display Unit in order to retrieve and enter value in the desired unit.</p>
<h4>ValueUnitID Property:</h4>
<p>The DisplayUnitID is attached to DisplayValue, similarly the underlying actual value is attached with ValueUnitID property. This Unit ID is usually set to a constant throughout the lifetime of the application and is already defaulted to SI unit. e.g. for Length, it is set to meter. We recommend you to change this only if your base unit requirement is something different then SI unit. This unit can not be changed by end user it can only be programmed in the code at design time.</p>
<h4>Value Property:</h4>
<p>The value property is something which you are interested saving in the database and use it as base value. This is the converted value of unit ValueUnitID specified from display value of display unit.</p>
<h4>Example:</h4>
<p>In the first control in the above picture, Display Value is 100, Display Unit is Fathom, Value Unit is meter, so converted value in meter is 182.8804.</p>
<h4>Live Sample:</h4>
<p><a href="http://go.neurospeech.com/6" target="_blank"><strong>Click here</strong></a> to view live sample in Silverlight.</p>
<h4>Download Demo:</h4>
<p><a href="http://go.neurospeech.com/4" target="_blank"><strong>Click here</strong></a> to download the demo version of UI Atoms.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F300%2Fmeasurement-unit-conversion-for-wpf-and-silverlight%2F&amp;title=Measurement%20Unit%20Conversion%20for%20WPF%20and%20Silverlight"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/300/measurement-unit-conversion-for-wpf-and-silverlight/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Advanced Data Form with UI Atoms on WPF and Silverlight</title>
		<link>http://akashkava.com/blog/296/advanced-data-form-with-ui-atoms-on-wpf-and-silverlight/</link>
		<comments>http://akashkava.com/blog/296/advanced-data-form-with-ui-atoms-on-wpf-and-silverlight/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 11:14:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Advanced Form]]></category>
		<category><![CDATA[DataForm]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/296/advanced-data-form-with-ui-atoms-on-wpf-and-silverlight/</guid>
		<description><![CDATA[Building line of business applications for over years, we realized that the Silverlight DataForm offers very small subset of features that are needed in the long run. We figured out the problem with form based applications, that frustrates developers. That is “Change Management”. Although WPF/Silverlight does offer very customizable UI designing platform but when we [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/296/advanced-data-form-with-ui-atoms-on-wpf-and-silverlight/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Advanced+Data+Form+with+UI+Atoms+on+WPF+and+Silverlight";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F296%2Fadvanced-data-form-with-ui-atoms-on-wpf-and-silverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F296%2Fadvanced-data-form-with-ui-atoms-on-wpf-and-silverlight%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Building line of business applications for over years, we realized that the Silverlight DataForm offers very small subset of features that are needed in the long run. We figured out the problem with form based applications, that frustrates developers. That is “Change Management”.</p>
<p>Although WPF/Silverlight does offer very customizable UI designing platform but when we go on the field to develop ling of business applications, we realize that initial development hardly takes any time but maintenance is very difficult.</p>
<p>Lets review the designing problems of panels such as Grid, StackPanel, Canvas etc.</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/StackPanelGridChallenges.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="StackPanelGridChallenges" border="0" alt="StackPanelGridChallenges" src="http://akashkava.com/blog/wp-content/uploads/2010/06/StackPanelGridChallenges_thumb.png" width="420" height="289" /></a> </p>
<h3>Standard Form Design</h3>
<p>Lets review standard form design that is expected, this is the layout that can not be made except canvas panel because there is no way we can support variable columns per row. If you notice, first two rows have 3 columns equally placed and last 2 rows have two columns equally placed. Every field has description at the bottom and red required asterisk (*).</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/StandardFormDesign.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="StandardFormDesign" border="0" alt="StandardFormDesign" src="http://akashkava.com/blog/wp-content/uploads/2010/06/StandardFormDesign_thumb.png" width="420" height="298" /></a></p>
<h3>Initial Form Design</h3>
<p>The first draft of UI in any application is very simple and we probably do it in minutes.</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/CustomerRequest.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="CustomerRequest" border="0" alt="CustomerRequest" src="http://akashkava.com/blog/wp-content/uploads/2010/06/CustomerRequest_thumb.png" width="420" height="373" /></a> </p>
<h3>Changes Requested</h3>
<p>But the bigger problem always comes later on when changes are requested.</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/TypicalChanges.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="TypicalChanges" border="0" alt="TypicalChanges" src="http://akashkava.com/blog/wp-content/uploads/2010/06/TypicalChanges_thumb.png" width="420" height="332" /></a> </p>
<h3>Atom Flexible Grid </h3>
</p>
<p>This is the reason we created “AtomFlexibleGrid” which supports variable columns per row as displayed in the picture above. You can see that form and the flexible grid have a property called “RowLayout” which accepts comma separated cell values to be displayed per row. As displayed in the example below.</p>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/FlexibleGrid.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="FlexibleGrid" border="0" alt="FlexibleGrid" src="http://akashkava.com/blog/wp-content/uploads/2010/06/FlexibleGrid_thumb.png" width="420" height="302" /></a> </p>
<p>This is very helpful in quick design, but this also way to easy to manage when changes are requested.</p>
<ul>
<li>Intelligent Flow Layout with ability share multiple items in single row. </li>
<li>No attributes required on any child items. </li>
<li>Comma Separated “RowLayout” instantly renders variable column grid. </li>
<li>E.g. 3,2,1 = 3 cells in first row, 2 cells in 2nd row and 1 cell in 3rd row with automatic spanning. </li>
</ul>
<h3>Benefits of Atom Flexible Grid over Canvas, Grid and Stack Panel    <br /></h3>
<ul>
<li>Atom Form children are similar to Wrap Panel children, but Wrapping is completely customized via simple attributes. </li>
<li>Its easy to move items around without changing lots of attributes, Grid is very powerful but changing grid children can be huge pain. </li>
<li>Canvas is very easy to operate, but needs a powerful designer, once again changing layout can be very tedious job.
</li>
</ul>
<h3>Form Field Layout</h3>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/06/FormFieldLayout.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="FormFieldLayout" border="0" alt="FormFieldLayout" src="http://akashkava.com/blog/wp-content/uploads/2010/06/FormFieldLayout_thumb.png" width="420" height="180" /></a></p>
<p>This is how individual components of Form Field are positioned within the Form Field. Collapsible panels are only visible if the content is provided. However in future more of such components will be available in Form Field to standardize the fields.    <br />In next slide, you will see how the fields are positioned in the Form.     </p>
<h3>Change Management</h3>
<p>Changing layout is extremely simple, as you can simply move your items up and down and change “RowLayout” text field to quickly review how it will look. No tedious drag and drop and no typing.</p>
<h3>Live Form Demos</h3>
<p><a href="http://uiatoms.neurospeech.com/silverlight/index.html" target="_blank">Click here</a> to see live UI Atoms form demos for Silverlight.</p>
<p><a href="http://go.neurospeech.com/4" target="_blank">Click here</a> to download UI Atoms form demos for WPF.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F296%2Fadvanced-data-form-with-ui-atoms-on-wpf-and-silverlight%2F&amp;title=Advanced%20Data%20Form%20with%20UI%20Atoms%20on%20WPF%20and%20Silverlight"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/296/advanced-data-form-with-ui-atoms-on-wpf-and-silverlight/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Advanced Data Form and Easiest Change Management with AtomForm</title>
		<link>http://akashkava.com/blog/283/advanced-data-form-and-easiest-change-management-with-atomform/</link>
		<comments>http://akashkava.com/blog/283/advanced-data-form-and-easiest-change-management-with-atomform/#comments</comments>
		<pubDate>Mon, 31 May 2010 16:50:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Advanced Form]]></category>
		<category><![CDATA[AtomForm]]></category>
		<category><![CDATA[LOB]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/283/advanced-data-form-and-easiest-change-management-with-atomform/</guid>
		<description><![CDATA[UI Atoms Form Layout View more presentations from Akash Kava. Here at NeuroSpeech, we figured out the problem with forms based business applications that frustrates developers and change management is not only time consuming but its quite boring job to do. Although WPF/Silverlight does offer very customizable UI designing platform but when we go on [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/283/advanced-data-form-and-easiest-change-management-with-atomform/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "Advanced+Data+Form+and+Easiest+Change+Management+with+AtomForm";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F283%2Fadvanced-data-form-and-easiest-change-management-with-atomform%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F283%2Fadvanced-data-form-and-easiest-change-management-with-atomform%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:5804ff25-c861-4c9e-8478-5c56aa833c15" class="wlWriterEditableSmartContent">
<div>
<div style="width:425px" id="__ss_3736922"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/ackava/ui-atoms-form-layout" title="UI Atoms Form Layout">UI Atoms Form Layout</a></strong><object id="__sse3736922" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=uiatomsformlayout-100415105821-phpapp01&amp;stripped_title=ui-atoms-form-layout" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed name="__sse3736922" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=uiatomsformlayout-100415105821-phpapp01&amp;stripped_title=ui-atoms-form-layout" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/ackava">Akash Kava</a>.</div>
</div>
</div>
</div>
<p>Here at NeuroSpeech, we figured out the problem with forms based business applications that frustrates developers and change management is not only time consuming but its quite boring job to do.</p>
<p>Although WPF/Silverlight does offer very customizable UI designing platform but when we go on the field to develop ling of business applications, we realize that initial development hardly takes any time but maintenance is very difficult.</p>
<p>AtomForm has been designed to offer a standard rich business class user interface along with various advanced validation methods and the change management is very easy as “AtomFlexibleGrid” offers simple row layout concept that is offered nowhere today.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F283%2Fadvanced-data-form-and-easiest-change-management-with-atomform%2F&amp;title=Advanced%20Data%20Form%20and%20Easiest%20Change%20Management%20with%20AtomForm"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/283/advanced-data-form-and-easiest-change-management-with-atomform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UI Atoms 2010 v1.1 Released</title>
		<link>http://akashkava.com/blog/281/ui-atoms-2010-v1-1-released/</link>
		<comments>http://akashkava.com/blog/281/ui-atoms-2010-v1-1-released/#comments</comments>
		<pubDate>Wed, 05 May 2010 16:28:00 +0000</pubDate>
		<dc:creator>Akash Kava</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Conversion]]></category>
		<category><![CDATA[Measurement]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UI Atoms]]></category>
		<category><![CDATA[Unit]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://akashkava.com/blog/281/ui-atoms-2010-v1-1-released/</guid>
		<description><![CDATA[New update of UI Atoms 2010 v1.1 is now available, it includes fixes for Silverlight 4 and new controls as per following list. Update 1.1 UI Atoms is now upgraded to Silverlight 4, all binding workarounds have been removed. Six New Measurement Unit Controls have been added. Measurement Unit Controls Scientific measurements are complex and [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://akashkava.com/blog/281/ui-atoms-2010-v1-1-released/";
		digg_bgcolor = "";
		digg_skin = "";
		digg_window = "";
		digg_title = "UI+Atoms+2010+v1.1+Released";
		digg_media = "";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fakashkava.com%2Fblog%2F281%2Fui-atoms-2010-v1-1-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fakashkava.com%2Fblog%2F281%2Fui-atoms-2010-v1-1-released%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>New update of UI Atoms 2010 v1.1 is now available, it includes fixes for Silverlight 4 and new controls as per following list.</p>
<h2>Update 1.1</h2>
<ol>
<li><font color="#333333">UI Atoms is now upgraded to Silverlight 4, all binding workarounds have been removed.</font></li>
<li><font color="#333333">Six New Measurement Unit Controls have been added.</font></li>
</ol>
<h2>Measurement Unit Controls</h2>
<p>Scientific measurements are complex and wide range of units are used everywhere, though conversions are not difficult but it is not possible to carry and remember all conversions and correct formulae.</p>
<p>UI Atoms 2010 v1.1 brings power of SI units conversion in set of following Measurement Unit Controls.</p>
<ul>
<li><font color="#333333">AtomLengthEditor – helps in conversion of “Length” units.</font></li>
<li><font color="#333333">AtomTemperatureEditor – helps in conversion of “Temperature” units.</font></li>
<li><font color="#333333">AtomTimeEditor – helps in conversion of “Time” units.</font></li>
<li><font color="#333333">AtomVelocityEditor – helps in conversion of “Velocity” units.</font></li>
<li><font color="#333333">AtomVolumeEditor – helps in conversion of “Volume” units.</font></li>
<li><font color="#333333">AtomWeightEditor – helps in conversion of “Weight” units.</font></li>
</ul>
<p><a href="http://akashkava.com/blog/wp-content/uploads/2010/05/MeasurementControls.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="MeasurementControls" border="0" alt="MeasurementControls" src="http://akashkava.com/blog/wp-content/uploads/2010/05/MeasurementControls_thumb.png" width="613" height="490" /></a> Currently, these controls offers very simple GUI as first draft, however you can see the number of units that are available that can help users view/edit the value in any desired unit.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fakashkava.com%2Fblog%2F281%2Fui-atoms-2010-v1-1-released%2F&amp;title=UI%20Atoms%202010%20v1.1%20Released"><img src="http://akashkava.com/blog/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://akashkava.com/blog/281/ui-atoms-2010-v1-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

