<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-648868078298652292</id><updated>2024-08-30T04:45:28.844-07:00</updated><category term="Ajax modalpopupextender"/><category term="Entity Framework 4.0"/><category term="Extension Methods"/><category term="Forbidden Namespace Dependencies"/><category term="LINQ"/><category term="Passing Parameters to Silverlight"/><category term="Printing"/><category term="Repository Garden"/><category term="Silverlight datagrid"/><category term="Silverlight form flip"/><category term="Silverlight popup control"/><category term="Visual Studio tip"/><category term="animation"/><category term="send email"/><title type='text'>Ethan&#39;s .NET Development Blog</title><subtitle type='html'>C# {}, Entity Framework, Linq, MVVM, XAML..</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-5986390629276977036</id><published>2013-09-14T21:11:00.001-07:00</published><updated>2013-09-14T21:16:54.704-07:00</updated><title type='text'>The Bridge Pattern in Action</title><content type='html'>The Bridge pattern is a structural pattern as defined by GOF (Gang-Of-Four)- to &quot;decouple an abstraction from its implementation so that the two can vary independently&quot; (GOF). To grasp the idea, I am going to spin up some C# code to demonstrate the concept and see the advantages that it brings along.

For this we&#39;re gonna be writing some software for rovers - maybe 200 or 300 rovers ready to go :). Ok, for this demo I am gonna only make 2 rovers (MarsRover, and MoonRover). But, same apply to the rest of the different rovers.

Here is the initial requirement: I need to be able to dispatch all the rovers and on the move method they should send out a message, collect some data and import it to sql database (in our case we&#39;re just using a string to show the data store type for simplicity). 

First, let&#39;s see how we can do this without the bridge pattern. Let&#39;s examine the below code and see what is wrong with it.


&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: html&quot;&gt;&lt;![CDATA[
namespace BridgePattern
{
    using System;

    public class MarsRover 
    {
        public void Move()
        {
            Console.WriteLine(string.Format(&quot;{0} {1}&quot;, &quot;Mars Curiosity is ready to roll...&quot;, &quot;Importing data to SQL.&quot;));
        }
    }

    public class MoonRover
    {
        public void Move()
        {
            Console.WriteLine(string.Format(&quot;{0} {1}&quot;, &quot;Houston we are starting the move on the moon...&quot;, &quot;Importing data to SQL.&quot;));
        }
    }
}

]]&gt;&lt;/script&gt;

&lt;br/&gt;

We can see that we have a common Move method and the main concern is that we are specifying the data store type inside each rover. Let&#39;s assume we did this for 300 rovers and eventually we get a new requirement to try out the Oracle database instead. Now, we can see the maintenance nightmare because we would have to change all 300 rovers to use the Oracle data store. How about yet another requirement saying we just need to do this using the File System - this means doing it all over again and changing all 300 rovers.  This is where the Bridge Pattern can help solve this issue.

Let&#39;s start by creating an abstract class and call it Rover:&lt;br/&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: html&quot;&gt;&lt;![CDATA[
namespace BridgePattern
{
    public abstract class Rover
    {
        protected readonly IDataCollector collector;

        public Rover(IDataCollector collector)
        {
            this.collector = collector;
        }

        abstract public void Move();
    }
}
]]&gt;&lt;/script&gt;

&lt;br/&gt;
Next we&#39;ll create the IDataCollector interface that has a single method called ImportData.&lt;br/&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: html&quot;&gt;&lt;![CDATA[
namespace BridgePattern
{
    public interface IDataCollector
    {
        string ImportData(string message);
    }
}
]]&gt;&lt;/script&gt;
&lt;br/&gt;

For simplicity I am including all classes in the same file to easily view on here. The below code shows the newly remodeled rovers:&lt;br/&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: html&quot;&gt;&lt;![CDATA[
namespace BridgePattern
{
    using System;
    
    public class MarsRover : Rover
    {
        public MarsRover(IDataCollector collector)
            : base(collector) { }

        public override void Move()
        {
            Console.WriteLine(collector.ImportData(&quot;Mars Curiosity is ready to roll...&quot;));
        }
    }

    public class MoonRover : Rover
    {
        public MoonRover(IDataCollector collector)
            : base(collector) { }

        public override void Move()
        {
            Console.WriteLine(collector.ImportData(&quot;Houston we are starting the move on the moon...&quot;));
        }
    }
]]&gt;&lt;/script&gt;
&lt;br/&gt;

I made them all override the Move method as well as abstracting the data store type through the use of IDataCollector interface. For our initial requirement we need a SQL data store, so let&#39;s create a class for that with a concrete implementation for importing data (we are just returning a string that says the type for simplicity). I am gonna also include classes for 2 other data store types (OracleDataCollector and FileSystemDataCollector):&lt;br/&gt;

&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: html&quot;&gt;&lt;![CDATA[
 public class SQLDataCollector:IDataCollector
    {
        public string ImportData(string message)
        {
            return string.Format(&quot;{0} {1}&quot;, message,&quot;Importing data to SQL.&quot;);
        }
    }
 public class OracleDataCollector : IDataCollector
    {
        public string ImportData(string message)
        {
            return string.Format(&quot;{0} {1}&quot;, message, &quot;Importing data to Oracle.&quot;);
        }
    }
    public class FileSystemDataCollector : IDataCollector
    {
        public string ImportData(string message)
        {
            return string.Format(&quot;{0} {1}&quot;, message, &quot;Importing data to the file system.&quot;);
        }
    }
]]&gt;&lt;/script&gt;
&lt;br/&gt;

Finally, let&#39;s take the code for s spin:&lt;br/&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: html&quot;&gt;&lt;![CDATA[
namespace BridgePattern
{
    using System.Collections.Generic;

    class Program
    {
        static void Main(string[] args)
        {
            var rovers = new HashSet&lt;Rover&gt;();
           
            var collector = new SQLDataCollector();
            rovers.Add(new MarsRover(collector));
            rovers.Add(new MoonRover(collector));

            foreach(var rover in rovers)
            {
                rover.Move();
            }
        }
    }
}
]]&gt;&lt;/script&gt;
&lt;br/&gt;

This will give us the following output:
&lt;br/&gt;&lt;br/&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3QXwaCJ55dFHlVp_jC0w1yHRLGGgl9esRtmZo0zRnvfOtTcrGQfLfmyMFil12YGcXDZCCMeGXwWjPOh828larCbbF-Qky9-8vRj-062N7b-P2yDPLbsTUEvKaE-0KbXg3VbPtB_9bmvU/s1600/roveroutput.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3QXwaCJ55dFHlVp_jC0w1yHRLGGgl9esRtmZo0zRnvfOtTcrGQfLfmyMFil12YGcXDZCCMeGXwWjPOh828larCbbF-Qky9-8vRj-062N7b-P2yDPLbsTUEvKaE-0KbXg3VbPtB_9bmvU/s320/roveroutput.png&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;


If the requirements change, we do not have to change the rover code. For example if we just need to import data to the file system we can just replace the SQLDataCollector with the FileSystemDataCollector. Note that in real world scenario this can be done in configuration instead of instantiating a new collector inline.  
&lt;br/&gt;

In summary, let&#39;s take a look at a higher level picture of the Bridge Pattern and see where it all fit.
&lt;br/&gt;&lt;br/&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-C9jZsNxJVJyABq2zDq2KIRMyy7-JF4CY6euQ93wl9I-gOi6_0qIEld4-ITHYZnD_5LgOPdf4Nhgr6xS-8GUVPDTqyvk8pnG0M4qT07rASv5qIYZq-zWJ9As0fLjnTS7612dXnYn-XHc/s1600/bridgepatternhighlevelpicture.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-C9jZsNxJVJyABq2zDq2KIRMyy7-JF4CY6euQ93wl9I-gOi6_0qIEld4-ITHYZnD_5LgOPdf4Nhgr6xS-8GUVPDTqyvk8pnG0M4qT07rASv5qIYZq-zWJ9As0fLjnTS7612dXnYn-XHc/s320/bridgepatternhighlevelpicture.png&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;

The abstrcation that we have created is the Rover and we have also refined that abstraction by creating MarsRover, and MoonRover. Our Implementor interface is IDataCollector and we have supplied multiple concrete implementations for that interface such as the SQLDataCollector,OracleDataCollection and so forth. Below is the UML Diagram for the rover scenario:
&lt;br/&gt;&lt;br/&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRKRvEfSPvTFcD5m3gLk3g3OyRJPnF8yR2iHxCBdpyA8goUu0GAaMN-xDhOYx_s0guaD4m6c7ansQQwH0R3QiRAGyJlNXhsOQ0Gf2wpsRxHpA4SE8PDjxO-Bah3NwebgMULu1du8bGjSw/s1600/classdiagram.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRKRvEfSPvTFcD5m3gLk3g3OyRJPnF8yR2iHxCBdpyA8goUu0GAaMN-xDhOYx_s0guaD4m6c7ansQQwH0R3QiRAGyJlNXhsOQ0Gf2wpsRxHpA4SE8PDjxO-Bah3NwebgMULu1du8bGjSw/s320/classdiagram.png&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;

Cheers.





 














