<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Evgeny Pokhilko's Weblog</title>
	<atom:link href="http://evpo.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://evpo.wordpress.com</link>
	<description>Dedicated to software development</description>
	<lastBuildDate>Sun, 25 Sep 2011 05:24:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='evpo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Evgeny Pokhilko's Weblog</title>
		<link>http://evpo.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://evpo.wordpress.com/osd.xml" title="Evgeny Pokhilko&#039;s Weblog" />
	<atom:link rel='hub' href='http://evpo.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Measure Size Of Rendered Text In WPF</title>
		<link>http://evpo.wordpress.com/2010/10/20/measure-size-of-rendered-text/</link>
		<comments>http://evpo.wordpress.com/2010/10/20/measure-size-of-rendered-text/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 23:04:10 +0000</pubDate>
		<dc:creator>evpo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://evpo.wordpress.com/2010/10/20/measure-size-of-rendered-text/</guid>
		<description><![CDATA[Problem: Get the size that arbitrary text will take to adjust width, height of a control or control wrapping. Solution: FormattedText formattedText = new FormattedText(text, &#160; Thread.CurrentThread.CurrentCulture, &#160; FlowDirection.LeftToRight, &#160; new Typeface(fontFamilyName), &#160; fontSize, &#160; Brushes.Black); return formattedText.Width;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=73&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> Get the size that arbitrary text will take to adjust width, height of a control or control wrapping.</p>
<p><strong>Solution:</strong></p>
<p>FormattedText formattedText = new FormattedText(text,    <br />&#160; Thread.CurrentThread.CurrentCulture,     <br />&#160; FlowDirection.LeftToRight,     <br />&#160; new Typeface(fontFamilyName),     <br />&#160; fontSize,     <br />&#160; Brushes.Black);     <br />return formattedText.Width;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evpo.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evpo.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evpo.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evpo.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evpo.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evpo.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evpo.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evpo.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evpo.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evpo.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evpo.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evpo.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evpo.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evpo.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=73&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evpo.wordpress.com/2010/10/20/measure-size-of-rendered-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/81dff3077c6e0ff95b0b286d8547be94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evpo</media:title>
		</media:content>
	</item>
		<item>
		<title>Suse 11 workstation as a router</title>
		<link>http://evpo.wordpress.com/2010/02/24/suse-11-workstation-as-a-router/</link>
		<comments>http://evpo.wordpress.com/2010/02/24/suse-11-workstation-as-a-router/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 13:01:22 +0000</pubDate>
		<dc:creator>evpo</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[SUSE]]></category>

		<guid isPermaLink="false">http://evpo.wordpress.com/?p=63</guid>
		<description><![CDATA[My task was to connect to my office through VPN from a SUSE workstation and allow another Windows machine to use office network resources. In this scenario SUSE acts as a router forwarding ip packets from the Windows machine to the office network. I am using NetworkManager for VPN on my SUSE machine. In one [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=63&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My task was to connect to my office through VPN from a SUSE workstation and allow another Windows machine to use office network resources. In this scenario SUSE acts as a router forwarding ip packets from the Windows machine to the office network.</p>
<p>I am using NetworkManager for VPN on my SUSE machine. In one of the previous articles I wrote about establishing VPN connection to a windows server from SUSE.</p>
<p>IP forwarding is disabled by default. You can check it with the following command:</p>
<p><strong>cat /proc/sys/net/ipv4/ip_forward</strong></p>
<p>It returns either 1 or 0. 1 means IP forwarding is enabled. I suppose you will see 0. Otherwise you wouldn&#8217;t read this article. But use this command later to verify that ip forwarding is enabled.</p>
<p>In my configuration I need to change settings of the SUSE firewall to allow IP forwarding. The settings you see in YAST are not comprehensive and they are not enough for the task.</p>
<p>Instead open <strong>/etc/sysconfig/SuSEfirewall2</strong> in gedit. Add your VPN network interface name (run<strong>/sbin/ifconfig</strong> after connecting to VPN to get all active interfaces) to <strong>FW_DEV_EXT</strong>. It will make your office network external for the SUSE router. Add your internal network (where the packets will be coming from) to <strong>FW_DEV_INT</strong>. As a result SUSE knows that your internal network is your home network and your office network is external.</p>
<p>Change <strong>FW_ROUTE</strong> to yes. This will allow IP forwarding. I also changed <strong>FW_MASQUERADE</strong> to yes. Not sure it was necessary for my task. By the way masquerading can be configured in YAST GUI tool unlike IP forwarding.</p>
<p>Now if you invoke <strong>cat /proc/sys/net/ipv4/ip_forward</strong>, you should see 1 returned.</p>
<p>Forwarding will be performed according to your routing table. To see the routing table invoke</p>
<p><strong>/sbin/route -n</strong></p>
<p>Now go to your Windows machine. Say your office network is 111.222.333.0 (255.255.255.0) and the SUSE machine IP address is 193.333.222.1.</p>
<p><strong>route add 111.222.111.0 mask 255.255.255.0 193.123.222.1</strong></p>
<p>This will send packets going to your office network to the SUSE router.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evpo.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evpo.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evpo.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evpo.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evpo.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evpo.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evpo.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evpo.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evpo.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evpo.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evpo.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evpo.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evpo.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evpo.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=63&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evpo.wordpress.com/2010/02/24/suse-11-workstation-as-a-router/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/81dff3077c6e0ff95b0b286d8547be94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evpo</media:title>
		</media:content>
	</item>
		<item>
		<title>Remote desktop via VPN from SUSE 11.1</title>
		<link>http://evpo.wordpress.com/2009/05/30/remote-desktop-via-vpn-from-suse-11-1/</link>
		<comments>http://evpo.wordpress.com/2009/05/30/remote-desktop-via-vpn-from-suse-11-1/#comments</comments>
		<pubDate>Sat, 30 May 2009 06:52:33 +0000</pubDate>
		<dc:creator>evpo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://evpo.wordpress.com/?p=60</guid>
		<description><![CDATA[I needed to work at weekends and connected to my machine at work. VPN + Remote Desktop I used this guide to install VPN: http://pmhaddad.wordpress.com/2009/03/15/step-by-step-guide-to-setting-up-a-windows-pptp-vpn-client-in-ubuntu-810/ &#8220;sudo apt-get install network-manager-pptp&#8221; didn&#8217;t work in suse. I had to find the rpm packages. There were two I had to install: NetworkManager-pptp-0.7.0.r4274-2.9.i586.rpm NetworkManager-pptp-gnome-0.7.0.r4274-2.9.i586.rpm I installed them running one command: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=60&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I needed to work at weekends and connected to my machine at work. VPN + Remote Desktop</p>
<p>I used this guide to install VPN:</p>
<p><a href="http://pmhaddad.wordpress.com/2009/03/15/step-by-step-guide-to-setting-up-a-windows-pptp-vpn-client-in-ubuntu-810/">http://pmhaddad.wordpress.com/2009/03/15/step-by-step-guide-to-setting-up-a-windows-pptp-vpn-client-in-ubuntu-810/</a></p>
<p>&#8220;sudo apt-get install network-manager-pptp&#8221; didn&#8217;t work in suse. I had to find the rpm packages. There were two I had to install:</p>
<p><strong>NetworkManager-pptp-0.7.0.r4274-2.9.i586.rpm </strong></p>
<p><strong>NetworkManager-pptp-gnome-0.7.0.r4274-2.9.i586.rpm</strong></p>
<p>I installed them running one command:</p>
<p><strong>rpm -ivh &lt;package1&gt; &lt;package2&gt;</strong></p>
<p>Then I installed rdesktop. I connect from command prompt:</p>
<p><strong>rdesktop &lt;full DNS address&gt; -f</strong></p>
<p>-f switch is full screen</p>
<p>There is another switch for setting the resolution:</p>
<p><strong>-g 1024&#215;768</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evpo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evpo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evpo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evpo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evpo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evpo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evpo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evpo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evpo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evpo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evpo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evpo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evpo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evpo.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=60&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evpo.wordpress.com/2009/05/30/remote-desktop-via-vpn-from-suse-11-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/81dff3077c6e0ff95b0b286d8547be94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evpo</media:title>
		</media:content>
	</item>
		<item>
		<title>EVPO DC project structure</title>
		<link>http://evpo.wordpress.com/2009/05/09/evpo-dc-project-structure/</link>
		<comments>http://evpo.wordpress.com/2009/05/09/evpo-dc-project-structure/#comments</comments>
		<pubDate>Sat, 09 May 2009 01:36:48 +0000</pubDate>
		<dc:creator>evpo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://evpo.wordpress.com/?p=45</guid>
		<description><![CDATA[The picture above is the solution in VS. The application contains three layers: Data Layer, Business Layer and UI. Evpo.DocCirc.MySqlDL, Evpo.DocCirc.MySqlDL.Update Data layer. All database access operations are in the MySqlDl project. The Update project contains the changes of the database schema have made from the first version. The MySqlDl project is only accessed by [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=45&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-46" title="Project in VS" src="http://evpo.files.wordpress.com/2009/05/project-in-vs.png?w=211&#038;h=278" alt="Project in VS" width="211" height="278" /></p>
<p>The picture above is the solution in VS. The application contains three layers: Data Layer, Business Layer and UI.</p>
<h2><strong>Evpo.DocCirc.MySqlDL, Evpo.DocCirc.MySqlDL.Update</strong></h2>
<p>Data layer. All database access operations are in the MySqlDl project. The Update project contains the changes of the database schema have made from the first version. The MySqlDl project is only accessed by Evpo.DocCirc.Biz. According to the principles UI cannot access the data layer directly. The following picture shows the project files:</p>
<p><img class="alignnone size-full wp-image-48" title="MySqlDl files" src="http://evpo.files.wordpress.com/2009/05/mysqldl-files.png?w=210&#038;h=447" alt="MySqlDl files" width="210" height="447" /></p>
<p>The Resources folder contains the scripts run during the installation. CreateDatabase creates a new database and all the schema objects. In addition it populates some tables. CreateUsers creates users needed for working with the database. It is run once at setup time as well.</p>
<p>The purpose of the files with Access suffix is to access the database and change its state or obtain business objects from it. In this application business objects are simple and their purpose is only to store data. They don&#8217;t do anything. Access suffixed classes work with them. They load and save them from the database. Besides, access objects run queries and change the database state. For example DocCardAccess loads and saves DocCardItem from the database. DocCardItem is the business object representing Document Card.</p>
<h2><strong>Evpo.DocCirc.Common</strong></h2>
<p><img class="alignnone size-full wp-image-49" title="Common project files" src="http://evpo.files.wordpress.com/2009/05/common-project-files.png?w=196&#038;h=531" alt="Common project files" width="196" height="531" /></p>
<p>This is the project that all other projects reference. Mostly it contains data storage classes like buisiness objects, global settings and so on. Most classes do not do anything, just store data. The project have common classes that all the layers operate with. For example, DocCardItem class mentioned above is loaded from the database in the data layer and can be processed in the business layer. Then DocCardItem objects are displayed in the UI.</p>
<h2><strong>Evpo.DocCirc.Biz</strong></h2>
<p><img class="alignnone size-full wp-image-50" title="Biz project files" src="http://evpo.files.wordpress.com/2009/05/biz-project-files.png?w=245&#038;h=336" alt="Biz project files" width="245" height="336" /></p>
<p>The business layer. It contains all the business logic. It also serves as an intermediate layer between the Data Layer and UI because, as I said above, UI cannot access Data Layer directly. Classes with suffix Data are wrappers providing access to the data layer. An important class in this project is DocCardMovementController. It provides workflow control such as moves the document card to the next stage.</p>
<h2><strong>Evpo.DocCirc.UI</strong></h2>
<p><img class="alignnone size-full wp-image-51" title="UI project files" src="http://evpo.files.wordpress.com/2009/05/ui-project-files.png?w=205&#038;h=190" alt="UI project files" width="205" height="190" /></p>
<p>The classes in this project comprise the UI layer. Originaly the code in the classes was extracted from asp.net web pages for unit testing, but now I think it is a good idea to move as much as possible from the web pages because they must be as thin as possible and they are not covered by the unit tests.</p>
<h2><strong>Evpo.DocCirc.Messaging</strong></h2>
<p><img class="alignnone size-full wp-image-52" title="Messaging project files" src="http://evpo.files.wordpress.com/2009/05/messaging-project-files.png?w=204&#038;h=145" alt="Messaging project files" width="204" height="145" /></p>
<p>As you see in the picture, it&#8217;s purpose is to compose and send notification messages such as Action Is Required or event notifications to the users. There are two ways of notification Email messages and instant messages. EmailMessanger and InstantMessanger are for those purposes accordingly. Note that InstantMessager doesn&#8217;t send notifications by itself. Instead, it accesses a web service specified in the configuration that sends the actual notification to the users. The web service is not included in this solution.</p>
<h2><strong>EDCWeb</strong></h2>
<p><img class="alignnone size-full wp-image-54" title="EDCWeb project files" src="http://evpo.files.wordpress.com/2009/05/edcweb-project-files.png?w=214&#038;h=608" alt="EDCWeb project files" width="214" height="608" /></p>
<p>It contains the web pages. The project references Common, Biz, UI and resources. &#8220;G&#8221; folder contains pictures that are used in the UI. The &#8220;Settings&#8221; folder stores configuration files e. g. evpodc.config.  The most important file in the project is <strong>AppCode\Global.asax.cs</strong>. Inside this file the action starts. It is worth starting from for developers who study the application.</p>
<p>Note that the web pages don&#8217;t contain language specific data. The words and sentences are stored in the satelite resource assemblies Evpo.DocCirc.Resources and Evpo.DocCirc.Resources.ru-RU. Their description follows.</p>
<h2><strong>Evpo.DocCirc.Resources, Evpo.DocCirc.Resources.RU-ru</strong></h2>
<p><img class="alignnone size-full wp-image-55" title="Resource project files" src="http://evpo.files.wordpress.com/2009/05/resource-project-files.png?w=235&#038;h=590" alt="Resource project files" width="235" height="590" /></p>
<p>Each web page file has a resource file in this project. There are two assemblies at the moment: english and russian. They are used depending on the culture of the project set in web.config. Other languages can be added.</p>
<h2><strong>Other projects</strong></h2>
<p><strong>EvpoDCUTest</strong> &#8211; all the unit tests and mock objects live here</p>
<p><strong>EvpoDocCircSetup </strong>- the project creating the setup package</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evpo.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evpo.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evpo.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evpo.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evpo.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evpo.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evpo.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evpo.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evpo.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evpo.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evpo.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evpo.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evpo.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evpo.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=45&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evpo.wordpress.com/2009/05/09/evpo-dc-project-structure/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/81dff3077c6e0ff95b0b286d8547be94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evpo</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2009/05/project-in-vs.png" medium="image">
			<media:title type="html">Project in VS</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2009/05/mysqldl-files.png" medium="image">
			<media:title type="html">MySqlDl files</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2009/05/common-project-files.png" medium="image">
			<media:title type="html">Common project files</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2009/05/biz-project-files.png" medium="image">
			<media:title type="html">Biz project files</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2009/05/ui-project-files.png" medium="image">
			<media:title type="html">UI project files</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2009/05/messaging-project-files.png" medium="image">
			<media:title type="html">Messaging project files</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2009/05/edcweb-project-files.png" medium="image">
			<media:title type="html">EDCWeb project files</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2009/05/resource-project-files.png" medium="image">
			<media:title type="html">Resource project files</media:title>
		</media:content>
	</item>
		<item>
		<title>EVPODC Getting Started Part 2 (Configuration)</title>
		<link>http://evpo.wordpress.com/2008/11/19/evpodc-getting-started-part-2-configuration/</link>
		<comments>http://evpo.wordpress.com/2008/11/19/evpodc-getting-started-part-2-configuration/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 12:05:19 +0000</pubDate>
		<dc:creator>evpo</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Workflow]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://evpo.wordpress.com/?p=25</guid>
		<description><![CDATA[When you first enter the application, you see the Queries menu (Figure 1). However it&#8217;s too early for making queries because we don&#8217;t have data yet. Figure 1 For the working system we need to create users, folders and routes. Then we&#8217;ll be able to create documents. To create users we click Administration, then Users. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=25&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When you first enter the application, you see the Queries menu (Figure 1). However it&#8217;s too early for making queries because we don&#8217;t have data yet.</p>
<p style="text-align:center;"><a href="http://evpo.files.wordpress.com/2008/11/configuration-01.png"><img class="aligncenter size-full wp-image-26" title="configuration-01" src="http://evpo.files.wordpress.com/2008/11/configuration-01.png?w=538&#038;h=176" alt="configuration-01" width="538" height="176" /></a>Figure 1</p>
<p>For the working system we need to create <strong>users</strong>, <strong>folders</strong> and <strong>routes</strong>. Then we&#8217;ll be able to create <strong>documents</strong>.</p>
<p>To create users we click <strong>Administration</strong>, then <strong>Users</strong>. We see that there are three existing users. They are builtin users. Don&#8217;t delete them. Unfortunately, the system allows you to delete anyone. Although the application behavior is unpredictable if you do so.</p>
<p>Say this is a development company and we have a team containing 2 developers, a requirement writer, a tester and a team leader. Please, note that the only field required is Login. You also need to fill in the email address if you want to use notifications. I am going to use them for this sample. So I created 5 new users as you can see in the DropDown list. (figure 2)</p>
<p style="text-align:center;"><a href="http://evpo.files.wordpress.com/2008/11/configuration-02.png"><img class="aligncenter size-full wp-image-27" title="configuration-02" src="http://evpo.files.wordpress.com/2008/11/configuration-02.png?w=530&#038;h=557" alt="configuration-02" width="530" height="557" /></a>Figure 2</p>
<p style="text-align:left;">Now we need to add the users to different security roles to restrict access because we don&#8217;t want all to see everything. We go to <strong>Administration / Roles</strong>. There are two builtin roles: <strong>Administrators</strong> and <strong>Users</strong>. All the new created users are included in the group Users by default. We can leave them as they are and add new roles. I want to create the following roles:</p>
<ul>
<li><strong>Requirement Department</strong>: Bill Johnson (requirement writer)</li>
<li><strong>Quality Assurance</strong>: John Mayer (tester)</li>
<li><strong>Developers</strong>: Kevin Black (developer), Stephen Smith (developer)</li>
<li><strong>Managers</strong>: Dexter Brown (team leader)</li>
</ul>
<p>See figure 3</p>
<p style="text-align:center;"><a href="http://evpo.files.wordpress.com/2008/11/configuration-03.png"><img class="aligncenter size-full wp-image-30" title="configuration-03" src="http://evpo.files.wordpress.com/2008/11/configuration-03.png?w=609&#038;h=339" alt="configuration-03" width="609" height="339" /></a>Figure 3</p>
<p style="text-align:left;">You might be asking: where are the permissions? The answer is that it&#8217;s too early for permissions. You confugure them for each folder and document type and we haven&#8217;t created neither. That&#8217;s what we are going to do now.</p>
<p style="text-align:left;">Go to <strong>Administration / Document Folders</strong></p>
<p style="text-align:left;">This interface is easy to understand. When you input <strong>Folder Name</strong> and click <strong>Create New Folder</strong>, a subfolder is added in the folder that is selected on the left. For our scenario I create a complex folder structure (see figure 4) for the purposes of our sample.</p>
<p style="text-align:center;"><a href="http://evpo.files.wordpress.com/2008/11/configuration-04.png"><img class="aligncenter size-full wp-image-31" title="configuration-04" src="http://evpo.files.wordpress.com/2008/11/configuration-04.png?w=210&#038;h=132" alt="configuration-04" width="210" height="132" /></a>Figure 4</p>
<p style="text-align:left;">That&#8217;s how it looks like in the app (figure 5)</p>
<p style="text-align:left;"><a href="http://evpo.files.wordpress.com/2008/11/configuration-05.png"><img class="aligncenter size-full wp-image-32" title="configuration-05" src="http://evpo.files.wordpress.com/2008/11/configuration-05.png?w=718&#038;h=183" alt="configuration-05" width="718" height="183" /></a></p>
<p style="text-align:center;"><a href="http://evpo.files.wordpress.com/2008/11/configuration-06.png"><img class="aligncenter size-full wp-image-33" title="configuration-06" src="http://evpo.files.wordpress.com/2008/11/configuration-06.png?w=667&#038;h=217" alt="configuration-06" width="667" height="217" /></a></p>
<p style="text-align:center;">Figure 5</p>
<p style="text-align:left;">Now you see where permissions are. These are default permissions for <strong>Development Team</strong> folder. I assume I need to give you a clue about security settings in the app because it&#8217;s flexible but not clear at first sight. The security system is similar to the NTFS folder security and other known applications. Each security object, a folder in this case, has security settings for many security roles. In figure 5 we have settings for <strong>Administrators</strong> and <strong>Users</strong> because they are builtin roles. Each security role defined in the folder has a set of settings you can see under <strong>Users</strong>. I clicked href <strong>Users</strong>. That&#8217;s why we are viewing the settings for this role. As you can see <strong>Users</strong> have all permissions in new folders by default. Note that if a role is not in the role list, it doesn&#8217;t have access to the folders at all. So our new roles don&#8217;t have any permissions in the folder we look at but don&#8217;t forget that our users are members of the <strong>Users</strong> role. That&#8217;s why they can do eveyithing at the moment.</p>
<p style="text-align:left;"> </p>
<p style="text-align:left;">Let&#8217;s start from configuring the root folder <strong>Documents. </strong>For that<strong> </strong>you need to click the link at the very bottom of the page <strong><a href="http://localhost:1508/PermissionMgmt.aspx?ID=1&amp;ItemType=DocumentFolder" target="_blank">Root folder permissions&#8230;</a></strong><img src="/DOCUME%7E1/LOCAL-%7E1/LOCALS%7E1/Temp/moz-screenshot.jpg" alt="" /></p>
<p style="text-align:left;">In the root folder our team is going to store <strong>annual leave requests</strong> and <strong>equipment requests</strong>. These document types are useful for everybody. Therefore the rule is that everybody can create a document in this folder. People can also read documents of their collegues in the folder because we need them to plan vacations together. We don&#8217;t want to give access to <strong>equipment requests</strong>, but we&#8217;ll talk about that later because I am going to configure that in the <strong>document type</strong> permissions specifically for <strong>equipment requests</strong>. So the settings for the role <strong>Users</strong> in the <strong>Documents </strong>folder will be as in the figure 6.</p>
<p style="text-align:left;"><a href="http://evpo.files.wordpress.com/2008/11/configuration-07.png"><img class="aligncenter size-full wp-image-35" title="configuration-07" src="http://evpo.files.wordpress.com/2008/11/configuration-07.png?w=493&#038;h=161" alt="configuration-07" width="493" height="161" /></a></p>
<p style="text-align:center;">Figure 6</p>
<p style="text-align:left;">According to the settings:</p>
<p style="text-align:left;">members of Users can:</p>
<ul>
<li>create new documents (<strong>Create</strong> checkbox)</li>
<li>read other users&#8217; documents (<strong>Read</strong> checkbox) including their own (<strong>Read own</strong> checkbox)</li>
<li>update their own documents (<strong>Update own</strong>)</li>
<li>see the folder on the list of folders (<strong>Browse</strong>). However, it is not applicable to the root folder because it&#8217;s never on the list of folders. You are always within in.</li>
</ul>
<p>cannot:</p>
<ul>
<li>udate others&#8217; document (<strong>Update</strong>)</li>
<li>delete documents (<strong>Delete</strong>) including their own (<strong>Delete own</strong>).</li>
</ul>
<p>The reason why we don&#8217;t allow the users to delete their own documents is because we want to guaranty that no <strong>annual leave request</strong> was deleted by a malicious employee.</p>
<p>It&#8217;s time to configure a role that is responsible for these documents and has more permissions. They are <strong>Managers</strong>. We add the role to the list and set the settings (see figure 7).</p>
<p style="text-align:center;"><a href="http://evpo.files.wordpress.com/2008/11/configuration-08.png"><img class="aligncenter size-full wp-image-37" title="configuration-08" src="http://evpo.files.wordpress.com/2008/11/configuration-08.png?w=665&#038;h=249" alt="configuration-08" width="665" height="249" /></a>Figure 7</p>
<p style="text-align:left;">These settings say that <strong>Managers</strong> can do everything in the folder. In fact they update when they accept request or reject it. They might delete document if it&#8217;s no longer needed. You got the idea of the folder security configuration.</p>
<p style="text-align:left;">Next thing we have to do is to create the document types <strong>equipment requests</strong> and <strong>annual leave requests</strong>. We need to go to <strong>Folders/DocumentTypes </strong>and<strong> </strong>click <strong>Create document type.</strong> The first tab of the document type form for <strong>equipment requests</strong> you can see in Figure 8.</p>
<p style="text-align:center;"><a href="http://evpo.files.wordpress.com/2008/11/configuration-09.png"><img class="aligncenter size-full wp-image-41" title="configuration-09" src="http://evpo.files.wordpress.com/2008/11/configuration-09.png?w=550&#038;h=270" alt="configuration-09" width="550" height="270" /></a>Figure 8</p>
<p style="text-align:left;">Note <strong>Prefix</strong> and <strong>Next number</strong> fields. Each document has a unique number. When you create the first document of this type, its number is going to be EQ00001. After that the next document of this type is going to be EQ00002 etc. </p>
<p style="text-align:left;">Next we fill in the route tab. </p>
<p style="text-align:left;"> </p>
<p style="text-align:left;"> </p>
<p style="text-align:left;"> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evpo.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evpo.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evpo.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evpo.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evpo.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evpo.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evpo.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evpo.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evpo.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evpo.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evpo.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evpo.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evpo.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evpo.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=25&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evpo.wordpress.com/2008/11/19/evpodc-getting-started-part-2-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/81dff3077c6e0ff95b0b286d8547be94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evpo</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/11/configuration-01.png" medium="image">
			<media:title type="html">configuration-01</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/11/configuration-02.png" medium="image">
			<media:title type="html">configuration-02</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/11/configuration-03.png" medium="image">
			<media:title type="html">configuration-03</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/11/configuration-04.png" medium="image">
			<media:title type="html">configuration-04</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/11/configuration-05.png" medium="image">
			<media:title type="html">configuration-05</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/11/configuration-06.png" medium="image">
			<media:title type="html">configuration-06</media:title>
		</media:content>

		<media:content url="/DOCUME%7E1/LOCAL-%7E1/LOCALS%7E1/Temp/moz-screenshot.jpg" medium="image" />

		<media:content url="http://evpo.files.wordpress.com/2008/11/configuration-07.png" medium="image">
			<media:title type="html">configuration-07</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/11/configuration-08.png" medium="image">
			<media:title type="html">configuration-08</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/11/configuration-09.png" medium="image">
			<media:title type="html">configuration-09</media:title>
		</media:content>
	</item>
		<item>
		<title>EVPODC getting started part 1 (installation)</title>
		<link>http://evpo.wordpress.com/2008/11/18/evpodc-getting-started-part1/</link>
		<comments>http://evpo.wordpress.com/2008/11/18/evpodc-getting-started-part1/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 10:44:17 +0000</pubDate>
		<dc:creator>evpo</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Workflow]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://evpo.wordpress.com/?p=19</guid>
		<description><![CDATA[Here I am trying to give you essential information how the open source workflow system EVPO DC works and what you need to do to explore its capabilities. I am sure that is what people do when they assess a new application and decide whether it suits them or not. After installing the app by [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=19&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here I am trying to give you essential information how <a href="http://www.evpo.net" target="_blank">the open source workflow system EVPO DC</a> works and what you need to do to explore its capabilities. I am sure that is what people do when they assess a new application and decide whether it suits them or not.</p>
<p>After installing the app by using <a href="http://evpodc.codeplex.com/releases/view/35522" target="_blank">the windows setup</a>, you have a shortcut in you Start Menu. It is a URL called &#8220;EVPO Document Circulation&#8221;. When you run it for the first time, you see the configuration wizard (figure 1).</p>
<p><a href="http://evpo.files.wordpress.com/2008/11/configuration-wizard-01.png"><img class="alignnone size-full wp-image-20" title="figure 1" src="http://evpo.files.wordpress.com/2008/11/configuration-wizard-01.png?w=595&#038;h=265" alt="figure 1" width="595" height="265" /></a></p>
<p style="text-align:center;">Figure 1</p>
<p>The system needs administrative access to a mysql database server to deploy its database. Evpodc like any workflow application needs a database for working. The wizard doesn&#8217;t create or modify anything at this step. It just checks the access to the database server.</p>
<p>At step 2 you will be asked the name of the database containing the data for the system. If the database doesn&#8217;t exist or &#8220;Create new database&#8221; is checked, a new database will be created.</p>
<p>Step 3. Two accounts will be created in MySql server for accessing the database. It doesn&#8217;t really matter what passwords you input, because you don&#8217;t have to remember them. The system will store the passwords in its configuration files and will be using them later.</p>
<p>Step 4. There is a lot of text. The idea is that the app must have permissions to access that directory. Usually the ASP.NET account set by default cannot modify files in directories. This is not the case if you install Evpodc by using setup.exe. The server is run in Utildev cassini. It uses the NT AUTHORITY\SYSTEM account that have all the necessary permissions. So you don&#8217;t have to worry about it. Just click next. The directory will be created for you.</p>
<p>Step 5. The system asks you to reveal all your secrets <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Actually it needs to know this information because the app notifies people by email when they need to do something. This feature is optional. (see Figure 2)</p>
<p><a href="http://evpo.files.wordpress.com/2008/11/configuration-wizard-02.png"><img class="aligncenter size-full wp-image-22" title="Figure 2" src="http://evpo.files.wordpress.com/2008/11/configuration-wizard-02.png?w=530&#038;h=235" alt="Figure 2" width="530" height="235" /></a> Don&#8217;t forget to check Enable SSL if you use a gmail account.</p>
<p>Step 6. In the next screen the wizard asks you to click the button resetting the application and applying the settings you have just entered. It also says the account name and the password of the administrator. You will need them for your first login. Click reset and that&#8217;s it. Setup is finished.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evpo.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evpo.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evpo.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evpo.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evpo.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evpo.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evpo.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evpo.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evpo.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evpo.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evpo.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evpo.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evpo.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evpo.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=19&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evpo.wordpress.com/2008/11/18/evpodc-getting-started-part1/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/81dff3077c6e0ff95b0b286d8547be94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evpo</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/11/configuration-wizard-01.png" medium="image">
			<media:title type="html">figure 1</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/11/configuration-wizard-02.png" medium="image">
			<media:title type="html">Figure 2</media:title>
		</media:content>
	</item>
		<item>
		<title>Customize property editor in the VS designer</title>
		<link>http://evpo.wordpress.com/2008/06/29/customize-property-editor-in-vs-designer/</link>
		<comments>http://evpo.wordpress.com/2008/06/29/customize-property-editor-in-vs-designer/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 13:27:57 +0000</pubDate>
		<dc:creator>evpo</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Cider]]></category>
		<category><![CDATA[Visual studio]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://evpo.wordpress.com/?p=15</guid>
		<description><![CDATA[Sometimes, the VS property grid in the XAML designer (the code name is Cider) is not enough for custom WPF controls. Once, I needed to update a property of my control automatically depending on a value of another property. First, I searched for an example of such an action in WPF controls of the framework. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=15&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes, the VS property grid in the XAML designer (the code name is Cider) is not enough for custom WPF controls. Once, I needed to update a property of my control automatically depending on a value of another property. First, I searched for an example of such an action in WPF controls of the framework. I found nothing similar. The property grid in VS is plain and one property never depends on another. However the property grid in Expression Blend is much more interesting. Therefore, there should be a way to extend the designer. The way starts from the <a title="CategoryAttribute" href="http://msdn.microsoft.com/en-us/library/system.componentmodel.categoryattribute.aspx">CategoryAttribute</a> and <a title="EditorAttribute" href="http://msdn.microsoft.com/en-us/library/system.componentmodel.editorattribute.aspx">EditorAttribute</a> atributes. Let&#8217;s see an example of a custom WPF control that extends Label. The extended control renders Content and adds prefix before the content and suffix after the content. So our control has two additional properties: Prefix and Suffix. The control is for names. Therefore, Prefix can only be &#8220;Mr&#8221; or &#8220;King&#8221;. When the user selects Prefix, Suffix gets an initial value depending on the selected Prefix. Then the user can edit Suffix if she is not happy with the value set automatically. Say the prefix &#8220;Mr&#8221; correspons to the suffix &#8220;Junior&#8221; and the prefix &#8220;King&#8221; corresponds to the suffix &#8220;III&#8221;. So if the user inputs &#8220;Arthur&#8221; to Content and selects the prefix &#8220;King&#8221;, the suffix will be set to &#8220;III&#8221; automatically. See the picture of the control at runtime below:</p>
<p><a href="http://evpo.files.wordpress.com/2008/06/controlatruntime.png"><img class="alignnone size-medium wp-image-16" src="http://evpo.files.wordpress.com/2008/06/controlatruntime.png?w=236&#038;h=54" alt="" width="236" height="54" /></a></p>
<p>It looks identically in the designer. The following picture is the part of the property grid containing Content,  Prefix and Suffix:</p>
<p><a href="http://evpo.files.wordpress.com/2008/06/propgrid.png"><img class="alignnone size-medium wp-image-17" src="http://evpo.files.wordpress.com/2008/06/propgrid.png?w=220&#038;h=300" alt="" width="220" height="300" /></a></p>
<p>Note, Suffix can be edited after selecting Prefix because the king is not necessary III. He can be I, II or even IV. But if you set the prefix to Mr, the edited value of suffix will be overriden with Junior.</p>
<p>Let&#8217;s see the class declaration of the custom control (Control1).<br />
<!-- Start of snippet generated by C#2HTML --></p>
<div style="background-color:#FFFFFF;font-family:Courier;font-size:12px;">
<pre> [Editor(<span style="color:#0000ff;">typeof</span>(ExtCategoryEditor), <span style="color:#0000ff;">typeof</span>(ExtCategoryEditor))]
    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> Control1 : Label
    {</pre>
</div>
<p><!-- End of snippet generated by C#2HTML -->The Editor attribute says that we provide a editor that can be embedded into the VS property grid for the control. In fact the part of the property grid under &#8220;Ext&#8221; is a grid that ExtCategoryEditor provides. Our editor is only for the Ext category. In Control1 class we also need to say which properties correspond to &#8220;Ext &#8221; category, so that they may get into our editor. We simply mark properties with CategoryAttribute for this:<br />
<!-- Start of snippet generated by C#2HTML --></p>
<div style="background-color:#FFFFFF;font-family:Courier;font-size:12px;">
<pre>        [Category(<span style="color:#c00000;">"Ext"</span>)]
        <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> Prefix
        {
            get { <span style="color:#0000ff;">return</span> (<span style="color:#0000ff;">string</span>)GetValue(PrefixProperty); }
            set { SetValue(PrefixProperty, value); }
        }</pre>
</div>
<p><!-- End of snippet generated by C#2HTML -->You probably think that ExtCategoryEditor is the class that contains the Grid control we see in the property grid. That&#8217;s not right. ExtCategoryEditor is a class derived from <a title="CategoryEditor" href="http://msdn.microsoft.com/en-us/library/microsoft.windows.design.propertyediting.categoryeditor.aspx">CategoryEditor</a> that has a set of methods. One of them gives DataTemplate containing the Grid control. Look at the ExtCategoryEditor class:<br />
<!-- Start of snippet generated by C#2HTML --></p>
<div style="background-color:#FFFFFF;font-family:Courier;font-size:12px;">
<pre>    <span style="color:#0000ff;">internal</span> <span style="color:#0000ff;">class</span> ExtCategoryEditor : CategoryEditor
    {
        <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">bool</span> ConsumesProperty(PropertyEntry property)
        {
            <span style="color:#0000ff;">string</span>[] properties = <span style="color:#0000ff;">new</span> <span style="color:#0000ff;">string</span>[]
            {
                <span style="color:#c00000;">"Prefix"</span>,
                <span style="color:#c00000;">"Suffix"</span>,
                <span style="color:#c00000;">"Self"</span>
            };

            <span style="color:#0000ff;">if</span> (properties.Contains(property.PropertyName))
            {
                <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">true</span>;
            }
            <span style="color:#0000ff;">else</span>
            {
                <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">false</span>;
            }
        }

        <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">override</span> DataTemplate EditorTemplate
        {
            get
            {
                <span style="color:#0000ff;">return</span> (DataTemplate)EditorTempaleForExt.Current[<span style="color:#c00000;">"ExtDataTemplate"</span>];
            }
        }

        <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">object</span> GetImage(System.Windows.Size desiredSize)
        {
            <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">null</span>;
        }

        <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">string</span> TargetCategory
        {
            get { <span style="color:#0000ff;">return</span> <span style="color:#c00000;">"Ext"</span>; }
        }
    }</pre>
</div>
<p><!-- End of snippet generated by C#2HTML -->EditorTemplate is the method giving Grid, which is in EditorTemplate. The Editor template is declared in ResourceDictionary EditorTemplateForExt. Its XAML declaration is below:</p>
<p><!-- Start of snippet generated by C#2HTML --></p>
<div style="background-color:#FFFFFF;font-family:Courier;font-size:12px;">
<pre>    &lt;DataTemplate x:Key=<span style="color:#c00000;">"ExtDataTemplate"</span>&gt;
        &lt;Grid&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition/&gt;
                &lt;ColumnDefinition/&gt;
            &lt;/Grid.ColumnDefinitions&gt;
            &lt;Grid.RowDefinitions&gt;
                &lt;RowDefinition/&gt;
                &lt;RowDefinition/&gt;
            &lt;/Grid.RowDefinitions&gt;
            &lt;TextBlock Grid.Row=<span style="color:#c00000;">"0"</span> Grid.Column=<span style="color:#c00000;">"0"</span> Text=<span style="color:#c00000;">"Prefix"</span>/&gt;
            &lt;ComboBox Grid.Row=<span style="color:#c00000;">"0"</span> Grid.Column=<span style="color:#c00000;">"1"</span>
                      DisplayMemberPath=<span style="color:#c00000;">"Text"</span>
                      SelectedValuePath=<span style="color:#c00000;">"Text"</span>
                      SelectedValue=<span style="color:#c00000;">"{Binding Prefix, ElementName=uiPropertyCourier}"</span>
                      SelectionChanged=<span style="color:#c00000;">"ComboBox_SelectionChanged"</span>&gt;
                &lt;ComboBox.Items&gt;
                    &lt;TextBlock Text=<span style="color:#c00000;">"King"</span>/&gt;
                    &lt;TextBlock Text=<span style="color:#c00000;">"Mr"</span>/&gt;
                &lt;/ComboBox.Items&gt;
            &lt;/ComboBox&gt;

            &lt;TextBlock Grid.Row=<span style="color:#c00000;">"1"</span> Grid.Column=<span style="color:#c00000;">"0"</span> Text=<span style="color:#c00000;">"Suffix"</span>/&gt;
            &lt;TextBox Name=<span style="color:#c00000;">"uiSuffix"</span> Grid.Row=<span style="color:#c00000;">"1"</span> Grid.Column=<span style="color:#c00000;">"1"</span> Text=<span style="color:#c00000;">"{Binding Suffix, ElementName=uiPropertyCourier}"</span> /&gt;

            &lt;local:PropertyCourier  x:Name=<span style="color:#c00000;">"uiPropertyCourier"</span>
                Visibility=<span style="color:#c00000;">"Collapsed"</span>
                Prefix=<span style="color:#c00000;">"{Binding [Prefix].PropertyValue.Value}"</span>
                Suffix=<span style="color:#c00000;">"{Binding [Suffix].PropertyValue.Value}"</span>&gt;

            &lt;/local:PropertyCourier&gt;
        &lt;/Grid&gt;

    &lt;/DataTemplate&gt;</pre>
</div>
<p><!-- End of snippet generated by C#2HTML -->You can see that &#8220;Binding [&lt;Property name&gt;].PropertyValue.Value&#8221; in Microsoft&#8217;s examples. It means that DataContext of your DataTemplate and the elements inside it is an instance of some internal Microsoft class. The class has an Indexer that receives string as a parameter. It actually gets the property name. I won&#8217;t write the names of those Microsoft classes because they declared with internal keyword and are not supposed to be used by developers outside Microsoft. However you can see them in the debugger. Just add watch to the DataContext property.</p>
<p>This is ComboBox_SelectionChanged method:<br />
<!-- Start of snippet generated by C#2HTML --></p>
<div style="background-color:#FFFFFF;font-family:Courier;font-size:12px;">
<pre>        <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> ComboBox_SelectionChanged(<span style="color:#0000ff;">object</span> sender, SelectionChangedEventArgs e)
        {
            ComboBox comboBox = (ComboBox)sender;
            PropertyCourier propertyCourier =
                (PropertyCourier)comboBox.FindName(<span style="color:#c00000;">"uiPropertyCourier"</span>);
            <span style="color:#0000ff;">string</span> value = (<span style="color:#0000ff;">string</span>)comboBox.SelectedValue;
            <span style="color:#0000ff;">switch</span> (value)
            {
                <span style="color:#0000ff;">case</span> <span style="color:#c00000;">"King"</span>:
                    propertyCourier.Suffix = <span style="color:#c00000;">"III"</span>;
                    <span style="color:#0000ff;">break</span>;
                <span style="color:#0000ff;">case</span> <span style="color:#c00000;">"Mr"</span>:
                    propertyCourier.Suffix = <span style="color:#c00000;">"Junior"</span>;
                    <span style="color:#0000ff;">break</span>;
            }
        }</pre>
</div>
<p><!-- End of snippet generated by C#2HTML --><br />
PropertyCourier is an empty FrameworkElement with two dependency properties: Prefix and Suffix. It is just an intermediate object that pass over values from our controls to the instances of the internal microsoft classes. The point is that you can not update properties in Control1 directly because of two reasons. Firstly, It is not convenient to get access to the Control1 object from the method. Secondly, the values won&#8217;t be serialized. Values should pass through internal Cider classes to be serialized. I use PropertyCourier as a convenient way to update values through Cider classes.</p>
<p>For more details <a title="download the code" href="https://docs.google.com/viewer?a=v&amp;pid=explorer&amp;chrome=true&amp;srcid=0B5vwu7IdOhLPNWM3MGY5OTQtYTY4ZS00OGQ3LTlkYjctMjA2ODgzNzA2ZDgw&amp;hl=en_US">download the code</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/evpo.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/evpo.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evpo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evpo.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evpo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evpo.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evpo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evpo.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evpo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evpo.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evpo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evpo.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evpo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evpo.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evpo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evpo.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=15&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evpo.wordpress.com/2008/06/29/customize-property-editor-in-vs-designer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/81dff3077c6e0ff95b0b286d8547be94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evpo</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/06/controlatruntime.png?w=236" medium="image" />

		<media:content url="http://evpo.files.wordpress.com/2008/06/propgrid.png?w=220" medium="image" />
	</item>
		<item>
		<title>How to load referenced assemblies from any place you want</title>
		<link>http://evpo.wordpress.com/2008/06/25/how-to-load-referenced-assemblies-from-any-place-you-want/</link>
		<comments>http://evpo.wordpress.com/2008/06/25/how-to-load-referenced-assemblies-from-any-place-you-want/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 12:15:46 +0000</pubDate>
		<dc:creator>evpo</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://evpo.wordpress.com/?p=13</guid>
		<description><![CDATA[This is HowTo for those who need it. The app.config file below defines rules for the main assembly. It sets where the referenced assemblies could be found at runtime. The main assembly references other two assemblies and gets one of them from network (\\someserver\shared\Summator.dll) and another one from the local machine in a subdirectory. Application [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=13&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is HowTo for those who need it. The app.config file below defines rules for the main assembly. It sets where the referenced assemblies could be found at runtime. The main assembly references other two assemblies and gets one of them from network (<a>\\someserver\shared\Summator.dll</a>) and another one from the local machine in a subdirectory.</p>
<p>Application config file is below:</p>
<p><!-- Start of snippet generated by C#2HTML --></p>
<div style="background-color:#FFFFFF;font-family:Courier;font-size:12px;">
<pre>&lt;configuration&gt;
  &lt;runtime&gt;
    &lt;assemblyBinding xmlns=<span style="color:#c00000;">"urn:schemas-microsoft-com:asm.v1"</span>&gt;
      &lt;dependentAssembly&gt;
        &lt;assemblyIdentity
            name=<span style="color:#c00000;">"Summator"</span>
            publicKeyToken=<span style="color:#c00000;">"03840bb05afb3f17"</span>
            culture=<span style="color:#c00000;">"neutral"</span> /&gt;
        &lt;codeBase
            version=<span style="color:#c00000;">"1.0.0.0"</span>
            href="file:///\\someserver\shared\Summator.dll"/&gt;
      &lt;/dependentAssembly&gt;
      &lt;probing privatePath="SUB1\SUB2\SUB3\"&gt;
      &lt;/probing&gt;
    &lt;/assemblyBinding&gt;
  &lt;/runtime&gt;
&lt;/configuration&gt;</pre>
</div>
<p><!-- End of snippet generated by C#2HTML --><br />
If you reference an assembly from your local machine, you are not limited by subdirectories of the main application because you can use the following method to mount your drives to one of the subdirectories:</p>
<p><a href="http://support.microsoft.com/kb/307889" target="_blank">http://support.microsoft.com/kb/307889</a></p>
<p>PS: Configuration files can be conveniently edited by the <a>mscorcfg.msc</a> tool (Control Panel – Administrative Tools &#8211; Microsoft .NET Framework 2.0 Configuration, MyComputer, Application, Right click, Add…).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/evpo.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/evpo.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evpo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evpo.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evpo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evpo.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evpo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evpo.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evpo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evpo.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evpo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evpo.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evpo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evpo.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evpo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evpo.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=13&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evpo.wordpress.com/2008/06/25/how-to-load-referenced-assemblies-from-any-place-you-want/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/81dff3077c6e0ff95b0b286d8547be94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evpo</media:title>
		</media:content>
	</item>
		<item>
		<title>The puzzle about a car and two goats</title>
		<link>http://evpo.wordpress.com/2008/06/25/car-and-two-goats/</link>
		<comments>http://evpo.wordpress.com/2008/06/25/car-and-two-goats/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 11:56:53 +0000</pubDate>
		<dc:creator>evpo</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Puzzle]]></category>

		<guid isPermaLink="false">http://evpo.wordpress.com/?p=12</guid>
		<description><![CDATA[A collegue of mine gave me the following puzzle to solve: Suppose you&#8217;re on a game show, and you&#8217;re given the choice of three doors. Behind one door is a car, behind the others, goats. You pick a door, say number 1, and the host, who knows what&#8217;s behind the doors, opens another door, say [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=12&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span lang="EN-AU">A collegue of mine gave me the following puzzle to solve: </span></p>
<p><em>Suppose you&#8217;re on a game show, and you&#8217;re given the choice of three doors. Behind one door is a car, behind the others, goats. You pick a door, say number 1, and the host, who knows what&#8217;s behind the doors, opens another door, say number 3, which has a goat. He says to you, &#8220;Do you want to pick door number 2?&#8221; Is it to your advantage to switch your choice of doors?</em></p>
<p><em> </em><span lang="EN-AU">In the evening I wrote a simple console application that proves the solution practically running the game 10000 times. You can compile it in command line “csc.exe GoatSelector.cs” and execute GoatSelector.exe.</span></p>
<p><span lang="EN-AU">The application shows you validation of the .NET random engine first. There are percentages of 0, 1, 2 numbers got from the Random class executed for 10000 times. Then it shows percentage of success when you “pick door number 2” (switching your choice) and percentage of success when you stay with your first selected door.  <a title="Download the code" href="https://docs.google.com/viewer?a=v&amp;pid=explorer&amp;chrome=true&amp;srcid=0B5vwu7IdOhLPYzZlNTYwMGMtMjliNS00MTVhLTg3ODUtOWRiZDQ2NDRhMTE0&amp;hl=en_US">Download the code</a><br />
</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/evpo.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/evpo.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evpo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evpo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evpo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evpo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evpo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evpo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evpo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evpo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evpo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evpo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evpo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evpo.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evpo.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evpo.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=12&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evpo.wordpress.com/2008/06/25/car-and-two-goats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/81dff3077c6e0ff95b0b286d8547be94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evpo</media:title>
		</media:content>
	</item>
		<item>
		<title>Effect of XML:Space=&#8221;preserve&#8221;</title>
		<link>http://evpo.wordpress.com/2008/06/23/xml-space-preserv/</link>
		<comments>http://evpo.wordpress.com/2008/06/23/xml-space-preserv/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 13:55:58 +0000</pubDate>
		<dc:creator>evpo</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://evpo.wordpress.com/?p=7</guid>
		<description><![CDATA[I was working with XAML created by Expression Blend. At runtime I noticed that a TextBlock moved on the right and one line down from the position it was in the designer. It took me some time to find the cause of the discrepancy. Below there is XAML of two TextBlock elements: &#60;TextBlock Height="17" VerticalAlignment="Top" [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=7&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was working with XAML created by Expression Blend. At runtime I noticed that a TextBlock moved on the right and one line down from the position it was in the designer. It took me some time to find the cause of the discrepancy. Below there is XAML of two TextBlock elements:</p>
<p><!-- Start of snippet generated by C#2HTML --></p>
<div style="background-color:#FFFFFF;font-family:Courier;font-size:12px;">
<pre>&lt;TextBlock Height=<span style="color:#c00000;">"17"</span> VerticalAlignment=<span style="color:#c00000;">"Top"</span> xml:space=<span style="color:#c00000;">"preserve"</span>&gt;&lt;Run xml:space=<span style="color:#c00000;">"preserve"</span>&gt;first line&lt;/Run&gt;&lt;/TextBlock&gt;
&lt;TextBlock Margin=<span style="color:#c00000;">"0,22,0,0"</span> Height=<span style="color:#c00000;">"23"</span> VerticalAlignment=<span style="color:#c00000;">"Top"</span>&gt;
    Second line
&lt;/TextBlock&gt;</pre>
</div>
<p><!-- End of snippet generated by C#2HTML --></p>
<p>In the designer it looks like this:</p>
<p><a href="http://evpo.files.wordpress.com/2008/06/designerview.png"><img class="alignnone size-full wp-image-8" src="http://evpo.files.wordpress.com/2008/06/designerview.png?w=325&#038;h=89" alt="" width="325" height="89" /></a></p>
<p>When the application is running, the picture is different:</p>
<p><a href="http://evpo.files.wordpress.com/2008/06/runtimeview1.png"><img class="alignnone size-full wp-image-10" src="http://evpo.files.wordpress.com/2008/06/runtimeview1.png?w=304&#038;h=127" alt="" width="304" height="127" /></a></p>
<p>As you see, the second line moved on the right and one line down.</p>
<p>The only unusual part of XAML is the xml:space=&#8221;preserve&#8221; attribute, which is set at the first TextBlock and the Run elment inside it. This attribute says that all the indentation and spaces in XAML code should be saved at the time of rendering. But according to MSDN the attribute scope is only the content of the element where the attribute is defined. It&#8217;s defined at the first TextBlock and the contained Run element. If you remove the attribute from those elements everything renders correctly. But why does the attribute from the first TextBlock influences the second TextBlock. In the debugger I stopped the application and saved XAML of the &#8220;second line&#8221; TextBlock and it really had xml:space=&#8221;preserve&#8221; attribute. I assume it somehow came from the &#8220;first line&#8221; TextBlock.</p>
<p>It is apparently a bug in WPF. The bug only apears If you have more than one nested elements with the xml:space =&#8221;preserve&#8221; attribute defined at both. The next sibling element after those will have this attribute set to &#8220;preserve&#8221; implicitly.</p>
<p>The solution is simple: you need to set xml:space=&#8221;default&#8221; explicitly at the next element. So our XAML will be:<br />
<!-- Start of snippet generated by C#2HTML --></p>
<div style="background-color:#FFFFFF;font-family:Courier;font-size:12px;">
<pre>&lt;TextBlock Height=<span style="color:#c00000;">"17"</span> VerticalAlignment=<span style="color:#c00000;">"Top"</span> xml:space=<span style="color:#c00000;">"preserve"</span>&gt;&lt;Run xml:space=<span style="color:#c00000;">"preserve"</span>&gt;first line&lt;/Run&gt;&lt;/TextBlock&gt;
&lt;TextBlock Margin=<span style="color:#c00000;">"0,22,0,0"</span> Height=<span style="color:#c00000;">"23"</span> VerticalAlignment=<span style="color:#c00000;">"Top"</span> xml:space=<span style="color:#c00000;">"default"</span>&gt;
    Second line
&lt;/TextBlock&gt;</pre>
</div>
<p><!-- End of snippet generated by C#2HTML --><a title="Download the code for this post" href="https://docs.google.com/viewer?a=v&amp;pid=explorer&amp;chrome=true&amp;srcid=0B5vwu7IdOhLPYmE0ZmM5N2ItY2JhOC00OGVjLThlYTktNjIyZjM1ZDY0YTNk&amp;hl=en_US">Download the code for this post</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/evpo.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/evpo.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evpo.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evpo.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evpo.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evpo.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evpo.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evpo.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evpo.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evpo.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evpo.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evpo.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evpo.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evpo.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evpo.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evpo.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evpo.wordpress.com&amp;blog=4028143&amp;post=7&amp;subd=evpo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evpo.wordpress.com/2008/06/23/xml-space-preserv/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/81dff3077c6e0ff95b0b286d8547be94?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evpo</media:title>
		</media:content>

		<media:content url="http://evpo.files.wordpress.com/2008/06/designerview.png" medium="image" />

		<media:content url="http://evpo.files.wordpress.com/2008/06/runtimeview1.png" medium="image" />
	</item>
	</channel>
</rss>
