<?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>SeeSharpRun</title>
	<atom:link href="http://blogs.dotnetkicks.com/seesharprun/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.dotnetkicks.com/seesharprun</link>
	<description>.NET Musings &#38; Tidbits</description>
	<lastBuildDate>Thu, 11 Aug 2011 18:11:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using Style &amp; Triggers For Complex Interactivity</title>
		<link>http://blogs.dotnetkicks.com/seesharprun/2011/08/11/using-style-triggers-for-complex-interactivity/</link>
		<comments>http://blogs.dotnetkicks.com/seesharprun/2011/08/11/using-style-triggers-for-complex-interactivity/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 17:06:50 +0000</pubDate>
		<dc:creator>Sidney Andrews</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Interactivity]]></category>

		<guid isPermaLink="false">http://blogs.dotnetkicks.com/seesharprun/2011/08/11/using-style-triggers-for-complex-interactivity/</guid>
		<description><![CDATA[Many times I try to take as much of the presentation logic out of the viewmodel as possible.  While using a MVVM pattern, sometimes it’s easy to be lazy and create boolean or visibility properties to handle logic on the front-end.  This week I’m showing a quick way to abstract that logic to the view &#8230; </p><p><a class="more-link block-button" href="http://blogs.dotnetkicks.com/seesharprun/2011/08/11/using-style-triggers-for-complex-interactivity/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Many times I try to take as much of the presentation logic out of the viewmodel as possible.  While using a MVVM pattern, sometimes it’s easy to be lazy and create boolean or visibility properties to handle logic on the front-end.  This week I’m showing a quick way to abstract that logic to the view only and not have to worry about cluttering your viewmodel.</p>
<p><span id="more-74"></span></p>
<p>Simply, I use Style.Trigger to handle the different ways I want my view to appear dependent on a DataBinding.  In WPF, this is incredibly easy using the DataTrigger class.  It allows you to bind to a datacontext property and then change the appearance of your object based on the property’s value.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;Style x:Key=&quot;ListControlStyle&quot; TargetType=&quot;{x:Type ContentControl}&quot;&gt;
	&lt;Setter Property=&quot;Opacity&quot; Value=&quot;0&quot;/&gt;
	&lt;Setter Property=&quot;Content&quot; Value=&quot;&quot;/&gt;
	&lt;Setter Property=&quot;Margin&quot; Value=&quot;20&quot;/&gt;
	&lt;Setter Property=&quot;VerticalAlignment&quot; Value=&quot;Center&quot;/&gt;
	&lt;Setter Property=&quot;HorizontalAlignment&quot; Value=&quot;Stretch&quot;/&gt;
	&lt;Setter Property=&quot;HorizontalContentAlignment&quot; Value=&quot;Center&quot;/&gt;
	&lt;Setter Property=&quot;Padding&quot; Value=&quot;8&quot;/&gt;
	&lt;Setter Property=&quot;VerticalContentAlignment&quot; Value=&quot;Center&quot;/&gt;
	&lt;Setter Property=&quot;Background&quot; Value=&quot;#FF337E83&quot;/&gt;
	&lt;Setter Property=&quot;Foreground&quot; Value=&quot;White&quot;/&gt;
	&lt;Setter Property=&quot;FontWeight&quot; Value=&quot;Bold&quot;/&gt;
	&lt;Setter Property=&quot;Template&quot;&gt;
		&lt;Setter.Value&gt;
			&lt;ControlTemplate TargetType=&quot;{x:Type ContentControl}&quot;&gt;
				&lt;Border BorderBrush=&quot;{TemplateBinding BorderBrush}&quot; Background=&quot;{TemplateBinding Background}&quot; CornerRadius=&quot;12&quot;&gt;
					&lt;ContentPresenter ContentTemplate=&quot;{TemplateBinding ContentTemplate}&quot; Content=&quot;{TemplateBinding Content}&quot; ContentStringFormat=&quot;{TemplateBinding ContentStringFormat}&quot; HorizontalAlignment=&quot;{TemplateBinding HorizontalContentAlignment}&quot; Margin=&quot;{TemplateBinding Padding}&quot; VerticalAlignment=&quot;{TemplateBinding VerticalContentAlignment}&quot;/&gt;
				&lt;/Border&gt;
			&lt;/ControlTemplate&gt;
		&lt;/Setter.Value&gt;
	&lt;/Setter&gt;
	&lt;Style.Triggers&gt;
		&lt;DataTrigger Binding=&quot;{Binding ItemList}&quot; Value=&quot;{x:Null}&quot;&gt;
			&lt;Setter Property=&quot;Content&quot; Value=&quot;List Has Not Been Searched Yet [ItemList = null]&quot; /&gt;
			&lt;Setter Property=&quot;Opacity&quot; Value=&quot;1&quot; /&gt;
		&lt;/DataTrigger&gt;
		&lt;DataTrigger Binding=&quot;{Binding ItemList.Count}&quot; Value=&quot;0&quot;&gt;
			&lt;Setter Property=&quot;Content&quot; Value=&quot;Search Results Are Empty [ItemList.Count = 0]&quot; /&gt;
			&lt;Setter Property=&quot;Opacity&quot; Value=&quot;1&quot; /&gt;
		&lt;/DataTrigger&gt;
	&lt;/Style.Triggers&gt;
&lt;/Style&gt;
</pre>
<p>The Style easily set some default values I wanted for my control and a ControlTemplate. In this example I wanted to create a rounded banner that shows in certain conditions:</p>
<ol>
<li>[DEFAULT] By default I want the Control to have an opacity of zero and empty Content</li>
<li>[ListItems.Count = 0] If the List exists but it is empty, then I want the item to show and alert the user.  This usually happens if you complete a search and get a empty result back.  It’s also very informative to the user that their search did complete but returned nothing.</li>
<li>[ListItems = null] If the List is null and never existed, then the user should know that they need to search.  It’s easy to have the List value null at the creation of the viewmodel and then populate the property on searches with a collection (either empty or with values)</li>
</ol>
<p>The style properties appear near the top are the lowest precedence.  They are the “default” values in this scenario and the triggers override any of those properties when their conditions are met.  One easy mistake to make is to forget that if you set a value on the ContentControl itself (not in the style) then that would have precedence over the trigger.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.dotnetkicks.com/seesharprun/2011/08/11/using-style-triggers-for-complex-interactivity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Dynamic SLA Documents in Web Service Testing</title>
		<link>http://blogs.dotnetkicks.com/seesharprun/2010/05/06/using-dynamic-sla-documents-in-web-service-testing/</link>
		<comments>http://blogs.dotnetkicks.com/seesharprun/2010/05/06/using-dynamic-sla-documents-in-web-service-testing/#comments</comments>
		<pubDate>Thu, 06 May 2010 17:49:00 +0000</pubDate>
		<dc:creator>Sidney Andrews</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://seesharprun.net/post.aspx?id=f27222b0-b947-4f92-b3f6-9e9897352fc1</guid>
		<description><![CDATA[As part of my Computer Science M.S. degree, I tend to write pitiful papers from time to time.  I’m posting this paper online because I want fair and honest critique.  I’m not a strong writer but I believe my ideas may be of some use.  This paper details using dynamically-generated SLA documents to create an &#8230; </p><p><a class="more-link block-button" href="http://blogs.dotnetkicks.com/seesharprun/2010/05/06/using-dynamic-sla-documents-in-web-service-testing/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>As part of my Computer Science M.S. degree, I tend to write pitiful papers from time to time.  I’m posting this paper online because I want fair and honest critique.  I’m not a strong writer but I believe my ideas may be of some use.  This paper details using dynamically-generated SLA documents to create an expansive test suite over a web service above and beyond what unit-test generation from WSDLs can do.</p>
<div class="wlWriterEditableSmartContent" style="margin: 0px;padding: 0px;float: none">
<span id="more-6"></span></p>
<p>Original Document:   <a href="http://blogs.dotnetkicks.com/seesharprun/files/2010/05/finalpaper_sidneyandrews.pdf">Final CMSC Paper</a></p>
</div>
<h3 align="center">Use of Dynamic SLA Documents In Expanding The Depth of Web-Service Testing &amp; Validation</h3>
<h3>Sidney Andrews</h3>
<h4>Introduction</h4>
<p>In the software development field, the quality assurance of an application can be directly related to the time and effort spent in testing &amp; verification.  As long as a development group has access to source files and code, there is a large amount of flexibility in deciding the level of acceptable risk and defects for the particular project and finding methods to verify the project meets the requirement.</p>
<p>When project groups utilize executables and software libraries from third-parties, their attempts at quality control are severely limited.  Since developers are not able to “prevent the introduction of faults during… development” 1 they cannot be involved in any form of constructive quality assurance.  However, analytical quality assurance is still possible.  Faults in a software library can still be found post development by a development party consuming another group’s application interfaces and libraries.  The depth of the tests and the amount of faults that can be exposed are primarily dependent on the amount of information made available to the testing group.  Reasonably, with more information available to the testers, their testing capabilities will increase.  Items such as source code, algorithms, program logic descriptions, unit tests and many others can help increase the depth of possible tests.</p>
<p>With source available to a development group, the group can use white-box methods to develop and generate tests to ensure that the project meets its stated requirements.  This is possible because the source allows the testers to understand the control flow of the application.  With an understanding of the program’s logic and control flow, the testing methodology qualifies for the distinction of white-box testing.  Armed with this information, we can expand the depth of the test and validate many possible execution scenarios.  Without information on a software project’s code or implementation, the testing group is limited to “black-box robustness testing” 2.  Normally, black-box testing is considered the only method of testing an application where it is not possible to ascertain any knowledge of the internals of the various operations available for use.  In some cases, other information about a software library or service can assist with increasing the depth of a black-box test but it is debatable what level of information can provide a clear distinction between black-box and white-box tests.</p>
<p>Many modern desktop and web applications rely on a service-oriented architecture.  While not an entirely new concept, SOAs have become increasingly popular with the splintering of work between multiple parties.  The world of service development and utilization introduces some unique constraints in testing and validation.   Software services can easily be “accessed without of its underlying implementation” 3.  Testing is usually constrained to verifying the model of the service.  As a service consumer, the only information available to use in testing is the model of the service.  This information is useful however, because the model information distributed to the service consumer is enough to construct an UML diagram of the service application.  This is possible because the consumer of a service application is allowed to download the interface(s) of the externally visible classes that the service uses to respond to client requests.  These interface classes allows a service consumer to generate a class inherited from the mentioned interface to “consume” the service.</p>
<p>The transmission of a service application’s interface to client applications is both platform agnostic and independent of any particular language implementation.  This is due to the use of Web Service Description Language (WSDL) documents.  While the name specifies the use of WSDL files in the world of web services, it is not possible to use WSDL documents with any service-oriented architecture.  What makes the platform and language independence possible is the fact that WSDLs are xml-based files that “describes the public interface of a service” 4.  In the raw xml data, a WSDL file is primarily composed of operators and messages.  The operators are language-independent constructs that describe the methods in an interface.  The messages are the other constructs in the document that describes both the standard and unique types in an interface.  When combined, both are useful enough to create an interface in a modern object-oriented language.  This interface can be easily used to allow a class in your modern language to implement that interface and create the matching method and types for your operators and messages.</p>
<p>WSDLs are very important in the web services realm so that applications can automatically discover and consume web services.  However, WSDL files can only model how an operation works but they do not provide any information about the performance of the service.  This is where Service Level Agreements SLAs come into play.  These documents provided by the authors of the service application guarantee a level of performance to the client applications that consume the service.  In the context of web services, SLA documents guarantee a quantifiable network performance at defined levels to the client 5.  Web services provide a unique challenge in both the creation and validation of SLA documents between the service provider and potential service clients.   With web services, the provider faces the challenge of guaranteeing service performance with no control over third party conditions that directly affect the web service.  Possible conditions could include the network connection, shared hardware resources, traffic congestion on the client backbone, etc.   Also the size, scalability and popularity of a web service can directly affect the performance 6.  Secondly, SLA documents also provide penalties related to violations in its terms or deliverable metrics 7.  The violations and consequences are two-fold and relate to both the service provider and client.</p>
<h4>Methods</h4>
<h5>Current Methods of Testing</h5>
<p>Client applications and users of web services have an explicit need to test and verify the web service.  Business-critical applications may rely on these web services and metrics are necessary when developing client applications to consume the services.  Having metrics and performance data for the web services can help create a baseline when testing and validating the client application.<br />
Most research into the testing of web-based services primarily revolves around model-based testing 8.  Clients have used an abundance of black-box techniques to validate the model of the web service.  With the interface information provided by a WSDL document, a client could write a suite of tests to surface test the operators and messages to validate that they function as expected and per the SLA.  SLAs usually contain clauses with expected exceptions and some data about the constraints of the message types and operator methods.  Since the interface information is provided in a standard XML format, this gives the testers the freedom to write automated test suites or applications.  Many testers use automated software to test the endpoitns of an application and write a test suite that looks for scenarios where the service would crash or exhibit unexpected behavior  9.</p>
<p>Many researchers use automated unit test generation tools (such as JCrasher and Pex) to isolate and white-box test the class generated from the interface of the web service 10.  Since implementation data and source code is not available, the in-depth testing of the generated web services class only effectively surface tests the endpoints of the web service itself.  In this interesting phenomenon, the web service can only be effectively black-box tested since the knowledge of the internals is severely limited.  This testing method, however, very quickly generates a large number of unit tests to create a suite of tests with great breadth over all possible endpoints to the web service.</p>
<h5>Limitations of Black-Box Testing</h5>
<p>Surface testing endpoints is an effective way to quickly create a test with a large breadth of search space, but it does have a few disadvantages.  First, without knowledge of the internals and execution paths of the web service, we can only truly test a subset of all possible method and type scenarios.  A simple example would be an operation (method) that takes an integer data type as input.  This method would increment the integer and use an if-else construct to determine an execution path based on the value of the integer.  Surface testing using black-box methods and unit test generation tools would not quite fit the job for this scenario.  An endpoint examination would return that this operation takes an integer type as input and returns some arbitrary type or nothing at all.  From this, a unit-test generation tool would assume to surface test the operation by sending it various and random integer values.  Values such as the minimum and maximum integer values, 0, 1 and -1 would be posted against the operation and the test suite would record the resultant information.  In this scenario, we would almost definitely find an integer overflow situation with the maximum integer value if the web service provider did not account for that in their program logic.  However, a tester is not guaranteed that the values sent in for the integer would test both possible execution branches for the if-else clause.<br />
This is the main utility of using unit-test generation tools.  They test endpoints and make sure that the endpoints behave as specified in edge-case scenarios.  If the message was using a string type as input, the unit-test generation tool would’ve checked the resultant values when the operation is passed in values such as an empty string, null value, special character symbol and foreign character symbols.  Unfortunately, this method of surface testing could not guarantee that it tests every possible execution scenario.  In order to do that, most unit-test generation tools would need access to the source code to account for all possible execution paths.  In the world of web services, this information is simply not available in most cases.</p>
<p>Some other, smaller limitations of using black-box methods to test web services could be involved in physical resources 11.  Buffers and network conditions can falsely change the results of a unit test.  While this type of error could be easily identified and dealt with, it is very important to consider and include in your unit tests to avoid skewing your results.  Also, unit-testing is resource exhaustive locally and can be doubly so over a remote network connection.  A network timeout or SOAP exception can be added to a white list of possible exceptions that will not invalidate a unit-test.  Another possible difficulty in unit-testing web services is the possibility of an update to the web service invalidating your unit tests 12.  Obviously, this can be resolved by automatically updating your WSDL document and unit tests to reflect the new build of the web service.  However, synchronization of your unit tests and the update schedule for the web service is necessary to avoid either updating your WSDL document too much or not enough.</p>
<p>Another issue with the current methods of testing lies with incorporating expected faults detailed through the SLA document into the unit tests.  Since an SLA document is typically hand written, it takes manual labor to translate the SLA’s data into test cases.  SLA information that’s important to the test team could include possible exceptions, performance metrics, and expected behavior.</p>
<h5>Dynamic Service Level Agreements</h5>
<p>Due to the dynamic and automated nature of unit-test generation, a static SLA document does not fit into this paradigm.  What if the testers could generate unit tests from an SLA document?  The only way to make this possible is to use an SLA document that’s in a format that is both platform independent and consumable by all clients.  Fortunately, there is already a well-established method of providing this form of information across the web.  WSDL documents use XML to transmit data across networks 13.  This same strategy can be use with SLA documents to generate a document that is both human readable and consumable by software platforms.</p>
<p>There are two common dynamic SLA formats.  The first is the WS-Agreement spec which was created by the Open Grid Forum to fill the need for a companion SLA document for a web service WSDL 14.  The more common method, and the focus of the rest of this paper, is in the WSLA standard that was created by an IBM research group.  A WSLA document specifies the parameters of an SLA document in a standard format with consistent measurement methods and metrics 15.  Both of these document types were envisioned as dynamically generated documents.  The standard method of generating these documents<br />
usually falls on the testing and performance measurement of the web service internally by the service provider.</p>
<p>The provider can simply create a software suite for both exception testing and performance measurement.  With the result baseline data generated from the tests, a provider can review the results and automatically generate a WSLA document from the results.  This document can contain information updated in regular intervals to keep the WSLA document updated to the standard needed by the service provider and/or consumers.<br />
Another, more interesting feature of the WSLA document is it’s capability to store data outside of the normal scope of an SLA document.  Figure 1 shows some of the typical data that a WSLA document would contain.  A WSLA document can also contain information about metrics along with information about the algorithms used within a web service.  A WSLA document can also contain the test used internally to validate the web service and the results returned from those tests 16.</p>
<p><a href="http://blogs.dotnetkicks.com/seesharprun/files/2010/05/service_chart.png"><img src="http://blogs.dotnetkicks.com/seesharprun/files/2010/05/service_chart.png" alt="Service Comparison Chart" width="404" height="219" /></a></p>
<h4>Conclusion</h4>
<p>Dynamic SLA documents (WSLA) opens up a new realm of possibility of clients with the need to test web services that they’re consuming.  The test cases and algorithms detailed in a WSLA document gives the testers a better idea of the context of a web service.  With this information in hand, the testers can possibly automatically generate unit tests that traverse all execution paths of a web service operation.  Also, testers can generate unit tests that match the tests that the provider development team used to initially test the web service.  While this information does not give the consumers the ability to white-box test the web services, this is far and above beyond the limitations set when a consumer black-box tests the web service with the aforementioned methods.  Black-box testing definitely created a large breadth of testing scenarios but this method may just help testers create large in-depth tests of their web services.<br />
At the end of the day, some of limitations still exist.  Regression testing is still difficult due to resource consumption.  Also, network congestion and utilization is hard to predict when testing web-based services.  WSLA documents only expand the list of possible things that can be tested against.  It does not guarantee that a tester who is blind to the source code and implementation can fully test a web service.</p>
<h4>Bibliography</h4>
<p><em><span style="font-size: x-small">Andrieux, Alain, et al. &#8220;Open Grid Forum.&#8221; 14 March 2007. Web Services Agreement Specification (WS-Agreement). 9 April 2010 &lt;</span></em><a href="http://www.ogf.org/documents/GFD.107.pdf"><em><span style="font-size: x-small">http://www.ogf.org/documents/GFD.107.pdf</span></em></a><em><span style="font-size: x-small">&gt;.<br />
Bai, Xiaoying, et al. &#8220;WSDL-Based Automatic Test Case Generation for Web Services Testing.&#8221; SOSE &#8217;05: Proceedings of the IEEE International Workshop. Washington, DC, 2005. 215-220.<br />
Berberova, Diana and Boyan Bontchev. &#8220;Design of service level agreements for software services.&#8221; CompSysTech &#8217;09: Proceedings of the International Conference on Computer Systems and Technologies and Workshop for PhD Students in Computing. Ruse, Bulgaria: ACM, 2009. 1-6.<br />
Bruno, Marcello, et al. &#8220;Using test cases as contract to ensure service compliance across releases.&#8221; In Service-Oriented Computing &#8211; ICSOC 2005, Third International Conference. Amsterdam: Springer, 2005. 87-100.<br />
Chinnici, Roberto, et al. Web Services Description Language (WSDL) Version 2.0. Vers. 13. 26 June 2007. 2 April 2010 &lt;</span></em><a href="http://www.w3.org/TR/wsdl20/"><em><span style="font-size: x-small">http://www.w3.org/TR/wsdl20/</span></em></a><em><span style="font-size: x-small">&gt;.<br />
Chou, Li-Der. &#8220;Design and implementation of a policy-based monitoring system for Web Services.&#8221; Journal of Information Science and Engineering 25.5 (2009): 1357-1372.<br />
Comuzzi, Marco and Barbara Pernici. &#8220;A framework for QoS-based Web service contracting.&#8221; ACM Trans. Web 3.3 (2009): 1-52.<br />
Di Penta, Massimiliano and Gerardo, Esposito, Gianpiero Canfora. &#8220;Search-based Testing of Service Level Agreements.&#8221; Proceedings of the 9th annual conference on Genetic and evolutionary computation. London, England: ACM, 2007. 1090-1097.<br />
Di Penta, Massimiliano, et al. &#8220;Search-based testing of service level agreements.&#8221; GECCO &#8217;07: Proceedings of the 9th annual conference on Genetic and evolutionary computation. London, England: ACM, 2007. 1090-1097.<br />
Hofmann, U., I. Miloucheva and T. Pfeiffenberger. &#8220;INTERMON: complex QoS/SLA analysis in large scale Internet environment.&#8221; WISICT &#8217;04: Proceedings of the winter international synposium on Information and communication technologies. Cancun, Mexico: Trinity College Dublin, 2004. 1-13.<br />
Huang, A. F. M. &#8220;An optimal QoS-based Web service selection scheme.&#8221; Information Sciences 179.19 (2009): 3309-3322.<br />
IBM. WSLA: Web Service Level Agreement. 2004. 12 April 2009 &lt;</span></em><a href="http://www.research.ibm.com/wsla/about.html"><em><span style="font-size: x-small">http://www.research.ibm.com/wsla/about.html</span></em></a><em><span style="font-size: x-small">&gt;.<br />
Ludwig, Heiko, et al. &#8220;Web Service Level Agreement (WSLA) Language Specification.&#8221; 28 January 2003. IBM Research. 20 March 2010 &lt;</span></em><a href="http://www.research.ibm.com/wsla/WSLASpecV1-20030128.pdf"><em><span style="font-size: x-small">http://www.research.ibm.com/wsla/WSLASpecV1-20030128.pdf</span></em></a><em><span style="font-size: x-small">&gt;.<br />
Martin, Evan, Suranjana Basu and Tao Xie. &#8220;Automated Robustness Testing of Web Services.&#8221; Proc. 4th International Workshop on SOA And Web Services Best Practices (SOAWS 2006). Portland, Oregon: NCSU, 2006.<br />
—. &#8220;Automated Testing and Response Analysis of Web Services.&#8221; Proc. the IEEE International Conference on Web Services (ICWS 2007), Application Services and Industry Track. Salt Lake City, Utah: NCSU, 2007. 647-654.<br />
Michlmayr, Anton, et al. &#8220;Comprehensive QoS monitoring of Web services and event-based SLA violation detection.&#8221; MWSOC &#8217;09: Proceedings of the 4th International Workshop on Middleware for Service Oriented Computing. Urbana Champaign, Illinois: ACM, 2009. 1-6.<br />
Myerson, Judith. Use SLAs in a Web services context. 29 October 2004. 11 April 2010 &lt;</span></em><a href="http://www.ibm.com/developerworks/webservices/library/ws-sla/"><em><span style="font-size: x-small">http://www.ibm.com/developerworks/webservices/library/ws-sla/</span></em></a><em><span style="font-size: x-small">&gt;.<br />
Raimondi, Franco, James Skene and Wolfgang Emmerich. &#8220;Efficient online monitoring of web-service SLAs.&#8221; SIGSOFT &#8217;08/FSE-16: Proceedings of the 16th ACM SIGSOFT International Symposium on Foundations of software engineering. Atlanta, Georgia: ACM, 2008. 170-180.<br />
Skene, James, et al. &#8220;The monitorability of service-level agreements for applicaiton-service provision.&#8221; WOSP &#8217;07: Proceedings of the 6th international workshop on Software and performance. Buenes Aires, Argentina: ACM, 2007. 3-14.<br />
Sommers, Joel, et al. &#8220;Accurate and efficient SLA compliance monitoring.&#8221; SIGCOMM &#8217;07: Proceedings of the 2007 conference on Applications, technologies, architectures, and protocols for computer communications. Kyoto, Japan: ACM, 2007. 109-120.</span></em></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.dotnetkicks.com/seesharprun/2010/05/06/using-dynamic-sla-documents-in-web-service-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordle</title>
		<link>http://blogs.dotnetkicks.com/seesharprun/2010/04/19/wordle/</link>
		<comments>http://blogs.dotnetkicks.com/seesharprun/2010/04/19/wordle/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 15:12:00 +0000</pubDate>
		<dc:creator>Sidney Andrews</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://seesharprun.net/post.aspx?id=b4cba901-6914-457a-87aa-351679e2444e</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wordle.net/show/wrdl/1918992/SeeSharpRun"><img style="border-bottom: 0px;border-left: 0px;float: none;margin-left: auto;border-top: 0px;margin-right: auto;border-right: 0px" border="0" alt="wordle" src="http://www.seesharprun.net/image.axd?picture=wordle_thumb.png" width="550" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.dotnetkicks.com/seesharprun/2010/04/19/wordle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Quest for a Codeless User Interface</title>
		<link>http://blogs.dotnetkicks.com/seesharprun/2010/03/22/my-quest-for-a-codeless-user-interface/</link>
		<comments>http://blogs.dotnetkicks.com/seesharprun/2010/03/22/my-quest-for-a-codeless-user-interface/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 07:14:05 +0000</pubDate>
		<dc:creator>Sidney Andrews</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://blogs.dotnetkicks.com/seesharprun/?p=14</guid>
		<description><![CDATA[There is not doubt about it.  I love XAML!  Coming from someone with a web application background, I understand the importance of using markup to define visual traits of an application.  I also understand that the transition from HTML to XAML is very smooth and will lead to a new generation of .NET developers who &#8230; </p><p><a class="more-link block-button" href="http://blogs.dotnetkicks.com/seesharprun/2010/03/22/my-quest-for-a-codeless-user-interface/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>There is not doubt about it.  I love XAML!  Coming from someone with a web application background, I understand the importance of using markup to define visual traits of an application.  I also understand that the transition from HTML to XAML is very smooth and will lead to a new generation of .NET developers who design user experiences for both the desktop and web.  What I have yet to see, is a complex User Interface written without a lot of unnecessary code-behind.  XAML was designed so that you keep all of your user-interface logic in the markup and your business logic will dominate your code behind and libraries.  Unfortunately, I have yet to see this pattern manifest.<br />
<span id="more-14"></span></p>
<p>The problem is not just in WPF/SV3 code samples from co-workers and friends, but even online with tutorials and code samples.  I would think that most of the MSDN and Microsoft-based web samples would encourage the use of <a href="http://msdn.microsoft.com/en-us/library/system.windows.trigger.aspx" target="_blank">Triggers</a>, <a href="http://gallery.expression.microsoft.com/en-us/WPFBehaviors1" target="_blank">Behaviors</a> and <a href="http://blogs.msdn.com/ebooth/archive/2006/01/03/508642.aspx" target="_blank">Styles</a> as opposed to code-behind logic.  Here’s an example of what I mean <a href="http://msdn.microsoft.com/en-us/magazine/cc163421.aspx">http://msdn.microsoft.com/en-us/magazine/cc163421.aspx</a>.  Many of the things that the code-behind is used for can easily be done with behaviors and triggers.  Instead these features are treated as “nifty” and “advanced” thus alienating the common developer from using them.  I was an immediate WPF/SV2 convert and it took me almost a year to fully understand the power of XAML.</p>
<p>So here’s the point.  Every time there is a new release looming for Silverlight, I step back and try to develop an interactive user interface without any code-behind at all.  I even go as far as to not write library classes and behaviors by hand, but sometimes that just can’t be helped.  I usually imagine a product that’s being used for an elementary school.  These products normally need good animation, have to be colorful and would need to be VERY interactive.  Sometimes I do throw in LOB (line-of-business) components in there just to see what they would look like.  This project was done using WPF 4 &amp; Silverlight 4  Here is a sample of the project:</p>
<div><a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=4.0.50303.0"> <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none" /> </a> </div>
<p>I found that WPF was FAR easier to develop with.  Silverlight does have the advantage of industry acceptance and reach, but it is (sort of) a subset of WPF.  The XAML for the WPF version is posted below for your review:</p>
<p>I just wanted to make three points about this code sample:</p>
<ul>
<li>I tried to use the PathListBox multiple times, so that I can get used to how powerful this is.  By controlling our layouts with a Path, we can do some really amazing things.  Specifically, I can see people creating dynamic menus using a combination of Paths and Animations</li>
<li>The Silverlight Triggers are a bit less intuitive then in WPF.  In WPF, I could write triggers that were nested in the top-level control and affected any component I would like.  However, the Silverlight way of nesting Triggers forced a trigger to be within the hierarchy at the point where it would be used.  That IS much more readable.</li>
<li>The PathListBox operates very much like a regular ListBox, and I had fun binding to it’s selectedItem.  In Silverlight, I used Element Property Binding, but I preferred the much better method of using “IsSynchronizedWithCurrentItem” like in WPF.  This option is available in SV4, but for the PathListBox, and error is thrown when you use it in SV4.  This may be a bug.</li>
</ul>
<h3>Pure XAML</h3>
<pre class="brush: xml; title: ; notranslate">&lt;Window x:Class=&quot;TBLLayout.FunWindow&quot;
    xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
    xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
    xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
    xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
    xmlns:i=&quot;http://schemas.microsoft.com/expression/2010/interactivity&quot;
    xmlns:ei=&quot;http://schemas.microsoft.com/expression/2010/interactions&quot;
    xmlns:ec=&quot;http://schemas.microsoft.com/expression/2010/controls&quot;
    xmlns:ed=&quot;http://schemas.microsoft.com/expression/2010/drawing&quot;
    xmlns:ee=&quot;http://schemas.microsoft.com/expression/2010/effects&quot;
    xmlns:p=&quot;clr-namespace:TBLLayout.Properties&quot;
    xmlns:cm=&quot;clr-namespace:System.ComponentModel;assembly=WindowsBase&quot;
    xmlns:l=&quot;clr-namespace:TBLLayout&quot;
    mc:Ignorable=&quot;d&quot;
    Title=&quot;{Binding Title, Mode=OneWay, Source={x:Static p:Settings.Default}}&quot;
    UseLayoutRounding=&quot;True&quot;
    Width=&quot;960&quot; Height=&quot;720&quot;&gt;
    &lt;Window.Resources&gt;
        &lt;BooleanToVisibilityConverter x:Key=&quot;BooleanToVisibilityConverter&quot;/&gt;
        &lt;Storyboard x:Key=&quot;Ellipse.MouseEnter&quot;&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)&quot; Storyboard.TargetName=&quot;corner&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.4&quot; Value=&quot;35&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)&quot; Storyboard.TargetName=&quot;corner&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.4&quot; Value=&quot;15&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.Opacity)&quot; Storyboard.TargetName=&quot;menu&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:1.0&quot; Value=&quot;1&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)&quot; Storyboard.TargetName=&quot;smile&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.4&quot; Value=&quot;15&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)&quot; Storyboard.TargetName=&quot;smile&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.4&quot; Value=&quot;35&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
        &lt;/Storyboard&gt;
        &lt;Storyboard x:Key=&quot;Ellipse.MouseLeave&quot;&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)&quot; Storyboard.TargetName=&quot;corner&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.4&quot; Value=&quot;0&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)&quot; Storyboard.TargetName=&quot;corner&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.4&quot; Value=&quot;0&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.Opacity)&quot; Storyboard.TargetName=&quot;menu&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:1.0&quot; Value=&quot;0&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)&quot; Storyboard.TargetName=&quot;smile&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.4&quot; Value=&quot;0&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)&quot; Storyboard.TargetName=&quot;smile&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.4&quot; Value=&quot;0&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
        &lt;/Storyboard&gt;
        &lt;Style x:Key=&quot;AlternatingBoxStyle&quot; TargetType=&quot;{x:Type ListBoxItem}&quot;&gt;
            &lt;Style.Triggers&gt;
                &lt;Trigger Property=&quot;ItemsControl.AlternationIndex&quot; Value=&quot;0&quot;&gt;
                    &lt;Setter Property=&quot;Background&quot; Value=&quot;#FFEFD79E&quot; /&gt;
                    &lt;Setter Property=&quot;Foreground&quot; Value=&quot;#FF352006&quot; /&gt;
                &lt;/Trigger&gt;
                &lt;Trigger Property=&quot;ItemsControl.AlternationIndex&quot; Value=&quot;1&quot;&gt;
                    &lt;Setter Property=&quot;Background&quot; Value=&quot;#FF050845&quot; /&gt;
                    &lt;Setter Property=&quot;Foreground&quot; Value=&quot;#FFCCEDFB&quot; /&gt;
                &lt;/Trigger&gt;
            &lt;/Style.Triggers&gt;
            &lt;Setter Property=&quot;FontWeight&quot; Value=&quot;Bold&quot; /&gt;
        &lt;/Style&gt;
        &lt;Style x:Key=&quot;MenuButtonStyle&quot; TargetType=&quot;{x:Type Button}&quot;&gt;
            &lt;Setter Property=&quot;FocusVisualStyle&quot;&gt;
                &lt;Setter.Value&gt;
                    &lt;Style&gt;
                        &lt;Setter Property=&quot;Control.Template&quot;&gt;
                            &lt;Setter.Value&gt;
                                &lt;ControlTemplate&gt;
                                    &lt;Rectangle Margin=&quot;2&quot; SnapsToDevicePixels=&quot;true&quot; Stroke=&quot;Black&quot; StrokeThickness=&quot;1&quot; StrokeDashArray=&quot;1 2&quot;/&gt;
                                &lt;/ControlTemplate&gt;
                            &lt;/Setter.Value&gt;
                        &lt;/Setter&gt;
                    &lt;/Style&gt;
                &lt;/Setter.Value&gt;
            &lt;/Setter&gt;
            &lt;Setter Property=&quot;Background&quot;&gt;
                &lt;Setter.Value&gt;
                    &lt;LinearGradientBrush EndPoint=&quot;0,1&quot; StartPoint=&quot;0,0&quot;&gt;
                        &lt;GradientStop Color=&quot;#F3F3F3&quot; Offset=&quot;0&quot;/&gt;
                        &lt;GradientStop Color=&quot;#EBEBEB&quot; Offset=&quot;0.5&quot;/&gt;
                        &lt;GradientStop Color=&quot;#DDDDDD&quot; Offset=&quot;0.5&quot;/&gt;
                        &lt;GradientStop Color=&quot;#CDCDCD&quot; Offset=&quot;1&quot;/&gt;
                    &lt;/LinearGradientBrush&gt;
                &lt;/Setter.Value&gt;
            &lt;/Setter&gt;
            &lt;Setter Property=&quot;BorderBrush&quot; Value=&quot;#FF707070&quot;/&gt;
            &lt;Setter Property=&quot;BorderThickness&quot; Value=&quot;0&quot;/&gt;
            &lt;Setter Property=&quot;Foreground&quot; Value=&quot;#FF3F3F3F&quot;/&gt;
            &lt;Setter Property=&quot;HorizontalContentAlignment&quot; Value=&quot;Center&quot;/&gt;
            &lt;Setter Property=&quot;VerticalContentAlignment&quot; Value=&quot;Center&quot;/&gt;
            &lt;Setter Property=&quot;Padding&quot; Value=&quot;2&quot;/&gt;
            &lt;Setter Property=&quot;Template&quot;&gt;
                &lt;Setter.Value&gt;
                    &lt;ControlTemplate TargetType=&quot;{x:Type Button}&quot;&gt;
                        &lt;ControlTemplate.Resources&gt;
                            &lt;Storyboard x:Key=&quot;Button.Press&quot;&gt;
                                &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(Border.BorderBrush).(SolidColorBrush.Color)&quot; Storyboard.TargetName=&quot;border&quot;&gt;
                                    &lt;EasingColorKeyFrame KeyTime=&quot;0:0:0.25&quot; Value=&quot;#FFC3C5C6&quot;/&gt;
                                &lt;/ColorAnimationUsingKeyFrames&gt;
                                &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(Panel.Background).(SolidColorBrush.Color)&quot; Storyboard.TargetName=&quot;border&quot;&gt;
                                    &lt;EasingColorKeyFrame KeyTime=&quot;0:0:0.25&quot; Value=&quot;#FF236B7E&quot;/&gt;
                                &lt;/ColorAnimationUsingKeyFrames&gt;
                            &lt;/Storyboard&gt;
                            &lt;Storyboard x:Key=&quot;Button.UnPress&quot;&gt;
                                &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(Border.BorderBrush).(SolidColorBrush.Color)&quot; Storyboard.TargetName=&quot;border&quot;&gt;
                                    &lt;EasingColorKeyFrame KeyTime=&quot;0:0:0.25&quot; Value=&quot;#00000000&quot;/&gt;
                                &lt;/ColorAnimationUsingKeyFrames&gt;
                                &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(Panel.Background).(SolidColorBrush.Color)&quot; Storyboard.TargetName=&quot;border&quot;&gt;
                                    &lt;EasingColorKeyFrame KeyTime=&quot;0:0:0.25&quot; Value=&quot;#FFBFEAF5&quot;/&gt;
                                &lt;/ColorAnimationUsingKeyFrames&gt;
                            &lt;/Storyboard&gt;
                        &lt;/ControlTemplate.Resources&gt;
                        &lt;Border x:Name=&quot;border&quot; Background=&quot;#FFBFEAF5&quot; CornerRadius=&quot;10&quot; BorderThickness=&quot;2&quot; BorderBrush=&quot;#00000000&quot; Opacity=&quot;0.85&quot;&gt;
                            &lt;Border.Effect&gt;
                                &lt;DropShadowEffect Color=&quot;#FF226278&quot; ShadowDepth=&quot;5&quot; Opacity=&quot;0.695&quot;/&gt;
                            &lt;/Border.Effect&gt;
                            &lt;ContentPresenter HorizontalAlignment=&quot;{TemplateBinding HorizontalContentAlignment}&quot; Margin=&quot;{TemplateBinding Padding}&quot; RecognizesAccessKey=&quot;True&quot; SnapsToDevicePixels=&quot;{TemplateBinding SnapsToDevicePixels}&quot; VerticalAlignment=&quot;{TemplateBinding VerticalContentAlignment}&quot;/&gt;
                        &lt;/Border&gt;
                        &lt;ControlTemplate.Triggers&gt;
                            &lt;Trigger Property=&quot;IsMouseOver&quot; Value=&quot;True&quot;&gt;
                                &lt;Setter Property=&quot;Background&quot; TargetName=&quot;border&quot; Value=&quot;#FF71B8CA&quot;/&gt;
                                &lt;Setter Property=&quot;BorderBrush&quot; TargetName=&quot;border&quot; Value=&quot;#FF9F9F9F&quot;/&gt;
                            &lt;/Trigger&gt;
                            &lt;Trigger Property=&quot;IsEnabled&quot; Value=&quot;false&quot;&gt;
                                &lt;Setter Property=&quot;Foreground&quot; Value=&quot;#ADADAD&quot;/&gt;
                                &lt;Setter Property=&quot;Background&quot; TargetName=&quot;border&quot; Value=&quot;#FFDBE5E7&quot;/&gt;
                            &lt;/Trigger&gt;
                            &lt;Trigger Property=&quot;IsPressed&quot; Value=&quot;True&quot;&gt;
                                &lt;Trigger.EnterActions&gt;
                                    &lt;BeginStoryboard Storyboard=&quot;{StaticResource Button.Press}&quot;/&gt;
                                &lt;/Trigger.EnterActions&gt;
                            &lt;/Trigger&gt;
                        &lt;/ControlTemplate.Triggers&gt;
                    &lt;/ControlTemplate&gt;
                &lt;/Setter.Value&gt;
            &lt;/Setter&gt;
        &lt;/Style&gt;
        &lt;DataTemplate x:Key=&quot;ItemTemplate&quot;&gt;
            &lt;StackPanel&gt;
                &lt;TextBlock Text=&quot;{Binding Code}&quot;/&gt;
            &lt;/StackPanel&gt;
        &lt;/DataTemplate&gt;
        &lt;Storyboard x:Key=&quot;Tab.MouseEnter&quot;&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)&quot; Storyboard.TargetName=&quot;bottomBar&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.6&quot; Value=&quot;0&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
        &lt;/Storyboard&gt;
        &lt;Storyboard x:Key=&quot;Tab.MouseLeave&quot;&gt;
            &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)&quot; Storyboard.TargetName=&quot;bottomBar&quot;&gt;
                &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.6&quot; Value=&quot;55&quot;/&gt;
            &lt;/DoubleAnimationUsingKeyFrames&gt;
        &lt;/Storyboard&gt;
        &lt;Color x:Key=&quot;PlainGray&quot;&gt;#FFD8D8D8&lt;/Color&gt;
        &lt;DataTemplate x:Key=&quot;WordsItemTemplate&quot;&gt;
            &lt;Border BorderThickness=&quot;1&quot; BorderBrush=&quot;Black&quot; Padding=&quot;2,1&quot; Background=&quot;#FF3B0909&quot;&gt;
                &lt;Grid Height=&quot;29.733&quot; Width=&quot;109.763&quot;&gt;
                    &lt;TextBlock Text=&quot;{Binding EmployeeCount}&quot; Margin=&quot;0&quot; HorizontalAlignment=&quot;Left&quot; d:LayoutOverrides=&quot;Height&quot; VerticalAlignment=&quot;Top&quot; FontSize=&quot;8&quot; FontWeight=&quot;Bold&quot; Foreground=&quot;#FFD8B1B1&quot;/&gt;
                    &lt;TextBlock Text=&quot;{Binding Name}&quot; Margin=&quot;0,12,0,0&quot; d:LayoutOverrides=&quot;Width, Height&quot; HorizontalAlignment=&quot;Left&quot; VerticalAlignment=&quot;Top&quot; FontWeight=&quot;Bold&quot; FontSize=&quot;13.333&quot; Foreground=&quot;#FFD8B1B1&quot;/&gt;
                &lt;/Grid&gt;
            &lt;/Border&gt;
        &lt;/DataTemplate&gt;
        &lt;DataTemplate x:Key=&quot;WordsItemTemplate1&quot;&gt;
            &lt;StackPanel&gt;
                &lt;TextBlock Text=&quot;{Binding EmployeeCount}&quot;/&gt;
                &lt;Image Source=&quot;{Binding Icon}&quot; HorizontalAlignment=&quot;Left&quot; Height=&quot;64&quot; Width=&quot;64&quot;/&gt;
                &lt;TextBlock Text=&quot;{Binding Name}&quot;/&gt;
            &lt;/StackPanel&gt;
        &lt;/DataTemplate&gt;
    &lt;/Window.Resources&gt;
    &lt;Window.Triggers&gt;
        &lt;EventTrigger RoutedEvent=&quot;Mouse.MouseEnter&quot; SourceName=&quot;topBar&quot;&gt;
            &lt;BeginStoryboard x:Name=&quot;Ellipse_MouseEnter_BeginStoryboard&quot; Storyboard=&quot;{StaticResource Ellipse.MouseEnter}&quot;/&gt;
        &lt;/EventTrigger&gt;
        &lt;EventTrigger RoutedEvent=&quot;Mouse.MouseLeave&quot; SourceName=&quot;topBar&quot;&gt;
            &lt;BeginStoryboard x:Name=&quot;Ellipse_MouseLeave_BeginStoryboard&quot; Storyboard=&quot;{StaticResource Ellipse.MouseLeave}&quot;/&gt;
        &lt;/EventTrigger&gt;
        &lt;EventTrigger RoutedEvent=&quot;Mouse.MouseEnter&quot; SourceName=&quot;bottomBar&quot;&gt;
            &lt;BeginStoryboard x:Name=&quot;Tab_MouseEnter_BeginStoryboard&quot; Storyboard=&quot;{StaticResource Tab.MouseEnter}&quot;/&gt;
        &lt;/EventTrigger&gt;
        &lt;EventTrigger RoutedEvent=&quot;Mouse.MouseLeave&quot; SourceName=&quot;bottomBar&quot;&gt;
            &lt;BeginStoryboard x:Name=&quot;Tab_MouseLeave_BeginStoryboard&quot; Storyboard=&quot;{StaticResource Tab.MouseLeave}&quot;/&gt;
        &lt;/EventTrigger&gt;
        &lt;EventTrigger RoutedEvent=&quot;Mouse.MouseEnter&quot; SourceName=&quot;starList&quot;&gt;
            &lt;BeginStoryboard x:Name=&quot;Tab_MouseEnter_BeginStoryboard1&quot; Storyboard=&quot;{StaticResource Tab.MouseEnter}&quot;/&gt;
        &lt;/EventTrigger&gt;
        &lt;EventTrigger RoutedEvent=&quot;Mouse.MouseLeave&quot; SourceName=&quot;starList&quot;&gt;
            &lt;BeginStoryboard x:Name=&quot;Tab_MouseLeave_BeginStoryboard1&quot; Storyboard=&quot;{StaticResource Tab.MouseLeave}&quot;/&gt;
        &lt;/EventTrigger&gt;
    &lt;/Window.Triggers&gt;
    &lt;Grid x:Name=&quot;LayoutRoot&quot; DataContext=&quot;{Binding Source={StaticResource SampleDataSource}}&quot;&gt;

        &lt;Grid x:Name=&quot;topBar&quot; Height=&quot;150&quot; Margin=&quot;-40,-100,0,0&quot; VerticalAlignment=&quot;Top&quot;&gt;
            &lt;Ellipse x:Name=&quot;corner&quot; Margin=&quot;5&quot; Width=&quot;150&quot; RenderTransformOrigin=&quot;0.5,0.5&quot; Fill=&quot;#FFE3E72E&quot; HorizontalAlignment=&quot;Left&quot;&gt;
                &lt;Ellipse.RenderTransform&gt;
                    &lt;TransformGroup&gt;
                        &lt;ScaleTransform/&gt;
                        &lt;SkewTransform/&gt;
                        &lt;RotateTransform/&gt;
                        &lt;TranslateTransform/&gt;
                    &lt;/TransformGroup&gt;
                &lt;/Ellipse.RenderTransform&gt;
                &lt;Ellipse.Effect&gt;
                    &lt;BlurEffect Radius=&quot;20&quot;/&gt;
                &lt;/Ellipse.Effect&gt;
            &lt;/Ellipse&gt;
            &lt;Grid x:Name=&quot;menu&quot; Height=&quot;35&quot; Margin=&quot;40,0,0,15&quot; VerticalAlignment=&quot;Bottom&quot; Opacity=&quot;0&quot;&gt;
                &lt;Grid.Resources&gt;
                    &lt;Style TargetType=&quot;{x:Type Button}&quot; BasedOn=&quot;{StaticResource MenuButtonStyle}&quot;&gt;
                        &lt;Setter Property=&quot;Background&quot; Value=&quot;{x:Null}&quot; /&gt;
                        &lt;Setter Property=&quot;BorderBrush&quot; Value=&quot;{x:Null}&quot; /&gt;
                        &lt;Setter Property=&quot;Margin&quot; Value=&quot;5,0&quot; /&gt;
                    &lt;/Style&gt;
                &lt;/Grid.Resources&gt;
                &lt;Grid.ColumnDefinitions&gt;
                    &lt;ColumnDefinition Width=&quot;0.25*&quot;/&gt;
                    &lt;ColumnDefinition Width=&quot;0.15*&quot;/&gt;
                    &lt;ColumnDefinition Width=&quot;0.15*&quot;/&gt;
                    &lt;ColumnDefinition Width=&quot;0.15*&quot;/&gt;
                    &lt;ColumnDefinition Width=&quot;0.15*&quot;/&gt;
                    &lt;ColumnDefinition Width=&quot;0.15*&quot;/&gt;
                &lt;/Grid.ColumnDefinitions&gt;
                &lt;Path x:Name=&quot;bar&quot; Data=&quot;M0,0 L206.27699,0 282.99999,0 364.72299,0 364.58949,0.45385981 C360.5183,12.556008 326.66245,22 285.49999,22 L282.99999,21.982107 282.99999,22 0,22 z&quot; Fill=&quot;#FF5FEDC2&quot; Margin=&quot;125,0,0,5&quot; Stretch=&quot;Fill&quot; UseLayoutRounding=&quot;False&quot; Opacity=&quot;0.55&quot; Grid.ColumnSpan=&quot;6&quot; VerticalAlignment=&quot;Top&quot; RenderTransformOrigin=&quot;0.5,0.5&quot;&gt;
                    &lt;Path.RenderTransform&gt;
                        &lt;TransformGroup&gt;
                            &lt;ScaleTransform ScaleY=&quot;1&quot; ScaleX=&quot;-1&quot;/&gt;
                            &lt;SkewTransform AngleY=&quot;0&quot; AngleX=&quot;0&quot;/&gt;
                            &lt;RotateTransform Angle=&quot;0&quot;/&gt;
                            &lt;TranslateTransform/&gt;
                        &lt;/TransformGroup&gt;
                    &lt;/Path.RenderTransform&gt;
                    &lt;Path.Effect&gt;
                        &lt;BlurEffect Radius=&quot;39&quot;/&gt;
                    &lt;/Path.Effect&gt;
                &lt;/Path&gt;
                &lt;Button Content=&quot;Red&quot; Grid.Column=&quot;1&quot; &gt;
                    &lt;i:Interaction.Triggers&gt;
                        &lt;i:EventTrigger EventName=&quot;Click&quot;&gt;
                            &lt;ei:ChangePropertyAction TargetObject=&quot;{Binding ElementName=activeArea}&quot; PropertyName=&quot;Background&quot;&gt;
                                &lt;ei:ChangePropertyAction.Value&gt;
                                    &lt;SolidColorBrush Color=&quot;Red&quot;/&gt;
                                &lt;/ei:ChangePropertyAction.Value&gt;
                            &lt;/ei:ChangePropertyAction&gt;
                        &lt;/i:EventTrigger&gt;
                    &lt;/i:Interaction.Triggers&gt;
                &lt;/Button&gt;
                &lt;Button Content=&quot;Blue&quot; Grid.Column=&quot;2&quot; &gt;
                    &lt;i:Interaction.Triggers&gt;
                        &lt;i:EventTrigger EventName=&quot;Click&quot;&gt;
                            &lt;ei:ChangePropertyAction TargetObject=&quot;{Binding ElementName=activeArea}&quot; PropertyName=&quot;Background&quot;&gt;
                                &lt;ei:ChangePropertyAction.Value&gt;
                                    &lt;SolidColorBrush Color=&quot;#FF0C00FF&quot;/&gt;
                                &lt;/ei:ChangePropertyAction.Value&gt;
                            &lt;/ei:ChangePropertyAction&gt;
                        &lt;/i:EventTrigger&gt;
                    &lt;/i:Interaction.Triggers&gt;
                &lt;/Button&gt;
                &lt;Button Content=&quot;Green&quot; Grid.Column=&quot;3&quot; &gt;
                    &lt;i:Interaction.Triggers&gt;
                        &lt;i:EventTrigger EventName=&quot;Click&quot;&gt;
                            &lt;ei:ChangePropertyAction TargetObject=&quot;{Binding ElementName=activeArea}&quot; PropertyName=&quot;Background&quot;&gt;
                                &lt;ei:ChangePropertyAction.Value&gt;
                                    &lt;SolidColorBrush Color=&quot;Lime&quot;/&gt;
                                &lt;/ei:ChangePropertyAction.Value&gt;
                            &lt;/ei:ChangePropertyAction&gt;
                        &lt;/i:EventTrigger&gt;
                    &lt;/i:Interaction.Triggers&gt;
                &lt;/Button&gt;
                &lt;Button Content=&quot;Purple&quot; Grid.Column=&quot;4&quot; &gt;
                    &lt;i:Interaction.Triggers&gt;
                        &lt;i:EventTrigger EventName=&quot;Click&quot;&gt;
                            &lt;ei:ChangePropertyAction TargetObject=&quot;{Binding ElementName=activeArea}&quot; PropertyName=&quot;Background&quot;&gt;
                                &lt;ei:ChangePropertyAction.Value&gt;
                                    &lt;SolidColorBrush Color=&quot;#FFE100FF&quot;/&gt;
                                &lt;/ei:ChangePropertyAction.Value&gt;
                            &lt;/ei:ChangePropertyAction&gt;
                        &lt;/i:EventTrigger&gt;
                    &lt;/i:Interaction.Triggers&gt;
                &lt;/Button&gt;
                &lt;Button Content=&quot;Yellow&quot; Grid.Column=&quot;5&quot; &gt;
                    &lt;i:Interaction.Triggers&gt;
                        &lt;i:EventTrigger EventName=&quot;Click&quot;&gt;
                            &lt;ei:ChangePropertyAction TargetObject=&quot;{Binding ElementName=activeArea}&quot; PropertyName=&quot;Background&quot;&gt;
                                &lt;ei:ChangePropertyAction.Value&gt;
                                    &lt;SolidColorBrush Color=&quot;#FFFFF900&quot;/&gt;
                                &lt;/ei:ChangePropertyAction.Value&gt;
                            &lt;/ei:ChangePropertyAction&gt;
                        &lt;/i:EventTrigger&gt;
                    &lt;/i:Interaction.Triggers&gt;
                &lt;/Button&gt;
            &lt;/Grid&gt;
            &lt;Path x:Name=&quot;smile&quot; Fill=&quot;#FF393939&quot; Data=&quot;m 319.96413 387.5438 c -27.11337 -4.44629 -42.6132 -18.08724 -46.44081 -40.87119 -0.59089 -3.51732 -0.46743 -3.80087 1.52401 -3.5 1.56315 0.23616 2.58635 1.58132 3.67194 4.82739 6.05224 18.09697 27.57654 28.54291 58.28073 28.28416 25.28423 -0.21307 44.38169 -9.84069 53.14755 -26.79332 2.30065 -4.44932 3.93641 -6.4846 5.21374 -6.48714 1.60761 -0.003 1.76691 0.50739 1.16876 3.7463 -1.9977 10.81735 -12.45722 24.98033 -23.95164 32.43234 -12.84471 8.32742 -33.14704 11.55387 -52.61428 8.36146 z m 58.65075 -73.6321 c -9.00059 -7.07986 -6.45702 -20.78146 4.46537 -24.05389 13.85524 -4.15113 23.02017 15.7667 10.98635 23.87629 -4.47246 3.01399 -11.73965 3.09752 -15.45172 0.1776 z m 3.7125 -12.05559 c 0.78886 -3.01661 -2.24111 -5.61329 -5.09111 -4.36307 -1.27852 0.56086 -2.04014 1.57567 -1.75 2.33179 0.28255 0.73631 0.51373 1.90846 0.51373 2.60478 0 0.71154 1.27083 1.30216 2.90159 1.34853 2.10334 0.0598 3.0458 -0.46897 3.42579 -1.92203 z m -112.05769 10.6613 c -9.46007 -4.11255 -9.55303 -19.21681 -0.1482 -24.08024 4.63157 -2.39507 11.21237 -1.44955 14.97047 2.15093 11.16975 10.7013 -0.59878 28.11266 -14.82227 21.92931 z M 271.75 299.13569 C 273.32053 296.16512 273.31175 296 271.58333 296 c -0.77916 0 -1.5871 -0.51131 -1.79541 -1.13624 -0.78238 -2.34714 -4.63584 1.32851 -4.26881 4.07183 0.41371 3.09222 0.0483 2.73848 2.73089 2.64381 1.29218 -0.0456 2.78212 -1.08588 3.5 -2.44371 z&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;70,80,0,20&quot; UseLayoutRounding=&quot;False&quot; Stretch=&quot;Fill&quot; Width=&quot;50&quot; RenderTransformOrigin=&quot;0.5,0.5&quot;&gt;
                &lt;Path.RenderTransform&gt;
                    &lt;TransformGroup&gt;
                        &lt;ScaleTransform/&gt;
                        &lt;SkewTransform/&gt;
                        &lt;RotateTransform/&gt;
                        &lt;TranslateTransform/&gt;
                    &lt;/TransformGroup&gt;
                &lt;/Path.RenderTransform&gt;
            &lt;/Path&gt;
        &lt;/Grid&gt;
        &lt;Grid x:Name=&quot;activeArea&quot; Margin=&quot;250,200&quot; DataContext=&quot;{Binding SelectedItem, ElementName=starList, Mode=OneWay}&quot;&gt;
            &lt;Grid.Resources&gt;
                &lt;Style TargetType=&quot;{x:Type TextBlock}&quot;&gt;
                    &lt;Style.Triggers&gt;
                        &lt;DataTrigger Binding=&quot;{Binding}&quot; Value=&quot;{x:Null}&quot;&gt;
                            &lt;Setter Property=&quot;Visibility&quot; Value=&quot;Hidden&quot; /&gt;
                        &lt;/DataTrigger&gt;
                    &lt;/Style.Triggers&gt;
                &lt;/Style&gt;
            &lt;/Grid.Resources&gt;
            &lt;Grid.Background&gt;
                &lt;SolidColorBrush x:Name=&quot;activeBG&quot; Color=&quot;{StaticResource PlainGray}&quot; /&gt;
            &lt;/Grid.Background&gt;
            &lt;Grid.Effect&gt;
                &lt;DropShadowEffect Opacity=&quot;0.255&quot;/&gt;
            &lt;/Grid.Effect&gt;
            &lt;TextBlock Margin=&quot;0&quot; TextWrapping=&quot;Wrap&quot; Text=&quot;{Binding Code}&quot; d:LayoutOverrides=&quot;Width, Height&quot; HorizontalAlignment=&quot;Center&quot; VerticalAlignment=&quot;Center&quot; FontFamily=&quot;911 Porscha&quot; FontSize=&quot;64&quot; TextAlignment=&quot;Center&quot;&gt;
                &lt;TextBlock.Effect&gt;
                    &lt;DropShadowEffect Color=&quot;#FF999999&quot; Opacity=&quot;0.7&quot;/&gt;
                &lt;/TextBlock.Effect&gt;
            &lt;/TextBlock&gt;
            &lt;StackPanel Margin=&quot;0&quot; Orientation=&quot;Horizontal&quot; VerticalAlignment=&quot;Top&quot; HorizontalAlignment=&quot;Center&quot;&gt;
                &lt;TextBlock TextWrapping=&quot;Wrap&quot; HorizontalAlignment=&quot;Center&quot; FontFamily=&quot;Kartika&quot; FontSize=&quot;16&quot; Text=&quot;Correct: &quot; /&gt;
                &lt;TextBlock TextWrapping=&quot;Wrap&quot; Text=&quot;{Binding Correct}&quot; HorizontalAlignment=&quot;Center&quot; FontFamily=&quot;Kartika&quot; FontSize=&quot;16&quot;/&gt;
            &lt;/StackPanel&gt;
        &lt;/Grid&gt;
        &lt;Grid x:Name=&quot;bottomBar&quot; VerticalAlignment=&quot;Bottom&quot; Margin=&quot;0&quot; RenderTransformOrigin=&quot;0.5,0.5&quot;&gt;
            &lt;Grid.RenderTransform&gt;
                &lt;TransformGroup&gt;
                    &lt;ScaleTransform/&gt;
                    &lt;SkewTransform/&gt;
                    &lt;RotateTransform/&gt;
                    &lt;TranslateTransform Y=&quot;55&quot;/&gt;
                &lt;/TransformGroup&gt;
            &lt;/Grid.RenderTransform&gt;
            &lt;Path x:Name=&quot;tab&quot; Data=&quot;M27.5,0 C42.450523,0 54.614544,11.496587 54.99102,25.816023 L54.993435,26 55,26 55,26.5 55,90 0,90 0,26.5 0,26 0.0065655573,26 0.0089813769,25.816023 C0.38545704,11.496587 12.549478,0 27.5,0 z&quot; Fill=&quot;#FF5FB5ED&quot; Height=&quot;81&quot; Margin=&quot;0&quot; Stretch=&quot;Fill&quot; UseLayoutRounding=&quot;False&quot; VerticalAlignment=&quot;Bottom&quot; Width=&quot;50&quot; HorizontalAlignment=&quot;Center&quot;&gt;
                &lt;Path.Effect&gt;
                    &lt;DropShadowEffect Direction=&quot;104&quot; Opacity=&quot;0.38&quot; BlurRadius=&quot;8&quot; ShadowDepth=&quot;3&quot;/&gt;
                &lt;/Path.Effect&gt;
            &lt;/Path&gt;
            &lt;Path x:Name=&quot;path&quot; Data=&quot;M219,0 C339.95035,0 438,12.536028 438,27.999996 L0,27.999996 C0,12.536028 98.049637,0 219,0 z&quot; Fill=&quot;#FF5FB5ED&quot; Margin=&quot;0&quot; Stretch=&quot;Fill&quot; UseLayoutRounding=&quot;False&quot; Height=&quot;35&quot; VerticalAlignment=&quot;Bottom&quot;&gt;
                &lt;Path.Effect&gt;
                    &lt;DropShadowEffect Direction=&quot;173&quot; Opacity=&quot;0.575&quot;/&gt;
                &lt;/Path.Effect&gt;
            &lt;/Path&gt;
            &lt;ec:PathListBox x:Name=&quot;starList&quot; HorizontalAlignment=&quot;Center&quot; Height=&quot;0&quot; Margin=&quot;0,0,0,-361&quot; VerticalAlignment=&quot;Bottom&quot; Width=&quot;0&quot; ItemsSource=&quot;{Binding Numbers}&quot; &gt;
                &lt;ec:PathListBox.LayoutPaths&gt;
                    &lt;ec:LayoutPath SourceElement=&quot;{Binding ElementName=path}&quot; Span=&quot;0.45&quot; Start=&quot;0.8&quot; Capacity=&quot;10&quot;/&gt;
                &lt;/ec:PathListBox.LayoutPaths&gt;
                &lt;ec:PathListBox.ItemTemplate&gt;
                    &lt;DataTemplate&gt;
                        &lt;Grid&gt;
                            &lt;ed:RegularPolygon x:Name=&quot;regularPolygon&quot; HorizontalAlignment=&quot;Stretch&quot; VerticalAlignment=&quot;Stretch&quot; Height=&quot;35&quot; Width=&quot;35&quot;
                                PointCount=&quot;5&quot; Stretch=&quot;Fill&quot; InnerRadius=&quot;0.47211&quot;&gt;
                                &lt;ed:RegularPolygon.Style&gt;
                                    &lt;Style TargetType=&quot;ed:RegularPolygon&quot;&gt;
                                        &lt;Style.Triggers&gt;
                                            &lt;DataTrigger Binding=&quot;{Binding Correct}&quot; Value=&quot;True&quot;&gt;
                                                &lt;Setter Property=&quot;Fill&quot;&gt;
                                                    &lt;Setter.Value&gt;
                                                        &lt;LinearGradientBrush EndPoint=&quot;0.5,1&quot; StartPoint=&quot;0.5,0&quot;&gt;
                                                            &lt;GradientStop Color=&quot;#FFD9E082&quot; Offset=&quot;0&quot; /&gt;
                                                            &lt;GradientStop Color=&quot;#FFDDE939&quot;  Offset=&quot;1&quot; /&gt;
                                                        &lt;/LinearGradientBrush&gt;
                                                    &lt;/Setter.Value&gt;
                                                &lt;/Setter&gt;
                                            &lt;/DataTrigger&gt;
                                            &lt;DataTrigger Binding=&quot;{Binding Correct}&quot; Value=&quot;False&quot;&gt;
                                                &lt;Setter Property=&quot;Fill&quot;&gt;
                                                    &lt;Setter.Value&gt;
                                                        &lt;LinearGradientBrush EndPoint=&quot;0.5,1&quot; StartPoint=&quot;0.5,0&quot;&gt;
                                                            &lt;GradientStop Color=&quot;#FFE91616&quot; Offset=&quot;0&quot; /&gt;
                                                            &lt;GradientStop Color=&quot;#FFFF7A7A&quot;  Offset=&quot;1&quot; /&gt;
                                                        &lt;/LinearGradientBrush&gt;
                                                    &lt;/Setter.Value&gt;
                                                &lt;/Setter&gt;
                                            &lt;/DataTrigger&gt;
                                        &lt;/Style.Triggers&gt;
                                    &lt;/Style&gt;
                                &lt;/ed:RegularPolygon.Style&gt;
                                &lt;/ed:RegularPolygon&gt;
                            &lt;TextBlock Text=&quot;{Binding Code, Mode=OneWay}&quot; HorizontalAlignment=&quot;Center&quot; VerticalAlignment=&quot;Center&quot; /&gt;
                        &lt;/Grid&gt;
                    &lt;/DataTemplate&gt;
                &lt;/ec:PathListBox.ItemTemplate&gt;
            &lt;/ec:PathListBox&gt;
        &lt;/Grid&gt;
        &lt;Button x:Name=&quot;resetButton&quot; Content=&quot;Reset&quot; HorizontalAlignment=&quot;Right&quot; Margin=&quot;0,0,8,0&quot; d:LayoutOverrides=&quot;Height&quot; VerticalAlignment=&quot;Center&quot; Width=&quot;50&quot; Style=&quot;{DynamicResource MenuButtonStyle}&quot;&gt;
            &lt;i:Interaction.Triggers&gt;
                &lt;i:EventTrigger EventName=&quot;Click&quot;&gt;
                    &lt;ei:ChangePropertyAction TargetObject=&quot;{Binding ElementName=starList}&quot; PropertyName=&quot;SelectedIndex&quot; Value=&quot;-1&quot;/&gt;
                    &lt;ei:ChangePropertyAction TargetObject=&quot;{Binding ElementName=activeArea}&quot; PropertyName=&quot;Background&quot;&gt;
                        &lt;ei:ChangePropertyAction.Value&gt;
                            &lt;SolidColorBrush Color=&quot;{StaticResource PlainGray}&quot;/&gt;
                        &lt;/ei:ChangePropertyAction.Value&gt;
                    &lt;/ei:ChangePropertyAction&gt;
                    &lt;ei:ChangePropertyAction TargetObject=&quot;{Binding ElementName=buzList}&quot; PropertyName=&quot;SelectedIndex&quot;/&gt;
                &lt;/i:EventTrigger&gt;
            &lt;/i:Interaction.Triggers&gt;
        &lt;/Button&gt;
        &lt;Grid x:Name=&quot;LeftSide&quot; Background=&quot;#B5501515&quot; DataContext=&quot;{Binding Words}&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;8,90,0,90&quot; Width=&quot;180&quot; d:LayoutOverrides=&quot;Height&quot; &gt;
            &lt;Grid.RowDefinitions&gt;
                &lt;RowDefinition Height=&quot;*&quot;/&gt;
                &lt;RowDefinition Height=&quot;Auto&quot;/&gt;
            &lt;/Grid.RowDefinitions&gt;
            &lt;Path x:Name=&quot;Arc&quot; HorizontalAlignment=&quot;Left&quot; Stretch=&quot;Fill&quot; UseLayoutRounding=&quot;False&quot; Width=&quot;100&quot; Margin=&quot;10,0,0,0&quot; Data=&quot;M2.2620239,0.34557813 C51.942673,8.6333851 90,55.486155 90,112.04357 90,168.60098 51.942673,215.45375 2.2620239,223.74155&quot;/&gt;
            &lt;ec:PathListBox x:Name=&quot;buzList&quot; HorizontalAlignment=&quot;Left&quot; Height=&quot;0&quot; Margin=&quot;0,0,0,7&quot; VerticalAlignment=&quot;Bottom&quot; Width=&quot;0&quot; ItemTemplate=&quot;{DynamicResource WordsItemTemplate}&quot; ItemsSource=&quot;{Binding Mode=OneWay}&quot; IsSynchronizedWithCurrentItem=&quot;True&quot; d:LayoutOverrides=&quot;VerticalAlignment&quot;&gt;
                &lt;ec:PathListBox.LayoutPaths&gt;
                    &lt;ec:LayoutPath SourceElement=&quot;{Binding ElementName=Arc}&quot; Capacity=&quot;8&quot; Padding=&quot;0&quot; Span=&quot;0.6&quot; Start=&quot;0.2&quot;/&gt;
                &lt;/ec:PathListBox.LayoutPaths&gt;
            &lt;/ec:PathListBox&gt;
            &lt;StackPanel Orientation=&quot;Horizontal&quot; Margin=&quot;0&quot; Grid.Row=&quot;1&quot; d:LayoutOverrides=&quot;Height&quot;&gt;
                &lt;Image Margin=&quot;5,5,0,5&quot; Source=&quot;{Binding Icon, Mode=OneWay}&quot; VerticalAlignment=&quot;Center&quot; HorizontalAlignment=&quot;Left&quot; Height=&quot;75&quot;/&gt;
                &lt;TextBlock TextWrapping=&quot;Wrap&quot; Text=&quot;{Binding EmployeeCount, Mode=OneWay}&quot; VerticalAlignment=&quot;Center&quot; FontSize=&quot;24&quot; FontWeight=&quot;Bold&quot; Foreground=&quot;#FF250303&quot; Margin=&quot;8,0,0,0&quot;/&gt;
            &lt;/StackPanel&gt;
        &lt;/Grid&gt;
        &lt;Path Data=&quot;M-302,219&quot; HorizontalAlignment=&quot;Left&quot; Height=&quot;0&quot; Margin=&quot;-302,219,0,0&quot; Stretch=&quot;Fill&quot; UseLayoutRounding=&quot;False&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;0&quot;/&gt;
    &lt;/Grid&gt;