</content><link rel='replies' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/5986390629276977036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ethanphoenix.blogspot.com/2013/09/the-bridge-pattern-in-action.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/5986390629276977036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/5986390629276977036'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2013/09/the-bridge-pattern-in-action.html' title='The Bridge Pattern in Action'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3QXwaCJ55dFHlVp_jC0w1yHRLGGgl9esRtmZo0zRnvfOtTcrGQfLfmyMFil12YGcXDZCCMeGXwWjPOh828larCbbF-Qky9-8vRj-062N7b-P2yDPLbsTUEvKaE-0KbXg3VbPtB_9bmvU/s72-c/roveroutput.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-7106235286008323580</id><published>2013-09-08T20:32:00.002-07:00</published><updated>2013-09-12T23:06:49.047-07:00</updated><title type='text'>WCF Without a Physical SVC File.</title><content type='html'>This is a cool new feature that was introduced in WCF 4.0 and I have been using it since. Basically there is no need for physical svc files and the configuration is pretty simple. Below is the configuration I am using for this simple test case:

&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: html&quot;&gt;&lt;![CDATA[
 &lt;serviceHostingEnvironment multipleSiteBindingsEnabled=&quot;true&quot; aspNetCompatibilityEnabled=&quot;true&quot;&gt;
      &lt;serviceActivations&gt;
        &lt;add service=&quot;WcfTestService.TestService&quot; relativeAddress=&quot;TestService.svc&quot; /&gt;
      &lt;/serviceActivations&gt;
 &lt;/serviceHostingEnvironment&gt;
]]&gt;&lt;/script&gt;


To test this out with a simple wcf service, fire up Visual Studio ( I am using Visual Studio 2013 preview but you can use 2012) and let&#39;s create a new WCF Service Application and name it WCFTestService. For best practices you would want to create a WCF Service Library to create the actual service interfaces and classes but for simplicity we are just gonna create a simple service within the same project. &lt;br /&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_3FmiI5tshr24d_MJKoWREKUg4HwgW0yQ9iHhakx8ZtZpWeKs4LFOqsjNsjob1qHykQiqHw7eP3QwvDZoE7EXxXYaKR6_iLWN2LOoJjGMlE9rVCq7N872aDuHg_eayhc8Yxo2MogqdqQ/s1600/newproject.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_3FmiI5tshr24d_MJKoWREKUg4HwgW0yQ9iHhakx8ZtZpWeKs4LFOqsjNsjob1qHykQiqHw7eP3QwvDZoE7EXxXYaKR6_iLWN2LOoJjGMlE9rVCq7N872aDuHg_eayhc8Yxo2MogqdqQ/s320/newproject.png&quot; /&gt;&lt;/a&gt;


&lt;br /&gt;After we create the project we would want to delete the default Service1.svc and IService1.cs files. Let&#39;s create a new interface file and name it ITestService:

&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: html&quot;&gt;&lt;![CDATA[
 namespace WcfTestService
{
    using System.ServiceModel;

    [ServiceContract]
    public interface ITestService
    {
        [OperationContract]
        string GetCustomer(int id);
    }
}
]]&gt;&lt;/script&gt;

Now, let&#39;s create the test service that is going to implement that interface:

&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: html&quot;&gt;&lt;![CDATA[
namespace WcfTestService
{
    public class TestService : ITestService
    {
        public string GetCustomer(int id)
        {
            return string.Format(&quot;You have requested customer of ID: {0}&quot;, id);
        }
    }
}
]]&gt;&lt;/script&gt;

We are just using a simple method that returns the id back to us. 

We are done with the test service, let&#39;s tweak the default configuration. Open the web config file and paste the following:

&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: html&quot;&gt;&lt;![CDATA[
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;configuration&gt;
  &lt;appSettings&gt;
    &lt;add key=&quot;aspnet:UseTaskFriendlySynchronizationContext&quot; value=&quot;true&quot; /&gt;
  &lt;/appSettings&gt;
  &lt;system.web&gt;
    &lt;compilation debug=&quot;true&quot; targetFramework=&quot;4.5&quot; /&gt;
    &lt;httpRuntime targetFramework=&quot;4.5&quot;/&gt;
  &lt;/system.web&gt;
  &lt;system.serviceModel&gt;
    &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior&gt;
          &lt;!-- To avoid disclosing metadata information, set the values below to false before deployment --&gt;
          &lt;serviceMetadata httpGetEnabled=&quot;true&quot; httpsGetEnabled=&quot;true&quot;/&gt;
          &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;
          &lt;serviceDebug includeExceptionDetailInFaults=&quot;false&quot;/&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
    &lt;protocolMapping&gt;
        &lt;add binding=&quot;basicHttpsBinding&quot; scheme=&quot;https&quot; /&gt;
    &lt;/protocolMapping&gt;    
    &lt;serviceHostingEnvironment multipleSiteBindingsEnabled=&quot;true&quot; aspNetCompatibilityEnabled=&quot;true&quot;&gt;
      &lt;serviceActivations&gt;
        &lt;add service=&quot;WcfTestService.TestService&quot; relativeAddress=&quot;TestService.svc&quot; /&gt;
      &lt;/serviceActivations&gt;
    &lt;/serviceHostingEnvironment&gt;
  &lt;/system.serviceModel&gt;
  &lt;system.webServer&gt;
    &lt;modules runAllManagedModulesForAllRequests=&quot;true&quot;/&gt;
    &lt;!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      --&gt;
    &lt;directoryBrowse enabled=&quot;true&quot;/&gt;
  &lt;/system.webServer&gt;
&lt;/configuration&gt;

]]&gt;&lt;/script&gt;

After we get this hosted in IIS, we are ready to test the service. I am going to be using wcfTestClient which you can get to it thru the command line by typing wcftestclient as depicted below:&lt;br /&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRD0IO3DwSk2Nu4Q9ij8sm_jwIQWoSyag4Jxl248TbqRl2HUMgk2yGKS9PY4fhVrYCFPzvGwbz5WUKbX7VhLlZLj_qwzbwdufFCpKR1OkUkp-T6fbq7YNy8R6t7n3KxVhiLlz1ccX2Pqg/s1600/cmd.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRD0IO3DwSk2Nu4Q9ij8sm_jwIQWoSyag4Jxl248TbqRl2HUMgk2yGKS9PY4fhVrYCFPzvGwbz5WUKbX7VhLlZLj_qwzbwdufFCpKR1OkUkp-T6fbq7YNy8R6t7n3KxVhiLlz1ccX2Pqg/s320/cmd.png&quot; /&gt;&lt;/a&gt;

&lt;br /&gt; 
The address I specified in IIS is http://localhost:9090/SvcLessService/TestService.svc but you can specify your own address/TestService.svc. So, without the svc file I am able to download and query the wcf service method and below is the wcfTestClient result:&lt;br /&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEcNuph1W0fr04y0r1KkDGghVbaTxSrDt1l7gBoIeDU7lHhjcHl01h6y1YZVlS8Uqy-prL75-4UBGUzwNkga5wB2VGJhekiLxWesQ1BoIpQNdzL8bElJSoHJAEDZiqYNJUg50yXoacf9I/s1600/testclient.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEcNuph1W0fr04y0r1KkDGghVbaTxSrDt1l7gBoIeDU7lHhjcHl01h6y1YZVlS8Uqy-prL75-4UBGUzwNkga5wB2VGJhekiLxWesQ1BoIpQNdzL8bElJSoHJAEDZiqYNJUg50yXoacf9I/s320/testclient.png&quot; /&gt;&lt;/a&gt;


</content><link rel='replies' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/7106235286008323580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ethanphoenix.blogspot.com/2013/09/wcf-without-physical-svc-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/7106235286008323580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/7106235286008323580'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2013/09/wcf-without-physical-svc-file.html' title='WCF Without a Physical SVC File.'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_3FmiI5tshr24d_MJKoWREKUg4HwgW0yQ9iHhakx8ZtZpWeKs4LFOqsjNsjob1qHykQiqHw7eP3QwvDZoE7EXxXYaKR6_iLWN2LOoJjGMlE9rVCq7N872aDuHg_eayhc8Yxo2MogqdqQ/s72-c/newproject.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-3946471723034196882</id><published>2013-05-12T17:57:00.002-07:00</published><updated>2013-05-12T19:02:40.043-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LINQ"/><title type='text'>Select Most Frequent Value Then Filter by Lower Value if Top Frequency Is Not Unique Using LINQ</title><content type='html'>In this post I need to be able to parse and query some data that is saved in a flat file. First, let&#39;s create this txt file and name it data.txt. Copy and paste the below gibberish to data.txt and create another txt file for the output (result.txt).&lt;br/&gt;
&lt;strong&gt;20,3,2,2,20,1,4,5,5,1&lt;br/&gt; 
22,800,600,500,22,0,400,900,0,300,700,300,100,200,400,18&lt;br/&gt;
19,200,700,400,700,500,500,900,800,800,400,300,700,22,19&lt;br/&gt;  
500,900,400,0,500,100,900,0,0,600,600,200,700,900,0,99&lt;/strong&gt;&lt;br/&gt;

So, I would like to operate on each line to get the number that occurs the most, also if some numbers are equally occurring then just take the smallest of them. Ex: if I have 1,2,3,3,1 then the result should be 1 because in this case 3 and 1 share the same frequency position but we just want a single value based on a condition (the lower value)

Let&#39;s take a look at the code. I am using a custom extension method on the IEnumerable but you can do the same using  a foreach loop.


&lt;pre class=&quot;brush: csharp&quot;&gt;
 static void Main(string[] args)
 {
    var lines = File.ReadLines(&quot;data.txt&quot;);    
    var result = new List&lt;string&gt;();
    var q = lines.Select(x =&gt; x)
                 .Select(x =&gt; x.Split(&#39;,&#39;)
                 .GroupBy(i =&gt; i)
                 .Select(g =&gt; new { g.Key, Count = g.Count()}))
                 .ForEach( v =&gt;
                 {
                    var frequency = v.Max(h =&gt; h.Count);
                    result.Add(v.Where(n =&gt; n.Count == frequency).OrderBy(i =&gt; i.Key).First().Key);
                 });
            File.WriteAllText(&quot;result.txt&quot;, string.Join(&quot;\r\n&quot;, result));
 }
&lt;/pre&gt;


The final output is:&lt;br/&gt;
1&lt;br/&gt;
0&lt;br/&gt;
700&lt;br/&gt;
0</content><link rel='replies' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/3946471723034196882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ethanphoenix.blogspot.com/2013/05/select-most-frequent-value-then-filter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/3946471723034196882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/3946471723034196882'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2013/05/select-most-frequent-value-then-filter.html' title='Select Most Frequent Value Then Filter by Lower Value if Top Frequency Is Not Unique Using LINQ'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-2928911127010509499</id><published>2011-02-13T17:44:00.000-08:00</published><updated>2013-05-11T00:29:34.579-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Entity Framework 4.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Repository Garden"/><title type='text'>Entity Framework 4.0 Repository Factory Pattern</title><content type='html'>In this post I am going to show you how to write some clean code using a repository pattern and entity framework for data access. I am also using the UnitOfWork pattern and Specification pattern. One thing to note is that EF 4.0 provides us with an Out of the box UnitOfWork called ObjectContext (in my case I am using another level of abstraction on top of that). First, I need to think in terms of blue prints and how to design a well formed skeletton that is decoupled and that makes room for flexibility and testability. For demo puposes, I am just gonna pick out one scenario..So, i need a bridge class that i call a &#39;Pipe&#39; which is going to act as a data bridge between the presentation layer and the repositories, and the repositories would then talk to the entity framework. Let&#39;s start by looking at how the business facade looks like where the &#39;Pipe&#39; lives. &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; PhysicianPipe : IPhysicianPipe&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;        IRepositoryGarden repositoryGarden;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; PhysicianPipe(IRepositoryGarden RepositoryGarden)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;            repositoryGarden = RepositoryGarden;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; AddPhysician(Domain.Entities.Physician physician)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;            repositoryGarden.PhysicianRepository.Add(physician);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;            repositoryGarden.SaveRepositoryChanges();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Basically I handed over the UnitOfWork responsibility to the repository garden where it gets injected in the constructor, that way i can use an &lt;b&gt;IoC&lt;/b&gt; container (StructureMap, Unity, Ninject, etc..) and can configure it to inject a real UnitOfWork or a Fake one for testing purposes. We&#39;ll look at how the repository garden (this acts as a repository factory) class looks like later. I am also archtecting the application in a way that everything is implemented thru interfaces. I dont want the client code to be aware of how things are implemented but rather just how to use them. A real world example is a car for example, the manufacturer makes the car and to be able to drive it, we just need to know how to interact with its interfaces (streering wheel, brakes,etc..) we dont need to know how they work internally. So, all my client code need to be concerned about is how to use the interfaces i hand over to it. Now, looking at the PhysicianPipe class we can see that we can easily add some method that involve work across multiple repositories, then when we are done we can save the changes - we can have something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; DoWork(Domain.Entities.Physician physician)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;    repositoryGarden.PhysicianRepository.Add(physician);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;    repositoryGarden.ClinicRepository.DoSomework();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;    repositoryGarden.SaveRepositoryChanges();&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Let&#39;s take a look at how I signed the repository garden class:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; RepositoryGarden : IRepositoryGarden,IDisposable&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;    IUnitOfWork _CurrentUoW;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; RepositoryGarden(IUnitOfWork unitOfWork)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (unitOfWork == (IUnitOfWork)&lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;            &lt;span class=&quot;kwrd&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ArgumentNullException(&lt;span class=&quot;str&quot;&gt;&quot;unitOfWork&quot;&lt;/span&gt;, &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;                      &lt;span class=&quot;str&quot;&gt;&quot;Can Not Be Null&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;                _CurrentUoW = unitOfWork;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;    IPhysicianRepository physicianRepository = &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;                                      &lt;span class=&quot;kwrd&quot;&gt;default&lt;/span&gt;(IPhysicianRepository);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;    IClinicRepository clinicRepository = &lt;span class=&quot;kwrd&quot;&gt;default&lt;/span&gt;(IClinicRepository);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  15:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; IPhysicianRepository PhysicianRepository&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  16:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  17:  &lt;/span&gt;        get&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  18:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  19:  &lt;/span&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (physicianRepository == &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  20:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  21:  &lt;/span&gt;                physicianRepository = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; PhysicianRepository(_CurrentUoW);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  22:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  23:  &lt;/span&gt;            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; physicianRepository;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  24:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  25:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  26:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  27:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; IClinicRepository ClinicRepository&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  28:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  29:  &lt;/span&gt;        get&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  30:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  31:  &lt;/span&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (clinicRepository == &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  32:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  33:  &lt;/span&gt;                clinicRepository = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ClinicRepository(_CurrentUoW);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  34:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  35:  &lt;/span&gt;            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; clinicRepository;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  36:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  37:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  38:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  39:  &lt;/span&gt;    &lt;span class=&quot;rem&quot;&gt;//... More repositories&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  40:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  41:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SaveRepositoryChanges()&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  42:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  43:  &lt;/span&gt;        _CurrentUoW.Commit();&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  44:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  45:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  46:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Dispose()&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  47:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  48:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (_CurrentUoW != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  49:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  50:  &lt;/span&gt;            _CurrentUoW.Dispose();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  51:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  52:  &lt;/span&gt;        GC.SuppressFinalize(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  53:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  54:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
And the signiture of IRepositoryGarden :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;interface&lt;/span&gt; IRepositoryGarden&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;      IPhysicianRepository PhysicianRepository { get; }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;      IClinicRepository ClinicRepository { get; }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;      &lt;span class=&quot;rem&quot;&gt;// More Repository interfaces.....&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;      &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SaveRepositoryChanges();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
In this post I did not go over the details of each repository or the UnitOfWork, my goal was to show how easy we can create a central Repository Factory class that takes care of picking out desired repositories as needed then saving the changes once we&#39;re done. In my next post i will show how to use the &lt;b&gt;Specification Pattern&lt;/b&gt; as well as using DataAnnotations to validate data in subsequent posts.</content><link rel='replies' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/2928911127010509499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ethanphoenix.blogspot.com/2011/02/entity-framework-40-repository-factory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/2928911127010509499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/2928911127010509499'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2011/02/entity-framework-40-repository-factory.html' title='Entity Framework 4.0 Repository Factory Pattern'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-2378840007528417512</id><published>2011-01-14T21:48:00.000-08:00</published><updated>2011-01-15T15:46:35.139-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Forbidden Namespace Dependencies"/><title type='text'>Forbidden Namespace Dependencies Wildcard</title><content type='html'>The architecture modeling project that shipped with Visual Studio 2010 has some nice features, one of which is the Layer Diagram where you can drop assemblies, namespaces, classes, and methods. There is one feature that is not supported yet and it&#39;s the ability to specify a wildcard in the Forbidden Namespace Dependencies as well as the Forbidden Namespace properties of a particular layer inside the layer diagram. The idea behind this is that i need to be able to write something like: MyRootNamespace.* and the tool I wrote would list out all namespaces under the root namespace, further i could write something like MyRootNamespace.Level1.* and get same results. So, I wrote some code to do that task for any layer diagram in a modeling project. Below is a screenshot of the properties window. Just click on a layer and hit F4 to get to it.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi442CNlUp3CYaKQ0TlKo_p6LA_2rwg-1Lr5dhpfjJgSDBUbShcCSLbr4aL05uDxuAgPFoo90KMWfGmXrciGn0XwwUSXQptsInQX0yRh4v6ONlvlLHv0mTgpHa_ydLmcKn0U1p2FHbNRmg/s1600/layerdiagramproperties.jpg&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; width=&quot;237&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi442CNlUp3CYaKQ0TlKo_p6LA_2rwg-1Lr5dhpfjJgSDBUbShcCSLbr4aL05uDxuAgPFoo90KMWfGmXrciGn0XwwUSXQptsInQX0yRh4v6ONlvlLHv0mTgpHa_ydLmcKn0U1p2FHbNRmg/s320/layerdiagramproperties.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
It&#39;s straight forward and uses LINQ to XML. So, let&#39;s see how it&#39;s done. &lt;br /&gt;
First, I created a method that get me some namespaces to work with.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; GetWorkingNameSpaces(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; AssembliesDir)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;    Namespaces = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; HashSet&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt;();&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;    DirectoryInfo di = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; DirectoryInfo(AssembliesDir);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;    var workingAssemblies = di.Exists ? &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;                              di.EnumerateFiles()&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;                                .Where(s=&amp;gt;s.Extension.ToLower() ==&lt;span class=&quot;str&quot;&gt;&quot;.dll&quot;&lt;/span&gt; ||&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;                               s.Extension.ToLower() == &lt;span class=&quot;str&quot;&gt;&quot;.exe&quot;&lt;/span&gt; ) : &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;    Parallel.ForEach(workingAssemblies, a =&amp;gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;        Assembly reference = Assembly.ReflectionOnlyLoadFrom(a.FullName);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;            HashSet&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt; refernceNamespaces = &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  15:  &lt;/span&gt;                &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; HashSet&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt;(reference.GetTypes()&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  16:  &lt;/span&gt;                                             .Select(f =&amp;gt; f.Namespace)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  17:  &lt;/span&gt;                                             .Where(n =&amp;gt; n != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;));&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  18:  &lt;/span&gt;            Namespaces.UnionWith(refernceNamespaces);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  19:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  20:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;catch&lt;/span&gt; (ReflectionTypeLoadException) { }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  21:  &lt;/span&gt;    });&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  22:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
So, not a whole lot going on, just newing up an instance of a HashSet and doing reflection over a list of assemblies and extracting some namespaces, and storing them in a HashSet collection so that i can work with them later.&lt;br /&gt;
&lt;br /&gt;
Next, I created a method that will process the wildcard token. It takes in a namespace root or sub-n-root and returns nested namespaces.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; HashSet&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt; ProcessWildCard(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; Token)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;    HashSet&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt; namespaces = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; HashSet&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt;();&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; index = &lt;span class=&quot;kwrd&quot;&gt;default&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; Name = &lt;span class=&quot;kwrd&quot;&gt;default&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (Token.Contains(&lt;span class=&quot;str&quot;&gt;&quot;.&quot;&lt;/span&gt;))&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;        index = Token.LastIndexOf(&lt;span class=&quot;str&quot;&gt;&#39;.&#39;&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; namespaces;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;    Name = Token.Substring(0, index).Trim();&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (var t &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; from c &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; Namespaces &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;                        &lt;span class=&quot;kwrd&quot;&gt;where&lt;/span&gt; c.StartsWith(Name) &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;                        select c)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;        namespaces.Add(t);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  15:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  16:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; namespaces;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  17:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Now that i got this far, i need to build an update method that takes in an attribute Name and an XElement - since I am going to be updating both the Forbidden Namespace Dependencies and Forbidden Namespaces.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; UpdateForiddenAttribute(&lt;span class=&quot;kwrd&quot;&gt;ref&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;                                              forbiddenAttributeName,&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;                                              XElement t)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;    List&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt; proccessed = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; List&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt;();&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; _forbiddenAttributeValue = &lt;span class=&quot;kwrd&quot;&gt;default&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (t.Attribute(forbiddenAttributeName) != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;        _forbiddenAttributeValue = &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;                t.Attribute(forbiddenAttributeName).Value;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;[] elements = &lt;span class=&quot;kwrd&quot;&gt;default&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;[]);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (_forbiddenAttributeValue.Contains(&lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;))&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;            elements = _forbiddenAttributeValue.Split(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt;[] { &lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt; },&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  15:  &lt;/span&gt;                             StringSplitOptions.RemoveEmptyEntries);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  16:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  17:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  18:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  19:  &lt;/span&gt;            elements = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt;[] { _forbiddenAttributeValue };&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  20:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  21:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (var s &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; elements)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  22:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  23:  &lt;/span&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (s.Contains(&lt;span class=&quot;str&quot;&gt;&quot;*&quot;&lt;/span&gt;) &amp;amp;&amp;amp; !(s.Contains(&lt;span class=&quot;str&quot;&gt;&quot;,&quot;&lt;/span&gt;) || s.Contains(&lt;span class=&quot;str&quot;&gt;&quot;|&quot;&lt;/span&gt;)))&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  24:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  25:  &lt;/span&gt;                var hash = ProcessWildCard(s);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  26:  &lt;/span&gt;                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (hash.Count &amp;gt; 0)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  27:  &lt;/span&gt;                    &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (var h &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; hash)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  28:  &lt;/span&gt;                    {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  29:  &lt;/span&gt;                        proccessed.Add(h);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  30:  &lt;/span&gt;                    }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  31:  &lt;/span&gt;                &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  32:  &lt;/span&gt;                {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  33:  &lt;/span&gt;                    proccessed.Add(s);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  34:  &lt;/span&gt;                }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  35:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  36:  &lt;/span&gt;            &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  37:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  38:  &lt;/span&gt;                proccessed.Add(s);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  39:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  40:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  41:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  42:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; formattedAttributeValue = &lt;span class=&quot;kwrd&quot;&gt;default&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  43:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (proccessed.Count &amp;gt; 1)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  44:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  45:  &lt;/span&gt;        formattedAttributeValue = String.Join(&lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;, proccessed);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  46:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  47:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  48:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  49:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (proccessed.Count == 1)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  50:  &lt;/span&gt;            formattedAttributeValue = proccessed[0];&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  51:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  52:  &lt;/span&gt;            formattedAttributeValue = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  53:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  54:  &lt;/span&gt;    t.SetAttributeValue(forbiddenAttributeName, formattedAttributeValue);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  55:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
So far so good, all i did is get some attribute value, do some processing on it and update the .layerdiagram file with the newly constructed list of namespaces. So, the next step is the actual method that runs and collects data about the layerdiaram file/s in the modeling project, calls the update method and finally saves each layerdiagram file to complete the process.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; RunTool(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; layerdiagramDirectoryPath, &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;                    &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; AssembliesDirectory)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; forbiddenNamespaceDependenciesName = &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;                            &lt;span class=&quot;str&quot;&gt;&quot;forbiddenNamespaceDependencies&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; forbiddenNamespaceName = &lt;span class=&quot;str&quot;&gt;&quot;forbiddenNamespace&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;    GetWorkingNameSpaces(AssembliesDirectory);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;    var q= Directory.EnumerateFiles(layerdiagramDirectoryPath, &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;                                    &lt;span class=&quot;str&quot;&gt;&quot;*.layerdiagram&quot;&lt;/span&gt;, &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;                                    SearchOption.AllDirectories)  &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;        .Select(x =&amp;gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;                s =  XDocument.Load(x),&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;                p = x &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  15:  &lt;/span&gt;            })&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  16:  &lt;/span&gt;        .Where(d =&amp;gt; d.s.Root&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  17:  &lt;/span&gt;                    .Elements()&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  18:  &lt;/span&gt;                    .Descendants()&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  19:  &lt;/span&gt;                    .Any(v =&amp;gt; v.Attributes(&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  20:  &lt;/span&gt;                     forbiddenNamespaceDependenciesName)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  21:  &lt;/span&gt;                    .Any())&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  22:  &lt;/span&gt;                ||d.s.Root&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  23:  &lt;/span&gt;                    .Elements()&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  24:  &lt;/span&gt;                    .Descendants()&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  25:  &lt;/span&gt;                    .Any(v =&amp;gt; v.Attributes(forbiddenNamespaceName)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  26:  &lt;/span&gt;                    .Any())&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  27:  &lt;/span&gt;                );&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  28:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (var x &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; q)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  29:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  30:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; DocumentHasChanges = &lt;span class=&quot;kwrd&quot;&gt;default&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt;);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  31:  &lt;/span&gt;        IEnumerable&amp;lt;XElement&amp;gt; xElements = &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  32:  &lt;/span&gt;                ( from c &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; x.s.Root&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  33:  &lt;/span&gt;                            .Elements()&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  34:  &lt;/span&gt;                            .Descendants()&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  35:  &lt;/span&gt;                &lt;span class=&quot;kwrd&quot;&gt;where&lt;/span&gt; c.Attributes(forbiddenNamespaceDependenciesName)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  36:  &lt;/span&gt;                       .Any() ||&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  37:  &lt;/span&gt;                        c.Attributes(forbiddenNamespaceName).Any()&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  38:  &lt;/span&gt;                select c&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  39:  &lt;/span&gt;                );&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  40:  &lt;/span&gt;        Parallel.ForEach(xElements, t =&amp;gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  41:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  42:  &lt;/span&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (t.Attribute(forbiddenNamespaceDependenciesName) != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  43:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  44:  &lt;/span&gt;                UpdateForiddenAttribute(&lt;span class=&quot;kwrd&quot;&gt;ref&lt;/span&gt; &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  45:  &lt;/span&gt;                                 forbiddenNamespaceDependenciesName, t);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  46:  &lt;/span&gt;                DocumentHasChanges = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  47:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  48:  &lt;/span&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (t.Attribute(forbiddenNamespaceName) != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  49:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  50:  &lt;/span&gt;                UpdateForiddenAttribute(&lt;span class=&quot;kwrd&quot;&gt;ref&lt;/span&gt; forbiddenNamespaceName, t);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  51:  &lt;/span&gt;                DocumentHasChanges = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  52:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  53:  &lt;/span&gt;        });&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  54:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (DocumentHasChanges)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  55:  &lt;/span&gt;        x.s.Save(x.p);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  56:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  57:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
And that&#39;s all the code needed to now have an out of box wildcard functionality. To get this working just hook it up to the main entry point of your program and pass in 2 arguments (modeling project directory and assemblies directory) and wrap it up with a try catch block. Would look something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Program Entry&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Main(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;[] args)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;            RunTool(args[0], args[1]);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;catch&lt;/span&gt; (Exception g)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;            Console.WriteLine(&lt;span class=&quot;str&quot;&gt;&quot;Error :{0} &quot;&lt;/span&gt;, g.Message);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;&lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
So, to use this tool, right click on the modeling project and choose Edit project - add an MSBUILD Exec task and give it the location of batch file under your solution items or where ever you like to keep .bat files related to your solution and that&#39;s all. Next time you build the solution and if there are any broken forbidden namespace dependencies, they will show up as build errors.</content><link rel='replies' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/2378840007528417512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ethanphoenix.blogspot.com/2011/01/forbidden-namespace-dependencies.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/2378840007528417512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/2378840007528417512'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2011/01/forbidden-namespace-dependencies.html' title='Forbidden Namespace Dependencies Wildcard'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi442CNlUp3CYaKQ0TlKo_p6LA_2rwg-1Lr5dhpfjJgSDBUbShcCSLbr4aL05uDxuAgPFoo90KMWfGmXrciGn0XwwUSXQptsInQX0yRh4v6ONlvlLHv0mTgpHa_ydLmcKn0U1p2FHbNRmg/s72-c/layerdiagramproperties.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-8092672151857480976</id><published>2010-08-08T13:34:00.000-07:00</published><updated>2010-08-08T13:41:45.738-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Passing Parameters to Silverlight"/><title type='text'>Pass Parameters from ASP.NET to Silverlight</title><content type='html'>It is very straight forward to pass parameters from an asp.net page to a silverlight application. In my case, I had an asp.net application and wanted to integrate silverlight in one of my pages. I needed to pass some values such as ID and user role. Let&#39;s look at some code. First, I created a class, in my Silverlight application, to encapsulate my values. The constructor of my class takes in an IDictionary&lt;string, string&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Dashboard&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; _ParishId;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; _IsReadOnly;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; _IsGSTSOrSuperParish;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;internal&lt;/span&gt; Dashboard(IDictionary&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;&amp;gt; parameters)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;&lt;pre&gt;_ParishId = parameters[&lt;span class=&quot;str&quot;&gt;&quot;pid&quot;&lt;/span&gt;];&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;_IsReadOnly = Convert.ToBoolean(parameters[&lt;span class=&quot;str&quot;&gt;&quot;iro&quot;&lt;/span&gt;]);&lt;/pre&gt;&lt;pre&gt;_IsGSTSOrSuperParish = Convert.ToBoolean(parameters[&lt;span class=&quot;str&quot;&gt;&quot;igs&quot;&lt;/span&gt;]);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; ParishId&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;&lt;pre&gt;get { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; _ParishId; }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; IsReadOnly&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;&lt;pre&gt;get { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; _IsReadOnly; }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; IsGSTSOrSuperParish&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;&lt;pre&gt;get { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; _IsGSTSOrSuperParish; }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
Now, in the App.xaml application start up event i new up an instance of the class i created passing in the initParams of the StartupEventArgs. &lt;br /&gt;
Below is the markup needed for this.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Application_Startup(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, StartupEventArgs e)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;Dashboard db = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Dashboard(e.InitParams);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.RootVisual = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MainPage(db.ParishId,db.IsReadOnly,db.IsGSTSOrSuperParish);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
Now that i have things set up for the mainPage.xaml, all i have to do is get those values on mainPage. And that&#39;s it on the silverlight side. I still have to set up how to get the actual values from ASP.NET. Below is the code for the mainPage.xaml.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; MainPage : UserControl&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; _id;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; _IsReadOnly;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; _IsGSTSOrSuperParish;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; MainPage(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; id, &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; isReadOnly, &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; isGSTSOrSuperParish)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;&lt;pre&gt;InitializeComponent();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;_id = id;&lt;/pre&gt;&lt;pre&gt;_IsReadOnly = isReadOnly;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;_IsGSTSOrSuperParish = isGSTSOrSuperParish;&lt;/pre&gt;&lt;pre&gt;Loaded += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; RoutedEventHandler(Page_Loaded);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;...&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
Finally, I added a parameter (to the asp.net user control where my silverlight reference is) and called it initParam and gave it an ID of &#39;prm&#39; so I can use it in code behind of this user control. First, let&#39;s take a look at the HTML.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;silverlightControlHost&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;tempSil&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;data:application/x-silverlight-2,&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;application/x-silverlight-2&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100%&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100%&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;param&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;source&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;../ClientBin/DB.Silverlight.xap&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;param&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;onError&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;onSilverlightError&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;param&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;background&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;white&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;param&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;minRuntimeVersion&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;4.0.50401.0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;param&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;autoUpgrade&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;true&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;param&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;initParams&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;prm&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;param&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;windowless&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;true&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://go.microsoft.com/fwlink/?LinkID=149156&amp;amp;v=4.0.50401.0&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;text-decoration:none&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;img&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://go.microsoft.com/fwlink/?LinkId=161376&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Get Microsoft Silverlight&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;border-style:none&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;iframe&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;_sl_historyFrame&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;visibility:hidden;height:0px;width:0px;border:0px&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;iframe&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
And here is the code behind and is pretty straight forward..just passing in values. &lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; UserControls_VE_db : System.Web.UI.UserControl&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (var proxy = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; CapitalAreaService.ServiceClient())&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.prm.Attributes[&lt;span class=&quot;str&quot;&gt;&quot;value&quot;&lt;/span&gt;] = &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;pid={0},iro={1},igs={2}&quot;&lt;/span&gt;, &lt;/pre&gt;&lt;pre&gt;proxy.GetParishId(SystemRole.GetParisAbbreviation()),SystemRole.IsReadOnly(),&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;SystemRole.IsGSTSOrSuperParish());&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
That&#39;s all it take to pass values from ASP.NET to Silverlight as needed.</content><link rel='replies' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/8092672151857480976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ethanphoenix.blogspot.com/2010/08/pass-parameters-from-aspnet-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/8092672151857480976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/8092672151857480976'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2010/08/pass-parameters-from-aspnet-to.html' title='Pass Parameters from ASP.NET to Silverlight'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-14335093938966593</id><published>2010-08-07T12:36:00.000-07:00</published><updated>2010-08-07T12:43:16.677-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="animation"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight form flip"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight popup control"/><title type='text'>Silverlight Form Flip Animation</title><content type='html'>&lt;a href=&quot;http://draft.blogger.com/&quot;&gt;&lt;/a&gt;&lt;span id=&quot;goog_1268545659&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1268545660&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1268545642&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1268545643&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1268545644&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1268545645&quot;&gt;&lt;/span&gt;&lt;a href=&quot;http://draft.blogger.com/&quot;&gt;&lt;/a&gt;&lt;span id=&quot;goog_1268545651&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1268545652&quot;&gt;&lt;/span&gt;&lt;a href=&quot;http://draft.blogger.com/&quot;&gt;&lt;/a&gt;&lt;span id=&quot;goog_1268545653&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1268545654&quot;&gt;&lt;/span&gt;&lt;a href=&quot;http://draft.blogger.com/&quot;&gt;&lt;/a&gt;&lt;span id=&quot;goog_1268545657&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1268545658&quot;&gt;&lt;/span&gt;In my recent project I had a datagrid and needed to have a search option where the user can do a basic search or an advanced search, so I thought about implementing this using a form flip animation. Basic search on one side and advanced search on the other. This saved me space and all i had to do is add a search button above the grid and upon click pop up the search form. Below is a screen shots of what this looks like.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyl9WGfBABE3iS5GWhQRGIzw8OVS7i4nw1OqcIN-BAsXU1fsyPm_SkGNt1jy1xfdDZM7tVGb5WkxM4lMIZ3YZrWKQgSLNI2yBkbJkr3IP7KQ_1Be9O4_WFVCrMjdIpzsHRcUcrNj5amfw/s1600/initial.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; bx=&quot;true&quot; height=&quot;51&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyl9WGfBABE3iS5GWhQRGIzw8OVS7i4nw1OqcIN-BAsXU1fsyPm_SkGNt1jy1xfdDZM7tVGb5WkxM4lMIZ3YZrWKQgSLNI2yBkbJkr3IP7KQ_1Be9O4_WFVCrMjdIpzsHRcUcrNj5amfw/s320/initial.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT6NUKOQ5v0JxPQxjrUwCWnimFeKgWGHhfU20ecMU9ixRub9N3AdKh7uI00Y6rYqBHdf6-mSuPs1og8iZ8noCvvIry_OKp8i51WwKse1QFJf6NNx59Ck6IBoEMvJ4lkjyIuXTCkI7urAU/s1600/basicsearch.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; bx=&quot;true&quot; height=&quot;192&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT6NUKOQ5v0JxPQxjrUwCWnimFeKgWGHhfU20ecMU9ixRub9N3AdKh7uI00Y6rYqBHdf6-mSuPs1og8iZ8noCvvIry_OKp8i51WwKse1QFJf6NNx59Ck6IBoEMvJ4lkjyIuXTCkI7urAU/s400/basicsearch.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHBZ6AZ-mHrJS1JEU2lPOnVl0GVApXt-QHAvD7flbJ8tWg8qU2xIZSyq7RuZ-63dKtbtIKEFtNUKKrP5QJ3P6AsqonJvFjPgE4f80D_eRHWoVoveI8l2coqLDZ1r5emPhS0xZ4j6IWK0M/s1600/advsearch.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; bx=&quot;true&quot; height=&quot;145&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHBZ6AZ-mHrJS1JEU2lPOnVl0GVApXt-QHAvD7flbJ8tWg8qU2xIZSyq7RuZ-63dKtbtIKEFtNUKKrP5QJ3P6AsqonJvFjPgE4f80D_eRHWoVoveI8l2coqLDZ1r5emPhS0xZ4j6IWK0M/s400/advsearch.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;When the user clicks the search icon on the first screen shot, it pops up the basic search form and upon clicking Advanced search the form flips and shows the advanced search form. Now, let&#39;s look at some code. &lt;br /&gt;
&lt;br /&gt;
First I am going to add a stack panel for the search icon then right underneath that I am addding a popup control in mainpage.xaml.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Orientation&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Horizontal&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;23&quot;&lt;/span&gt;  &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Left&quot;&lt;/span&gt;   &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;btnLaunchSearch&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Top&quot;&lt;/span&gt;  &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Click&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;btnLaunchSearch_Click&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Button.Content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Image&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Source&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;./images/search.jpg&quot;&lt;/span&gt;   &lt;span class=&quot;attr&quot;&gt;ToolTipService&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;ToolTip&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Search&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Button.Content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Popup&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;SearchFormPopup&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;VerticalOffset&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;HorizontalOffset&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Popup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;Now, I am going to add a view for the search form. I created a folder called UserControls then added a Search.xaml user control. I put the styles in a separate file - used a resource dictionary.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;UserControl&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;DB.Silverlight.UserControls.Search&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;xmlns:x&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;xmlns:d&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;xmlns:mc&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;mc:Ignorable&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;d&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;d:DesignHeight&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;d:DesignWidth&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;500&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;UserControl.Resources&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ResourceDictionary&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Key&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;SD&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ResourceDictionary.MergedDictionaries&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ResourceDictionary&lt;/span&gt;  &lt;span class=&quot;attr&quot;&gt;Source&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;../Dictionaries/SearchDictionary.xaml&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ResourceDictionary.MergedDictionaries&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Storyboard&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;StartingPosition&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BeginTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetName&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;FormBack&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetProperty&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;(UIElement.RenderTransform).TransformGroup.Children[3].(TranslateTransform.X)&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5000&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Storyboard&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Storyboard&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;AdvancedSearch&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BeginTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetName&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;PanelProjection&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetProperty&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;RotationY&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:01&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;90&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BeginTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetName&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;FormFront&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetProperty&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;(UIElement.RenderTransform).TransformGroup.Children[3].(TranslateTransform.X)&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:01&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:01.01&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5000&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BeginTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetName&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;FormBack&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetProperty&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;(UIElement.RenderTransform).TransformGroup.Children[3].(TranslateTransform.X)&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5000&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00.99&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5000&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:01&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BeginTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetName&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;BackPanelProjection&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetProperty&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;RotationY&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:01&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;270&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:02&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;360&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Storyboard&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Storyboard&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;BasicSearch&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BeginTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetName&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;FormBack&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetProperty&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;(UIElement.RenderTransform).TransformGroup.Children[3].(TranslateTransform.X)&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:01&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:01.01&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5000&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BeginTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetName&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;BackPanelProjection&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetProperty&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;RotationY&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:01&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;-90&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BeginTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetName&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;PanelProjection&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetProperty&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;RotationY&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:01&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;-270&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:02&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;-360&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;BeginTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetName&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;FormFront&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Storyboard&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;TargetProperty&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;(UIElement.RenderTransform).TransformGroup.Children[3].(TranslateTransform.X)&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5000&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:00.99&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5000&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;KeyTime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;00:00:01&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Storyboard&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;UserControl.Resources&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Canvas&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;FormFront&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel.RenderTransform&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TransformGroup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ScaleTransform&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SkewTransform&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RotateTransform&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TranslateTransform&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TransformGroup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel.RenderTransform&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel.Projection&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;PlaneProjection&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;PanelProjection&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;RotationX&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;RotationY&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;RotationZ&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel.Projection&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Border&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;mainBorder&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource ModalDialogBorder}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;LayoutRoot&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;399&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;10,10,10,10&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;70&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Orientation&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Horizontal&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Center&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;20&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Note:Search by user&#39;s first name, last name, or by business name.&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;TabIndex&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtSearch&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;30&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;260&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0,5,0,20&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Orientation&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Horizontal&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Center&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;2&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;89,0,89,55&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;SearchButton&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;30&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt;  &lt;span class=&quot;attr&quot;&gt;Content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Search&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;CancelButton&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;30&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt;  &lt;span class=&quot;attr&quot;&gt;Content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Cancel&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Advanced&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Advanced Search&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Left&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Bottom&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Auto&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Background&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;DarkGreen&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;FontFamily&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Georgia&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;FontSize&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;10&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;10,0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Border&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;FormBack&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel.RenderTransform&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TransformGroup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ScaleTransform&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;SkewTransform&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RotateTransform&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TranslateTransform&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TransformGroup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel.RenderTransform&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel.Projection&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;PlaneProjection&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;BackPanelProjection&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;RotationX&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;RotationY&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;RotationZ&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel.Projection&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Border&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource ModalDialogBorder}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;theForm&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;399&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;130&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1*&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Placard Type&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource Prompt}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ComboBox&lt;/span&gt;  &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;cbPlacardType&quot;&lt;/span&gt;   &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt; &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource EntryDrop}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Status&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource Prompt}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ComboBox&lt;/span&gt;  &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;cbStatus&quot;&lt;/span&gt;   &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt; &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource EntryDrop}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Date Entered&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;2&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource Prompt}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;From&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;8,0,231,0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;2&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;30&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;  &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtFrom&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;2&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;80&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;37,0,162,0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;To&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;30&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;2&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;116,0,123,0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtTo&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;2&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;80&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;150,0,49,0&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Placard Id&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;3&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource Prompt}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtPlacardId&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;3&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource Entry}&quot;&lt;/span&gt;  &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Business Name&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;4&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource Prompt}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtBusinessName&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;4&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource Entry}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Contact First Name&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource Prompt}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtContactFirstName&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource Entry}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Contact Last Name&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;6&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource Prompt}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtContactLastName&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;6&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{StaticResource Entry}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;btnAdvancedSearch&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot; Search &quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Left&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Bottom&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;95&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Background&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;DarkGreen&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;FontFamily&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Georgia&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;FontSize&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;12&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;7&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;30,0,0,10&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;btnAdvancedSearchCancel&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot; Cancel &quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Left&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Bottom&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;95&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Background&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;DarkGreen&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;FontFamily&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Georgia&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;FontSize&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;12&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;7&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;10,10&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Button&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Basic&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Content&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Switch to Basic Search&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Right&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Bottom&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;112&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Background&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;DarkGreen&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;FontFamily&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Georgia&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;FontSize&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;10&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;8&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0,0,12,5&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Border&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Canvas&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;UserControl&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
Now, in the code behind of the search form I added the mecanics to do the flip animation.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Search : UserControl&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; Search()&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;InitializeComponent();&lt;/pre&gt;&lt;pre&gt;Loaded += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; RoutedEventHandler(Search_Loaded);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;Advanced.Click += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; RoutedEventHandler(Advanced_Click);&lt;/pre&gt;&lt;pre&gt;Basic.Click += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; RoutedEventHandler(Basic_Click);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Search_Loaded(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;&lt;pre&gt;StartingPosition.Begin();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;rem&quot;&gt;//TODO: Load comboboxes..&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Advanced_Click(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;AdvancedSearch.Begin();&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Basic_Click(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;BasicSearch.Begin();&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
All i have left now is the code to handle the search button in mainpage.xaml and it&#39;s pretty simple - i just have to new up an instance of the popup control that i created in mainpage and also new up an instance of the search form user control and ofcourse code to handle my data. Since my data code involves WCF and is a bit lengthy I am just gonna leave that up to you to add your own data handling here.  Below is the code needed in mainpage.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; btnLaunchSearch_Click(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;SearchFormPopup = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Popup();&lt;/pre&gt;&lt;pre&gt;form = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Search();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;form.CancelButton.Click += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; RoutedEventHandler(CancelButton_Click);&lt;/pre&gt;&lt;pre&gt;form.SearchButton.Click += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; RoutedEventHandler(SearchButton_Click);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;form.btnAdvancedSearchCancel.Click += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; RoutedEventHandler(CancelButton_Click);&lt;/pre&gt;&lt;pre&gt;form.btnAdvancedSearch.Click += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; RoutedEventHandler(AdvancedSearchButton_Click);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;SearchFormPopup.Child = form;&lt;/pre&gt;&lt;pre&gt;SearchFormPopup.IsOpen = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; AdvancedSearchButton_Click(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;&lt;pre&gt;LoadFilterdDataboardDataAdvancedSearch();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;SearchFormPopup.IsOpen = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; CancelButton_Click(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;SearchFormPopup.IsOpen = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SearchButton_Click(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;LoadFilteredDashBoardDataSearch();&lt;/pre&gt;&lt;pre&gt;SearchFormPopup.IsOpen = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
And that&#39;s it. If you have any comments or better ways to do this, let me know.</content><link rel='replies' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/14335093938966593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ethanphoenix.blogspot.com/2010/08/silverlight-form-flip-animation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/14335093938966593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/14335093938966593'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2010/08/silverlight-form-flip-animation.html' title='Silverlight Form Flip Animation'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyl9WGfBABE3iS5GWhQRGIzw8OVS7i4nw1OqcIN-BAsXU1fsyPm_SkGNt1jy1xfdDZM7tVGb5WkxM4lMIZ3YZrWKQgSLNI2yBkbJkr3IP7KQ_1Be9O4_WFVCrMjdIpzsHRcUcrNj5amfw/s72-c/initial.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-1475815900311765705</id><published>2010-07-25T15:45:00.000-07:00</published><updated>2010-08-01T20:29:00.062-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Printing"/><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight datagrid"/><title type='text'>Silverlight 4.0 Datagrid printing</title><content type='html'>Recently I had a requirement to print data from Silverlight datagrid which i developed and integrated it in an asp.net project to serve as a dashboard for client administrative tasks. There is one feature that is not supported in Silverlight 4.0 and it&#39;s the ability to specify the print preference option in code. I needed this feature because the dadagrid is quite long and needs to be printed as landscape. Anyhow, the printing is straight forward, we just need to new up a silverlight user control to server as the header for each page being printed and we can also do the same if we need a footer. Below is the header user control i created. We need to add this to our silverlight project.&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;UserControl&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;DB.Silverlight.Views.ApplicationPrintHeadView&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;xmlns:x&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;xmlns:d&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;xmlns:mc&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;mc:Ignorable&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;d&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;d:DesignHeight&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;d:DesignWidth&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;422&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1100&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;20,0&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;130&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;30&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;90&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;90&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;120&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;ColumnDefinition&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;400&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt;  &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;RowDefinition&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;h1&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;First Name&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;h2&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Last Name&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;2&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;h3&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Phone&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;3&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;h4&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Business Name&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;4&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Tier&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;5&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Status&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;6&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Date Applied&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;7&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Number Approved&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;Column&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;8&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Industry&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Border&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;TimelineBorder&quot;&lt;/span&gt;  &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Background&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;LightGray&quot;&lt;/span&gt;  &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;BorderBrush&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Black&quot;&lt;/span&gt;  &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;BorderThickness&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0,20,140,0&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Top&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Grid&lt;/span&gt;.&lt;span class=&quot;attr&quot;&gt;ColumnSpan&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;9&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Border&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;UserControl&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;Now that we have the page header set up, we&#39;re gonna use that user control in our code along with the printing procedure.  In my case i have a datagrid with paging, so i want to print all the data and not just the data displayed on the screen.  To do that I did a small workaround, basically setting the page size to the Total Item Count before printing and set the size back to its original state. I dont like this work around but works fine for now. This will alllow us to print every row returned by our datagrid.  Furthemore, I created another user control that&#39;s gonna act as my data container.&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;UserControl&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;DB.Silverlight.Views.ApplicationPrintView&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;xmlns:x&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;xmlns:d&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;xmlns:mc&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;xmlns:sdk&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;xmlns:converter&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;clr-namespace:DB.Silverlight&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;mc:Ignorable&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;d&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;d:DesignHeight&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;300&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;d:DesignWidth&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;422&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1100&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;UserControl.Resources&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;converter:ApplicationStatusConverter&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;x:Key&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;ApplicationStatusConverter&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;UserControl.Resources&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Margin&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;20,0&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;appData&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Orientation&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Horizontal&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{Binding FirstName}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{Binding LastName}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{Binding PhoneNumber}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;130&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{Binding BusinessName}&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;TextWrapping&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Wrap&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;30&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{Binding TierCode}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;90&quot;&lt;/span&gt;  &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{Binding applicationStatus,Converter={StaticResource ApplicationStatusConverter}}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;90&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{Binding DateApplied}&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{Binding NumberApproved}&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;TextAlignment&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Center&quot;&lt;/span&gt;  &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;290&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;{Binding IndustryName}&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;TextWrapping&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Wrap&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;StackPanel&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Grid&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;UserControl&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;ApplicationPrintView is the container that binds all fields of my datagrid(which lives in mainpage.xaml) by assigning the binding property which ties it to the PagedCollectionView.  And below is the button click event that fires printing.&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; PrintGrid_Click(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;PrintDocument pd = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; PrintDocument();&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; ItemIndex = 0;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;pd.PrintPage += (s, e) =&amp;gt;&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;PagedCollectionView items = (PagedCollectionView)dgDashboard.ItemsSource;&lt;/pre&gt;&lt;pre&gt;StackPanel itemHost = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; StackPanel();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;ApplicationPrintHeadView head = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ApplicationPrintHeadView();&lt;/pre&gt;&lt;pre&gt;itemHost.Children.Add(head);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;items.PageSize = items.TotalItemCount;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;while&lt;/span&gt; (ItemIndex &amp;lt; items.TotalItemCount)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;&lt;pre&gt;ApplicationPrintView itemsContainer = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ApplicationPrintView();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;itemsContainer.appData.DataContext = items[ItemIndex];&lt;/pre&gt;&lt;pre&gt;itemHost.Children.Add(itemsContainer);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;itemHost.Measure(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Size(e.PrintableArea.Width, &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt;.PositiveInfinity));&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (itemHost.DesiredSize.Height &amp;gt; e.PrintableArea.Height &amp;amp;&amp;amp; itemHost.Children.Count &amp;gt; 1)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;&lt;pre&gt;itemHost.Children.Remove(itemsContainer);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;e.HasMorePages = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;ItemIndex += 1;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;catch&lt;/span&gt; (Exception)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;MessageBox.Show(&lt;span class=&quot;str&quot;&gt;&quot;An Unexpected Error Has Occured.  Please try again.&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;finally&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;items.PageSize = 20;&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;e.PageVisual = itemHost;&lt;/pre&gt;&lt;pre&gt;};&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;pd.Print(&lt;span class=&quot;str&quot;&gt;&quot;My Document&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;This will print all data from datagrid across multiple pages with a nicely formatted page header and spaced up page footer so no row gets cut.&lt;br /&gt;
In summary, this is what i did to set up printing: in my silverlight project I added a folder called Views then added 2 user controls(page header and container) to it. And ofcourse my datagrid lives in mainPage.xaml that&#39;s pulling its data thru WCF (I reused the same service used by my ASP.NET application). Another option would be to use Ria Services.  I had my silverlight project configured to be hosted in my ASP.NET application, so all i had to do is build the silverlight project to update the xap file.&lt;br /&gt;
&lt;br /&gt;
References: http://channel9.msdn.com/learn/courses/Silverlight4/</content><link rel='replies' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/1475815900311765705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ethanphoenix.blogspot.com/2010/07/silverlight-40-datagrid-printing.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/1475815900311765705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/1475815900311765705'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2010/07/silverlight-40-datagrid-printing.html' title='Silverlight 4.0 Datagrid printing'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-7231715141087683315</id><published>2009-12-08T19:58:00.000-08:00</published><updated>2010-08-07T13:12:54.672-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Extension Methods"/><title type='text'>Extension method on the string object</title><content type='html'>I am going to show you how to create an extension method on the string object to validate if that string is a valid guid.&lt;br /&gt;
To make this simple, we&#39;ll create a new console application, add a class and name it Extensions or any name you want, I usually stick with some naming conventions so Extensions is pretty descriptive.&lt;br /&gt;
Now, we need to make that class public and static for this to work. The code is very simple..see below:&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, &quot;Courier New&quot;, Courier, Monospace;
 background-color: #FFE87C;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Extensions&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; IsValidGuid(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; g)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;Guid gd = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Guid(g);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;catch&lt;/span&gt; (Exception)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;Notice that we used the keyword &quot;This&quot; to let it know that this is going to be an extended method. &lt;br /&gt;
To use the method, we just make the call directy on the string we have ..example:&lt;br /&gt;
&lt;blockquote&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; s = &lt;span class=&quot;str&quot;&gt;&quot;some text or guid string!&quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;Console.writeline(s.IsValidGuid());&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;And that all there is to it. Now you have an extention method ready to go.</content><link rel='replies' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/7231715141087683315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ethanphoenix.blogspot.com/2009/12/extension-method-on-string-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/7231715141087683315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/7231715141087683315'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2009/12/extension-method-on-string-object.html' title='Extension method on the string object'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-8945129688547116047</id><published>2009-11-29T18:40:00.000-08:00</published><updated>2009-11-29T18:40:01.668-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio tip"/><title type='text'>Copy/ Cut in Visual Studio tip</title><content type='html'>I came across this by accident while i was writing code..thought I&#39;d share this tip.&lt;br /&gt;
Before I used to highlight the whole line of code to copy it...but actually we dont even have to highlight the line...We can place the cursor anywhere on the line and just hit Ctrl + c to copy or Ctrl + X to cut..So, this can be done without any selection. This applies only for a single line. This has been saving a lot of time. Sometimes I have a long line and waste time highlighting and trying to make the line as a selection. Now, all i gotta do is place the cursor at the beginning of the line or anywhere on the line really and that&#39;s it.</content><link rel='replies' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/8945129688547116047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ethanphoenix.blogspot.com/2009/11/copy-cut-in-visual-studio-tip.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/8945129688547116047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/8945129688547116047'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2009/11/copy-cut-in-visual-studio-tip.html' title='Copy/ Cut in Visual Studio tip'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-6645086465261693394</id><published>2009-11-28T13:58:00.000-08:00</published><updated>2011-08-09T22:09:02.951-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ajax modalpopupextender"/><category scheme="http://www.blogger.com/atom/ns#" term="send email"/><title type='text'>Sending email using modalpopupextender.</title><content type='html'>I recently worked on a project where i displayed a list of members using the listview control to display information about the member and a send email link, so instead of having the user to go to another page to send the email then go back to the list of members i decided to implement the ajax modalpopupextender for a better user experience. But for simplicity I am going to show you how to implement the modalpopupextender using a link on simple page. I also included validation and success message which will also be displayed as a modal message that will close after 4 seconds...K, let&#39;s get down to it.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Step 1:&lt;br /&gt;
&lt;/strong&gt;Add a script manager to the page right under the form tag.&lt;br /&gt;
&lt;blockquote&gt;
&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;form&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;form1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:ScriptManager&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;ScriptManager1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:ScriptManager&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;strong&gt;Step 2:&lt;/strong&gt;&lt;br /&gt;
Create the form where we want the user to fill out info and click send email. This step is simple, we just create a table with some rows and columns and add labels and textboxes for the user input such as name subject from email and comments.&lt;br /&gt;
Once we have created the form we put&amp;nbsp;a panel around it and set the display property to &quot;None&quot;. That way we wont see the form on page load.&lt;br /&gt;
We also need to add 2 buttons to this form, btnSendEmail and btnCancel. Add the OnClick event to btnSendEmail...this is where the magic happens and this is excecute on server. BtnCancel is already taken care of by the modalpopupextender, so we dont need any events for this.&lt;br /&gt;
&lt;blockquote&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Panel&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;emailPanel&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;display: none&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;600px&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Font-Names&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;@MS PGothic&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;12&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;cellpadding&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;cellspacing&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;border-style: solid; width: 600px;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;heigh: 400px; border-color: #333333; background-color: #ffffff;&quot;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:ValidationSummary&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;ValidationSummary1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ValidationGroup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;SendEmail&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lblSubject&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Subject&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtSubject&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;290px&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lblName&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Name&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtName&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;290px&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:RequiredFieldValidator&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;RequiredFieldValidator1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Display&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;none&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;ControlToValidate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtName&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ErrorMessage&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Please enter your name.&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ValidationGroup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;SendEmail&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:RequiredFieldValidator&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lblEmail&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;From&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtEmail&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;290px&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:RequiredFieldValidator&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;RequiredFieldValidator2&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Display&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;none&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;ControlToValidate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtEmail&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ValidationGroup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;SendEmail&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ErrorMessage&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Please enter your email address.&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:RequiredFieldValidator&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:RegularExpressionValidator&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;RegularExpressionValidator4&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ErrorMessage&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Please enter a valid email address.&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;attr&quot;&gt;Display&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;none&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ValidationGroup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;SendEmail&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ControlToValidate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtEmail&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ValidationExpression&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;\w+([-+.&#39;]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:RegularExpressionValidator&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lblComments&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Comments&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtComments&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;TextMode&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;MultiLine&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;450px&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Height&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;190px&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:RequiredFieldValidator&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;RequiredFieldValidator3&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Display&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;none&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;ControlToValidate&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtComments&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ValidationGroup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;SendEmail&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ErrorMessage&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Please enter comments.&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:RequiredFieldValidator&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;right&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;right&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Button&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;btnSendEmail&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Send Email&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ValidationGroup&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;SendEmail&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;OnClick&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Admin_SendEmail&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Button&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;btnCancel&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Cancel&quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Panel&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;strong&gt;step 4:&lt;/strong&gt;&lt;br /&gt;
We add another panel for the success message and another modalpopupextender that will popup this panel.&lt;br /&gt;
&lt;strong&gt;step 5:&lt;/strong&gt;&lt;br /&gt;
Now we add a linkbutton to the page, this is what we are going to see where the page loads. Something like Click Here to Send Email. &lt;br /&gt;
&lt;blockquote&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:LinkButton&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lbSendEmail&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;OnClientClick&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;return false;&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Send Email&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:LinkButton&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;strong&gt;Step 6: &lt;/strong&gt;&lt;br /&gt;
Write the javacript that will handle showing the modalpopupextender an hide it and also display the success messsage and get it to close automatically.&lt;br /&gt;
&lt;blockquote&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;function showPopup() {&lt;/pre&gt;
&lt;pre&gt;var modalPopupBehavior = $find(&lt;span class=&quot;str&quot;&gt;&#39;mpeSendEmailBehavior&#39;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;modalPopupBehavior.show();&lt;/pre&gt;
&lt;pre&gt;}&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;function hidepopup() {&lt;/pre&gt;
&lt;pre&gt;var modalPopupBehavior = $find(&lt;span class=&quot;str&quot;&gt;&#39;mpeSendEmailBehavior&#39;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;modalPopupBehavior.hide();&lt;/pre&gt;
&lt;pre&gt;}&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;function showEmailSuccessPopup() {&lt;/pre&gt;
&lt;pre&gt;var modalPopupBehavior = $find(&lt;span class=&quot;str&quot;&gt;&#39;EmailSuccessBehavior&#39;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;modalPopupBehavior.show();&lt;/pre&gt;
&lt;pre&gt;}&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;function hideEmailSuccessPopup() {&lt;/pre&gt;
&lt;pre&gt;var modalPopupBehavior = $find(&lt;span class=&quot;str&quot;&gt;&#39;EmailSuccessBehavior&#39;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;modalPopupBehavior.hide();&lt;/pre&gt;
&lt;pre&gt;}&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;function pageLoad() {&lt;/pre&gt;
&lt;pre&gt;$addHandler($get(&lt;span class=&quot;str&quot;&gt;&quot;lbSendEmail&quot;&lt;/span&gt;), &lt;span class=&quot;str&quot;&gt;&#39;click&#39;&lt;/span&gt;, showPopup);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;setTimeout(&lt;span class=&quot;str&quot;&gt;&quot;hideEmailSuccessPopup()&quot;&lt;/span&gt;, 4000);&lt;/pre&gt;
&lt;pre&gt;} &lt;/pre&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;strong&gt;Last Step:&lt;br /&gt;
&lt;/strong&gt;Now our aspx page is ready all we need is add links to CSS and javascript. and write code to send email and display success message. &lt;br /&gt;
If you have any question or comments let me know.</content><link rel='replies' type='application/atom+xml' href='http://ethanphoenix.blogspot.com/feeds/6645086465261693394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ethanphoenix.blogspot.com/2009/11/sending-email-using-modalpopupextender.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/6645086465261693394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/6645086465261693394'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2009/11/sending-email-using-modalpopupextender.html' title='Sending email using modalpopupextender.'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-648868078298652292.post-168537428743342222</id><published>2009-10-08T20:31:00.000-07:00</published><updated>2010-07-24T16:47:47.004-07:00</updated><title type='text'>CONTACT ME</title><content type='html'>&lt;iframe src=&quot;http://spreadsheets.google.com/embeddedform?key=t2RnaODMtvuqBowfj3awSkg&quot; width=&quot;470&quot; height=&quot;493&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot;&gt;Loading...&lt;/iframe&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/168537428743342222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/648868078298652292/posts/default/168537428743342222'/><link rel='alternate' type='text/html' href='http://ethanphoenix.blogspot.com/2009/10/contact-me.html' title='CONTACT ME'/><author><name>Ethan</name><uri>http://www.blogger.com/profile/09275369347566805225</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-FtrVBWkfdZmnCPGH7ZFddG16aX8dYxie_8RwBRKeot1_EscT9Cc8GsJb5zwGR3WbMlrSIYxpKA9XlrwOs7u5E2iaOkEfQcZVmp_UXDQmFfeoPFu_Jjp4wWTInr6ncg/s220/Hammond2.jpg'/></author></entry></feed>