&lt;/Window&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.dotnetkicks.com/seesharprun/2010/03/22/my-quest-for-a-codeless-user-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPF AutoCompleteBox</title>
		<link>http://blogs.dotnetkicks.com/seesharprun/2010/03/09/wpf-autocompletebox/</link>
		<comments>http://blogs.dotnetkicks.com/seesharprun/2010/03/09/wpf-autocompletebox/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 09:00:02 +0000</pubDate>
		<dc:creator>Sidney Andrews</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://blogs.dotnetkicks.com/seesharprun/?p=18</guid>
		<description><![CDATA[Thanks Microsoft… for two things 1. Making a new AutoCompleteBox for WPF included in the February 2010 relase of WPF Toolkit: http://www.codeplex.com/wpf 2. Not letting any devs know that this was in the pipeline, since half of the internet’s WPF developers went on ahead and recreated their own imperfect (read: basterdized) versions of the AutoComplete &#8230; </p><p><a class="more-link block-button" href="http://blogs.dotnetkicks.com/seesharprun/2010/03/09/wpf-autocompletebox/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Thanks Microsoft… for two things</p>
<p>1. Making a new AutoCompleteBox for WPF included in the February 2010 relase of WPF Toolkit: <a href="http://www.codeplex.com/wpf">http://www.codeplex.com/wpf</a></p>
<p>2. Not letting any devs know that this was in the pipeline, since half of the internet’s WPF developers went on ahead and recreated their own imperfect (read: basterdized) versions of the AutoComplete Control</p>
<p>All joking aside.  This is exciting and i’m very happy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.dotnetkicks.com/seesharprun/2010/03/09/wpf-autocompletebox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Libraries</title>
		<link>http://blogs.dotnetkicks.com/seesharprun/2010/03/05/libraries/</link>
		<comments>http://blogs.dotnetkicks.com/seesharprun/2010/03/05/libraries/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 10:48:11 +0000</pubDate>
		<dc:creator>Sidney Andrews</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[BestPractices]]></category>

		<guid isPermaLink="false">http://blogs.dotnetkicks.com/seesharprun/?p=20</guid>
		<description><![CDATA[No need to go in detail over this issue.  When you write code, always separate your development into tiers.  Even if it’s a simple “Hello World” project, it’s not overkill to have a data layer with your strings, a business logic layer that will manipulate or handle the string and a UI layer that does &#8230; </p><p><a class="more-link block-button" href="http://blogs.dotnetkicks.com/seesharprun/2010/03/05/libraries/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>No need to go in detail over this issue.  When you write code, always separate your development into tiers.  Even if it’s a simple “Hello World” project, it’s not overkill to have a data layer with your strings, a business logic layer that will manipulate or handle the string and a UI layer that does your console/window/website display logic.<br />
<span id="more-20"></span></p>
<p>It pains me to see how many times in the industry, this is not adhered to.  Today, I was reminded why I do this.  I created a separate layer (Project under Visual Studio) of my application that connects to a web-service and returns a ReadOnlyCollection&lt;SomeCustomObject&gt;.  It handles my data manipulation and craziness.  When my boss said “Hey, let’s try doing your application with an Access front-end as opposed to Word” I was able to swap the front-end with minimum effort.</p>
<p>End of the day, I had three front-end technologies… I used a console window for my own personal testing, a Word VSTO document for the original application front-end and a Access file with multiple reports for the final front-end.  By encapsulating all of my business logic in another layer, switching front-ends is as easy as selecting which project to build.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.dotnetkicks.com/seesharprun/2010/03/05/libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Failing Programmers</title>
		<link>http://blogs.dotnetkicks.com/seesharprun/2010/02/26/failing-programmers/</link>
		<comments>http://blogs.dotnetkicks.com/seesharprun/2010/02/26/failing-programmers/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 09:42:45 +0000</pubDate>
		<dc:creator>Sidney Andrews</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[BestPractices]]></category>

		<guid isPermaLink="false">http://blogs.dotnetkicks.com/seesharprun/?p=22</guid>
		<description><![CDATA[I promise this will be short.  After having a heated discussion in StackOverflow I feel like I have to say something about this.  You can find the dicussion here: Good (non-code) interview questions for college intern candidates http://stackoverflow.com/questions/2342750/good-non-code-interview-questions-for-college-intern-candidates/ In lieu of copying the text of the entire question I will summarize.  An individual is going &#8230; </p><p><a class="more-link block-button" href="http://blogs.dotnetkicks.com/seesharprun/2010/02/26/failing-programmers/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I promise this will be short.  After having a heated discussion in StackOverflow I feel like I have to say something about this.  You can find the dicussion here:</p>
<h4><strong>Good (non-code) interview questions for college intern candidates</strong></h4>
<p align="center"><a href="http://stackoverflow.com/questions/2342750/good-non-code-interview-questions-for-college-intern-candidates/">http://stackoverflow.com/questions/2342750/good-non-code-interview-questions-for-college-intern-candidates/</a></p>
<p align="left">In lieu of copying the text of the entire question I will summarize.  An individual is going to hire sophomore and junior level programming students as interns.  Since they aren’t professionally experienced and their programming level is pretty low, he wanted ideas for good interview questions.</p>
<p><span id="more-22"></span></p>
<p align="left">
<p align="left">I am under the belief that most Computer Science students would have worked on a fairly big project in their first &amp; second semesters and would have had numerous team projects under their belt before the end of their fourth semester (sophomore year).  So after looking at the date and the question, I inferred that he would be looking at hiring students who had a minimum of 4 semesters of college programming courses.  Boy did I get flamed for believing that!  Some posters constantly reiterated their belief that students in their second and third year would not have significant programming experience.</p>
<p align="left">The interview question that I suggested fell along the lines of “<em>What project failures have you experienced and what have you learned from them?”</em>  I thought this was a great question because I want a student who can independently learn from their errors and who’s had the experience of a project not being fully realized.  It’s my belief that we can teach programming (read: Computer Science) students about the complexities of actual projects through their realization that every programming project won’t be an instant success like <strong>Hello World</strong>.</p>
<p align="left">After making this remark, I heard the most air-headed comment ever made on the internet!  One poster said “None of my school projects failed”.  Remind me never to hire this guy because I want a humble programmer.  Debugging and testing is one of the most humbling processes I&#8217;ve ever experienced in my life and I know that I want a programmer who doesn’t believe his code is made of gold.  Most programming projects fail in the real world!  If a school is not teaching their Computer Science students this, then I don’t want to hire these kids with “bulletproof” code.  I rather have a kid who loves to read API documentation and can learn from the mistakes he or she will make while growing as a developer.</p>
<p align="left">&lt;/Rant&gt;</p>
<p align="left">For your edification I have posted the dialog that i’m speaking about.  Click on the image for a larger version.  Please comment if you believe I am wrong!  I love academic debate and will be happy to admit if I&#8217;m mistaken.</p>
<p style="text-align: center" align="left"><a href="http://blogs.dotnetkicks.com/seesharprun/files/2011/08/failingproject.png"><img class="aligncenter size-full wp-image-23" src="http://blogs.dotnetkicks.com/seesharprun/files/2011/08/failingproject.png" alt="Failing Project Discussion on StackOverflow.com" width="436" height="610" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.dotnetkicks.com/seesharprun/2010/02/26/failing-programmers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Technical Presentations</title>
		<link>http://blogs.dotnetkicks.com/seesharprun/2010/02/18/technical-presentations/</link>
		<comments>http://blogs.dotnetkicks.com/seesharprun/2010/02/18/technical-presentations/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 15:03:47 +0000</pubDate>
		<dc:creator>Sidney Andrews</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://blogs.dotnetkicks.com/seesharprun/?p=25</guid>
		<description><![CDATA[About two years ago, I read Scott Hanselman’s incredible post on Tips for a Successful Technical Presentation.  It was a great post and vastly changed the way I presented to any audience.  A few years later, and I find myself frustrated.  I have to sit through some very interesting workshops and presentations where the presenter &#8230; </p><p><a class="more-link block-button" href="http://blogs.dotnetkicks.com/seesharprun/2010/02/18/technical-presentations/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>About two years ago, I read Scott Hanselman’s incredible post on <a href="http://www.hanselman.com/blog/11TopTipsForASuccessfulTechnicalPresentation.aspx" target="_blank">Tips for a Successful Technical Presentation</a>.  It was a great post and vastly changed the way I presented to any audience.  A few years later, and I find myself frustrated.  I have to sit through some very interesting workshops and presentations where the presenter is either socially awkward or doing things to detract from the presentation itself.</p>
<p>As someone who has taught at a community college for two semesters, earned a Virginia Community College System (VCCS) distance education specialist certification, was placed in oratorical competitions by his family since elementary school, and currently working on a post-baccalaureate certificate in Instructional technology; I tend to nitpick with details about how people present technical topics to students.  I shoot through the roof when I see presenters fumble the ball with remote or teleconferenced presentations.<span id="more-25"></span></p>
<h4>I’m going to clear my chest and discuss a few points about technical presentations:</h4>
<ol>
<li><strong>Rehearse, Rehearse, Rehearse!</strong> &#8211; While this point is stressed by many people who write on the topic, I feel it is a bad idea.  With student presentations, I find that the students who rehearse the most or the least agile when a curveball is thrown.  If you practice day &amp; night with your notebook pc and have a set ebb &amp; flow (or god-forbid, PowerPoint slide timings) then you will crash &amp; burn when doing a technical presentation.  Engineers &amp; Developers are a curious bunch and we <strong>WILL</strong> interrupt your flow to ask off-the-wall questions.  I think the best advice is to rehearse any portion of your presentation where you’re going off-slide (demonstrating code, command line, etc.) but to just <strong>RELAX</strong>and get comfortable with your material.  Don’t forget, you are the subject matter expert and your audience can tell whether you feel comfortable talking about your material or if you’re reading from a rehearsed script.  The latter definitely sells short your credibility.&nbsp;</li>
<li><strong>Desktop Zoom</strong>– I am absolutely astonished by the amount of people who do not know how to use the Windows magnifier or Mac equivalent.  When I am in my graduate courses, sometimes I want to yell at my professor to magnify or zoom in on their graphics or Smart Art with tiny illegible fonts.  The worst thing you can do as a presenter is tell your audience “I’m sorry about the graphic, but that’s the best quality I could find”.  Now we are not only upset about the illegible graphic, but we’re upset that you could not either magnify the graphic or create a larger version using Visio.  This is definitely a simple problem with an even simpler fix that no-one seems to discover.&nbsp;</li>
<li><strong>Text Legibility</strong>– This is a biggie.  Many times we do presentations with the intent to record, distribute, or broadcast them live.  Almost every presentation expert warns against using small fonts during a PowerPoint presentation, but many people forget that this transfers to many other things.  If you’re showing a diagram or chart, that’s not an excuse for tiny fonts.  If you switch over to Visual Studio, Eclipse, or any other IDE; there are settings to show larger fonts.  This not only strains the eyes of people locally, but it makes your presentation almost impossible to watch remotely via teleconference.  We live in a world where our knowledge is stored and distributed.  When you plan fonts for a presentation, ask yourself “if this was to be shared on YouTube or on an intranet at low-quality, would someone be able to read my fonts?”  If you have a Google account, go test this theory out and let me know what you discover.&nbsp;</li>
<li><strong>Presenter Movement</strong>– I understand that you were taught in grade school to move around.  I appreciate your instructor’s enthusiasm, but it doesn’t have a place in a professional technical presentation.  Let’s consider a few things.  First, when you move around you tend to focus on what’s being said as opposed to where you are.  This leads to the presenter, blocking information or just plain moving around in an awkward disruptive manner.  Secondly, many technical presentations are now being either recorded or teleconferenced and your movement will do more to detract from the presentation then add to it.  Moving off camera and allowing your dialog to be at various volumes do more to confuse a remote viewer or individual viewing a archive of your presentation.  I’m not saying to stand absolutely still, but many of the greatest presenters and orators can look convincing and strong by keeping a good base.  Move your feet very little, keep your hip in the same place and use the top of your body to present.  Pivot your waist, move your arms, shift your focus; these things help you to appear confident and knowledgeable about your topic.&nbsp;</li>
<li><strong>Available Documents</strong> – This is a small gripe, but I feel it’s important and often overlooked.  Many times I hear presenters say “this document will be available on (Blackboard, web site, blog, e-mail listserv) later if you can’t read it now”.  This is a bad habit to start.  Let’s start with this assumption, most diagrams and charts are too complex or too detailed to let the audience decipher in the middle of a presentation without a long, awkward pause.  Make these documents available to the audience before a presentation.  If you don’t have contact with your audience, make the documents available anyways and let them know that they can go to your website at any time to see a detailed version of your presentation.  One habit I have gotten myself into is to give my audience business cards with the name of the presentation, hyperlink to a .Zip file of the charts &amp; diagrams, SlideShare (a presentation hosting service) hyperlink, and any necessary contact information</li>
</ol>
<p>&nbsp;</p>
<p>I could go on for days with other presentation nitpicks, but I feel this is enough to get off my chest at this moment.  I don’t know if i can survive grad school if I have to sit through many more of these unique presentations.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.dotnetkicks.com/seesharprun/2010/02/18/technical-presentations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lambda What? Lambda Who?</title>
		<link>http://blogs.dotnetkicks.com/seesharprun/2010/01/22/lambda-what-lambda-who/</link>
		<comments>http://blogs.dotnetkicks.com/seesharprun/2010/01/22/lambda-what-lambda-who/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 11:40:19 +0000</pubDate>
		<dc:creator>Sidney Andrews</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Lambda]]></category>

		<guid isPermaLink="false">http://blogs.dotnetkicks.com/seesharprun/?p=41</guid>
		<description><![CDATA[I promise this is a short post.  I have recently fallen in love with LINQ, but more recently I have grown to appreciate Lambda expressions.  I don’t know if this is because I find them simple to read, or because I once took a class as an undergraduate student where we built a modern language &#8230; </p><p><a class="more-link block-button" href="http://blogs.dotnetkicks.com/seesharprun/2010/01/22/lambda-what-lambda-who/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I promise this is a short post.  I have recently fallen in love with LINQ, but more recently I have grown to appreciate Lambda expressions.  I don’t know if this is because I find them simple to read, or because I once took a class as an undergraduate student where we built a modern language compiler using just Lambda expressions.  One of the things I notice often is the lack of Lambda expressions in C# 3.0 code that I read at different employers.<span id="more-41"></span></p>
<p>Maybe it’s because I previously spent most of my career as a state IT professional where .NET 2.0 is considered a fairly young, high-risk technology.  Salivate on that for a moment…</p>
<p>Now that you’re back and covered in drool, I just want to point out 2 scenarios where I think a Lambda expression actually makes code more readable to someone not familiar with modern OO languages.  One of my personal favorites are event handlers.  You’ve always seen them like this:</p>
<pre class="brush: csharp; title: ; notranslate">
_object.actionCompleted += new actionCompletedEventHandler(object_actionCompleted);
_object.actionAsync();

static void object_actionCompleted(object sender, actionCompletedEventArgs e)
{
     (sender as ActionObject).Property = (e.Result as PropertyType);
}
</pre>
<p>This is the standard .NET way of doing even handling.  For us longtime C# developers, this seems very elementary.  Sometimes when I have to introduce a JAVA guy to C# or some other OO language, I end up having to explain the idea behind event handlers and also go into a long winded discussion about <a href="http://msdn.microsoft.com/en-us/library/ms228969.aspx" target="_blank">asynchronous programming</a>.  I find it a lot easier to just drag lambda expressions into the conversation and introduce event handling to them like this:</p>
<pre class="brush: csharp; title: ; notranslate">
_object.actionCompleted += (sender, eventArgs) =&gt;
{
    _object.Property = (eventArgs.Result as PropertyType);
};
_object.actionAsync();
</pre>
<p>I know there are some people out there that disagree with me but amuse me by at least considering this.  When you write this as a lambda expression, you tell the none OO programmer that this method is asynchronous, it will run whenever the object’s <strong>actionCompleted</strong> event is fired.  Obviously in the context of this example, the event will fire when the <strong>actionAsync()</strong> method is finished running.  It’s much simpler to explain that the code in the brackets would run at that point then it is to say that another method would be called.  It makes it also easier to read when you don’t have to implicitly or explicitly cast the <strong>sender</strong> object in the event handler method.</p>
<p>Let’s look at a <a href="http://msdn.microsoft.com/en-us/netframework/aa904594.aspx" target="_blank">LINQ</a> method.  First I’ll give you the collection as context for this situation:</p>
<pre class="brush: csharp; title: ; notranslate">
var animals = new Dictionary&lt;int, string&gt;
{
    {76518, &quot;Frog&quot;}, {9865, &quot;Eagle&quot;},
    {4809, &quot;Gazelle&quot;},  {21849, &quot;Panda&quot;},
    {56547, &quot;Elephant&quot;}, {10365, &quot;Ape&quot;}
};
</pre>
<p>Pretty zoological, huh?  Well, this collection could easily be sorted and organized using LINQ statements.  Here are some examples:</p>
<pre class="brush: csharp; title: ; notranslate">
var LongNames = from a in animals
                    where a.Value.Length &gt; 5
                    orderby a.Key
                    select a;

var KeyCodes = from a in
                    from a in animals
                    select String.Format(&quot;{0}-{1}&quot;, a.Key, a.Value)
               orderby a.Length
               select a;
</pre>
<p>This is a nice query in LINQ format and if your developer has any DBA experience this should be sufficient.  But I find it easier to read when you give it some Lambda spice:</p>
<pre class="brush: csharp; title: ; notranslate">
var LongNames = animals
                    .Where(a =&gt; a.Value.Length &gt; 5)
                    .OrderBy(a =&gt; a.Key);

var KeyCodes = animals
                    .Select(a =&gt; String.Format(&quot;{0}-{1}&quot;, a.Key, a.Value))
                    .OrderBy(a =&gt; a.Length);
</pre>
<p>Yes, I did run <a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.sequenceequal.aspx" target="_blank">Enumerable.SequenceEqual()</a> to make sure they come up with absolutely equal collections.  I am of the opinion that the Lambda expressions make this a lot easier to read.  However, I know there are many out there who disagree.  Please respond in the comments, let’s start a discussion.  I am very curious as to whether people think Lambda expressions make C# easier or harder to read.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.dotnetkicks.com/seesharprun/2010/01/22/lambda-what-lambda-who/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utility Extension Methods [Part 2]</title>
		<link>http://blogs.dotnetkicks.com/seesharprun/2010/01/20/utility-extension-methods-part-2/</link>
		<comments>http://blogs.dotnetkicks.com/seesharprun/2010/01/20/utility-extension-methods-part-2/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 06:57:06 +0000</pubDate>
		<dc:creator>Sidney Andrews</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ExtensionMethods]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://blogs.dotnetkicks.com/seesharprun/?p=44</guid>
		<description><![CDATA[I rather enjoy this theme.  I find extension methods very useful when you have to repeat the same short group of code again &#38; again.  Here a few other extension methods that I find handy. GetSOAPObjects&#60;T&#62;This method is a personal favorite of mine.  My current employer requires that I pull a large amount of data &#8230; </p><p><a class="more-link block-button" href="http://blogs.dotnetkicks.com/seesharprun/2010/01/20/utility-extension-methods-part-2/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I rather enjoy this theme.  I find extension methods very useful when you have to repeat the same short group of code again &amp; again.  Here a few other extension methods that I find handy.<span id="more-44"></span></p>
<ol>
<li><strong>GetSOAPObjects&lt;T&gt;</strong>This method is a personal favorite of mine.  My current employer requires that I pull a large amount of data from web services.  I usually check for web service unique errors before calling this method but in this example, i have wrapped logic into this method.  Most SOAP web services that I have encountered returns a custom object with both an error and results property.  You are usually returned an array of “Result” objects from the web service, but for most lightweight queries you will only ever use the first item.  Usually the results property is an array object that contains data only if the error object is null.  This method allows me to convert the results to an <a href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx" target="_blank">IEnumerable</a>.  I am <span style="text-decoration: underline">definitely</span>not stating that this method covers every case, but it does cover most of my personal use cases.
<div>
<pre class="brush: csharp; title: ; notranslate">
public static IEnumerable GetSOAPObjects&lt;T&gt;(this ReadResult[] results)
{
    return  (results.FirstOrDefault() == null)
        ? new Collection&lt;T&gt;()
        : results.FirstOrDefault().objects.Cast&lt;T&gt;();
}
</pre>
</div>
</li>
<li><strong>NullorArray&lt;T&gt;</strong>This method is simple.  I have a few cases where I have to convert an <a href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx" target="_blank">IEnumerable</a>from a LINQ query to an array.  This is definitely the case for web services.  My issue was that I was required to call ToArray&lt;T&gt;() in the middle of a nested object initializer. I’d rather call an extension method than always try and wrap the logic for the multiple calls.
<div>
<pre class="brush: csharp; title: ; notranslate">
public static T[] NullorArray&lt;T&gt;(this IEnumerable&lt;T&gt; inputCollection)
{
return (inputCollection == null)&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.seesharprun.net/editors/tiny_mce3/themes/advanced/langs/en.js&quot;&gt;&lt;/script&gt;? null
        : inputCollection.ToArray&lt;T&gt;();
}
</pre>
</div>
</li>
<li><strong>ToStandardInt</strong>This method is almost identical to the extension method <strong>ToStandardBool </strong>I mentioned in the <a href="http://www.seesharprun.net/post/2010/01/15/Utility-Extension-Methods.aspx">original article</a>.  This takes a “string” value that represents an integer and returns 0 in all cases where it cannot be parsed.  I was not sure about the behavior or <a href="http://msdn.microsoft.com/en-us/library/system.int32.tryparse.aspx" target="_blank">Int32.TryParse()</a>on a null or empty string value, so I put in an extra layer of validation.
<div>
<pre class="brush: csharp; title: ; notranslate">
public static int ToStandardInt(this string thisInt)
{
    int retVal = 0;
    return String.IsNullOrEmpty(thisInt)
        ? 0
        : Int32.TryParse(thisInt, out retVal)
            ? retVal
            : 0;
}
</pre>
</div>
</li>
<li><strong>ToObjFmtString</strong>This is a very fun method.  I wrote it for a project where I had non-programmers who wanted to be able to read my code.  I tend to use <a href="http://msdn.microsoft.com/en-us/library/system.text.stringbuilder.appendformat.aspx" target="_blank">StringBuilder.AppendFormat()</a> and <a href="http://msdn.microsoft.com/en-us/library/system.string.format.aspx" target="_blank">String.Format()</a> <span style="text-decoration: underline">a lot!</span> I found that writing a method that makes string formatting a little more obvious to my non-programmer code reviewers helped out a bit.  So here’s an example:<br />
<table border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" nowrap="nowrap" width="153"><strong>String.Format(*, obj)</strong></td>
<td valign="top" width="247">
<pre class="brush: csharp; title: ; notranslate">String.Format(“{0} has {1} apples”, bob.name, bob.appleCnt);</pre>
</td>
</tr>
<tr>
<td valign="top" nowrap="nowrap" width="153"><strong>obj.ToObjFmtString(*)</strong></td>
<td valign="top" width="247">
<pre class="brush: csharp; title: ; notranslate">bob.ToObjFmtString(“{name} has {appleCnt} apples”);</pre>
</td>
</tr>
</tbody>
</table>
<p>This method allows me to put in the name of properties as opposed to indexes of an array.  It’s very helpful for simple String formatting.  You do lose all of the integer and padding customizations with the original method but gain a large amount of readability.  To pull this off, I used simple reflection and a regex.</p>
<div>
<pre class="brush: csharp; title: ; notranslate">
public static String ToObjFmtString(this Object obj, string format)
{
    return Regex.Replace
    (
        format,
        @&quot;\{(.*?)\}&quot;,
        delegate(Match m)
        {
            return obj.GetType().GetProperty(m.Groups[1].ToString())
                    .GetValue(obj, null).ToString();
        }
    );
}
</pre>
</div>
</li>
</ol>
<p>What extension methods does everyone else use?  I am highly curious as to how people are using this cool new C# 3.0 feature.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.dotnetkicks.com/seesharprun/2010/01/20/utility-extension-methods-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

