<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="www.w3.org/2005/Atom" xmlns:sy="purl.org/rss/1.0/modules/syndication/" xmlns:dc="purl.org/dc/elements/1.1/" xmlns:content="purl.org/rss/1.0/modules/content/" xmlns:wfw="wellformedweb.org/CommentAPI/" xmlns:slash="purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>User Interface Support Team Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/dsui/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/dsui/feed.xml</link>
    <description />
    <lastBuildDate>Tue, 16 Apr 2019 05:05:50 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Issues with Winform Application when running in Windows 7</title>
      <link>https://docs.microsoft.com/archive/blogs/dsui/issues-with-winform-application-when-running-in-windows-7</link>
      <pubDate>Mon, 21 Oct 2013 12:44:00 GMT</pubDate>
      <dc:creator><![CDATA[Nitish Nagpal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dsui/2013/10/21/issues-with-winform-application-when-running-in-windows-7/</guid>
      <description><![CDATA[Here comes a blog from EMEA Windows&nbsp;WPF &amp; UI&nbsp;Subject Matter Expert and experienced...]]></description>
      <content:encoded><![CDATA[<h1>Here comes a blog from EMEA Windows&nbsp;WPF &amp; UI&nbsp;Subject Matter Expert and experienced Engineer Shiva Shankar</h1>
<p>Recently one of my customers reported a problem where his Winform application started failing with &ldquo;Not enough storage is available to process this command&rdquo; error when running in Windows 7. Yet, the same application works great on Windows XP.</p>
<p>&nbsp;</p>
<p>That was really something interesting. So, what could be the reason? Hmm, there may be &lsquo;n&rsquo; number of reason, but in this blog we are going to look into a particular scenario.</p>
<p><span style="background-color: #ffff00;"><strong>[Scenario Details]</strong></span></p>
<ul>
<li>The application is using a lot of &ldquo;System.Drawing.Bitmaps&rdquo; objects.</li>
</ul>
<p>&nbsp;</p>
<ul>
<li>In the failure scenario you notice that lot of these objects are not disposed.</li>
</ul>
<p>&nbsp;</p>
<ul>
<li>Lot of 64 Kb allocations on the native side.</li>
</ul>
<p>&nbsp;</p>
<ul>
<li>The application was working fine on earlier version of OS like Windows XP.</li>
</ul>
<p>&nbsp;</p>
<p><span style="background-color: #ffff00;"><strong>The next question would be, how do I get these details?</strong></span></p>
<p><br /><strong>To get this we may need to get our hands dirty with WinDBG</strong>. I am not going deep into the analysing logs using WinDBG in this blog, but I will share some basic steps , and will concentrate more on the work around here.</p>
<ul>
<li>Capture a crash dump when the application fails with out of memory or related exception.</li>
<li>Open the dump in WinDBG.</li>
<li>Run &ldquo;!address &ndash;summary&rdquo; to get the memory details.</li>
<li>Check the memory under &ldquo;&lt;unknown&gt;&rdquo; section from the above output.</li>
<li>Run &ldquo;!eeheap &ndash;gc&rdquo; to get the managed memory details.</li>
<li>If the managed memory size is low compared to the total application memory, and &lt;unknown&gt; section memory is very large. Then we can proceed further. Else this blog is not related to the problem you are interested in.</li>
<li>Check the total number of Bitmap used in the application. To get this details run &ldquo;!dumpheap -stat -type System.Drawing.Bitmap&rdquo;. This will give us the total number of &ldquo;System.Drawing.Bitmap&rdquo; objects in the application.</li>
<li>If you see that the application is using a huge number of Bitmap objects, then this work around below may solve the problem.</li>
</ul>
<p><strong>[Work Around]</strong></p>
<p>Yes, the below option is only a work around. This is not the actual solution to the problem. The right solution to this problem may depend on the exact scenario of your application. If the application is using lot of bitmaps intentionally, then you would need to re-architect your solution to use fewer bitmaps at a time. In case you see lot of bitmap objects which are not intentional, then you would need to work on properly disposing them when not required. I will not be able to cover the solution<br />details in this blog, but I will try to write a different blog on this later.</p>
<p>&nbsp;</p>
<p>GDI+ 1.1 (default on Windows 7) will call into the Windows Imaging Component (WIC) to handle image rendering. WIC improves the performance and reliability of image encoding/decoding in the application, but consumes little more memory compared to GDI+ 1.0. On Windows Vista/7 operating system, we still have an option to force our application to use GDI+ 1.0 for image rendering, but starting Windows 8 this option is not available any more. As said before, this is temporary solution only.</p>
<p>&nbsp;</p>
<p><span style="background-color: #ffff00;"><strong>We need to make the below changes to App.Config file in the application to work around the problem. If you do not see this file under your project, you can add this file using Visual Studio.</strong></span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;&nbsp;&nbsp;Right click on the project and select Add -&gt; New Item.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.&nbsp;&nbsp; Select Application Configuration file from the list.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.&nbsp; Double the file to open it for editing.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4. Add the changes and save it.</p>
<p>&nbsp;</p>
<p>&lt;?xml version="1.0" encoding="utf-8" ?&gt;</p>
<p>&lt;configuration&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&lt;appSettings&gt;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&lt;/appSettings&gt;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">&lt;!-- Add this setting to force application to use GDI+1.0 version --&gt;</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><span style="color: #ff0000;">&lt;dependency&gt;</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><span style="color: #ff0000;">&lt;dependentAssembly&gt;</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><span style="color: #ff0000;">&lt;assemblyIdentity type="win32" name="Microsoft.Windows.GdiPlus"</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><span style="color: #ff0000;">processorArchitecture="*" version="1.0.0.0"&nbsp;&nbsp;&nbsp;publicKeyToken="6595b64144ccf1df"&nbsp;&nbsp;language="*"/&gt;</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><span style="color: #ff0000;">&lt;/dependentAssembly&gt;</span></p>
<p><span style="color: #ff0000;">&nbsp;&lt;/dependency&gt;&nbsp;</span></p>
<p><span style="color: #000000;">&lt;/configuration&gt;</span></p>
<p><span style="background-color: #ffff00;"><strong>&nbsp;P.S.: The above setting will make our application work similar to earlier Windows OS like XP by using GDI+ 1.0. By forcing our application to use GDI+ 1.0, we avoid the extra memory used by WIC to render bitmap, thus keeping our application memory low as compared to using GDI+ 1.1.</strong></span></p>
<p>&nbsp;Hope this helps you to earn some time to work on managing the images more efficiently and/or calling dispose properly in the application.</p>
<p><span style="font-size: large;"><strong>Written by: Shiva N Shankar</strong></span></p>
<p><span style="font-size: large;"><strong>Reviewed by: David Wooden</strong></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Making your Winforms application Global</title>
      <link>https://docs.microsoft.com/archive/blogs/dsui/making-your-winforms-application-global</link>
      <pubDate>Mon, 06 Aug 2012 04:15:00 GMT</pubDate>
      <dc:creator><![CDATA[Nitish Nagpal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dsui/2012/08/06/making-your-winforms-application-global/</guid>
      <description><![CDATA[Recently one of our customers reported an issue that their Winforms application was not behaving...]]></description>
      <content:encoded><![CDATA[<p>Recently one of our customers reported an issue that their Winforms application was not behaving properly. The size or alignments of different controls on the forms were badly affected after porting to Chinese Operating Systems resulting in overlapped controls. On top of that, due to the difference in the glyph size of the fonts, on Chinese machines there was a need to change the font size.</p>
<p>We discussed the issue at length and taken the feedback here are few points that we can consider making our application usable for Global customers.</p>
<ol>
<li>We strongly suggest thinking about Globalization from the early stage of Project Lifecycle. This may not be possible always however, the sooner we do it better it is.</li>
</ol>
<p style="padding-left: 30px;">a. Because a fonts point size varies greatly for different fonts and it is therefore recommended to leave 15-30% more space.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.&nbsp; In case there is a sudden need, we can tweak our application to adapt to the new environment :</p>
<p style="padding-left: 30px;">a. For East Asian fonts it is recommended that you use GDI instead of GDI+ for rendering by setting <a href="https://msdn.microsoft.com/en-us/library/system.windows.forms.application.setcompatibletextrenderingdefault.aspx">SetCompatibleTextRenderingDefault(false)</a><b> </b>because GDI+ tends to have rendering issues with East&nbsp;&nbsp;Asian characters.</p>
<p style="padding-left: 30px;">b. If <a href="https://msdn.microsoft.com/en-us/library/system.windows.forms.autoscalemode.aspx">AutoScaleMode</a> is set to Inherit Controls scale according to the classes' parent's scaling mode. If there is no parent, automatic scaling is disabled. When you set AutoScaleMode to Font, Controls&nbsp; scale relative to the dimensions of the font the classes are using, which is typically the system font.</p>
<p style="padding-left: 30px;">c. Suppose you want to set a specific point size for the font. At present, we don&rsquo;t have any quick way to automatically set the font size for all the forms and its child-controls. One way to change the font is through the Winforms designer. Another approach is to change the form&rsquo;s font through code.&nbsp; But you cannot put the code in the designer file since you should not be modifying any code in there at all.</p>
<p style="padding-left: 30px;">d. In Winforms, if you do not assign a font to a form then the .NET framework will use the font returned by <a href="https://msdn.microsoft.com/en-us/library/system.drawing.systemfonts.defaultfont.aspx">SystemFonts.DefaultFont</a>.&nbsp; SystemFonts.DefaultFont on an English version of Windows will return Microsoft Sans Serif 8.25.&nbsp; On East Asian versions of Windows 7, the fonts returned by SystemFonts.DefaultFont are as follows:</p>
<p style="padding-left: 60px;">&nbsp;i.&nbsp;&nbsp;&nbsp; Simplified Chinese: SimSun 9&nbsp; 宋体</p>
<p style="padding-left: 60px;">ii.&nbsp;&nbsp;&nbsp; Traditional Chinese: PMingLiU 9 新細明體</p>
<p style="padding-left: 60px;">iii.&nbsp;&nbsp;&nbsp; Japanese: MS UI Gothic 9</p>
<p style="padding-left: 60px;">iv.&nbsp;&nbsp;&nbsp; Korean: Gulim 9&nbsp; 굴림</p>
<p>&nbsp;This means that if you develop a Winforms application on any&nbsp; version of Windows and if you do not explicitly set the font on the form then when you run the application on English Windows 7, the font that is used will be Microsoft Sans Serif 8.25.&nbsp; If you run this same application on a Simplified Chinese version of Windows then the font used by the form will be the font returned by SystemFonts.DefaultFont which is SimSun 9&nbsp; 宋体.</p>
<p>&nbsp;If you don&rsquo;t want the .NET Framework to use the font provided by <a href="https://msdn.microsoft.com/en-us/library/system.drawing.systemfonts.defaultfont.aspx">SystemFonts.DefaultFont</a> then you need to explicitly set the font for the form either through the designer or in code. The child controls will generally inherit the font from the parent form. Changing the font in &nbsp;&lt;FormName&gt;.Designer.cs or &lt;FormName&gt;.Designer.vb is not supported.&nbsp;</p>
<p>&nbsp;The East Asian fonts&rsquo; Latin glyphs tend to be wider than their Western counter parts. If you are using the default font then there will generally be expansion when going from English systems to East Asian systems.&nbsp; So as mentioned above, leaving space especially between controls that can autosize is a good idea.&nbsp;</p>
<p>&nbsp;If you specify a font like Microsoft Sans Serif 8.25 which does not contain Chinese, Japanese or Korean glyphs then font linking will be used to provide a link to a font which contains the desired East Asian glyphs.&nbsp; See <a href="https://msdn.microsoft.com/en-us/goglobal/bb688134.aspx">Globalization Step-by-Step</a> for more details.&nbsp;</p>
<p>&nbsp;Please note that just because two fonts have the same point size does not guarantee that they will have glyphs that are the same size when displayed on the output device.&nbsp; This is also mentioned in the Font Linking section of the above mentioned article.&nbsp; Font sizes are not the only consideration, when localizing strings the length of translated strings will vary from language to language so it is recommended that you should leave 30 percent additional room for text expansion.&nbsp; This is a general rule which works most of the time.&nbsp; The exception to the rule is when using strings containing less than 10 characters like &ldquo;OK&rdquo; on a button.&nbsp; If you add 30% you only get one character which might not be enough when translated so if the string is less than 10 characters the general rule is to leave an additional 400%.&nbsp; Since these are general rules, you will need to test your application on target platforms and modify the application as needed.</p>
<p>&nbsp;Suggested readings</p>
<p><a href="https://www.microsoft.com/learning/en/us/book.aspx?ID=5717&amp;locale=en-us">Developing International Software, Second Edition</a></p>
<p><strong>Technical Writer: Prabhat Tandon</strong></p>
<p><strong>Technical Reviewer: Marc RodMan</strong></p>]]></content:encoded>
    </item>
    <item>
      <title>Why we shouldn’t use the pre-build event to change the assembly version of a WPF project</title>
      <link>https://docs.microsoft.com/archive/blogs/dsui/why-we-shouldnt-use-the-pre-build-event-to-change-the-assembly-version-of-a-wpf-project</link>
      <pubDate>Wed, 18 Apr 2012 10:10:22 GMT</pubDate>
      <dc:creator><![CDATA[Nitish Nagpal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dsui/2012/04/18/why-we-shouldnt-use-the-pre-build-event-to-change-the-assembly-version-of-a-wpf-project/</guid>
      <description><![CDATA[Recently, I was working on a support incident where customer was changing the AssemblyVersion&nbsp;...]]></description>
      <content:encoded><![CDATA[<p>Recently, I was working on a support incident where customer was changing the AssemblyVersion&nbsp; in the AssemblyInfo.cs file through a pre-build event. Even if we don&rsquo;t change anything in the project, the build was getting fired and version number was changing.</p>
<p>&nbsp;How does a WPF project build differ?</p>
<p>&nbsp;XAML differs from most other types of applications in that its build workflow produces a two-part result with dependencies in both directions.&nbsp;&nbsp;</p>
<p>&nbsp;(a) Normal assemblies built from the C#/VB code, and</p>
<p>(b) BAML built from the XAML markup.&nbsp;&nbsp;</p>
<p>&nbsp;The code refers to the markup in obvious ways, and the BAML stream refers to the code any place where the markup refers to a type declared in your code.&nbsp;&nbsp;&nbsp; There are checks at build time and at runtime to ensure the two pieces are consistent &ndash; the version number is part of those checks.&nbsp;&nbsp;</p>
<p>&nbsp;Here is the link which describes <a href="https://msdn.microsoft.com/en-us/library/aa970678.aspx">Building a WPF Application (WPF)</a></p>
<p>&nbsp;If you change the version number through the pre-build event, the build-time check detects the inconsistency and rebuilds the piece that&rsquo;s perceived to be out of date. In such a case, the task Markup Compilation Pass1 kicks-in.</p>
<p>&nbsp;This is by design.&nbsp; It would happen in any type of application that had a similar two-part interdependent build product.</p>
<p>&nbsp;Here are the guidelines <a href="https://blogs.msdn.com/b/suzcook/archive/2003/05/29/57148.aspx">When to Change File/Assembly Versions</a> from the general .Net Framework perspective.</p>
<p>&nbsp;It&rsquo;s worth to have a look at <a href="https://blogs.msdn.com/b/jjameson/archive/2009/04/03/best-practices-for-net-assembly-versioning.aspx">Best Practices for .NET Assembly Versioning</a> to decide the versioning strategy and then <a href="https://blogs.msdn.com/b/jjameson/archive/2010/03/25/incrementing-the-assembly-version-for-each-build.aspx">Incrementing the Assembly Version for Each Build</a> if needed.</p>
<p>Content developed by: Prabhat Tandon<br />Content reviewed by:&nbsp;Trevor Fellman&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>How to display controls above WebBrowserControl in Silverlight</title>
      <link>https://docs.microsoft.com/archive/blogs/dsui/how-to-display-controls-above-webbrowsercontrol-in-silverlight</link>
      <pubDate>Thu, 12 Apr 2012 03:49:00 GMT</pubDate>
      <dc:creator><![CDATA[Nitish Nagpal]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dsui/2012/04/12/how-to-display-controls-above-webbrowsercontrol-in-silverlight/</guid>
      <description><![CDATA[Having problems when trying to render other controls over the WebBrowser control in Silverlight?...]]></description>
      <content:encoded><![CDATA[<p>Having problems when trying to render other controls over the WebBrowser control in Silverlight? You&rsquo;re at the right place.</p>
<p>With the release of Silverlight 4.0, the WebBrowser control was introduced. But, it was designed only to be used in an &lsquo;Out Of Browser&rsquo; application. However, with the release of Silverlight 5, the control can also be used in an &lsquo;In-browser&rdquo; trusted application.</p>
<p>While there are a lot of discussions around rendering controls over the &ldquo;WebBrowser&rdquo; control in Silverlight, successful solutions to this problem have been difficult to come by. I did my research while trying to resolve this problem for one of my customers and found a solution! But before I share the solution, let me give you a background to the problem.</p>
<p>Since the introduction of the WebBrowser control in Silverlight, many developers have been using it to display HTML content inside the application. But, the major limitation is the &ldquo;Airspace&rdquo; issue.</p>
<p>So, what is &ldquo;Airspace&rdquo;?</p>
<p>In an application window each pixel within the windows belongs to exactly only one HWND, which constitutes the airspace for that HWND. The HWND can render only on those pixels which belongs to it.</p>
<p>In a typical Silverlight OOB application, there will be only one Silverlight-HWND. So, the entire pixels in the Silverlight application belong to this HWND and that constitutes the airspace for that.</p>
<p></p>
<p></p>
<p>But, in our scenario when we introduce a WebBrowser control in our Silverlight OOB application, the Airspace is shared by the HWND of the WebBrowser control. And that is knows as Airspace issue.</p>
<p>The pixels on which the WebBrowser control resides will belong to the WebBrowser-HWND. So, Silverlight will not be able to render anything on the pixel which belongs to other HWND.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/4188.s2.png" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/4188.s2.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/4188.s2.png" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/4188.s2.png" /></a></p>
<p></p>
<p>But, why does WebBrowser control create its own HWND unlike other Silverlight controls?</p>
<p>This is because; the WebBrowser control available in Silverlight is a wrapper around the &ldquo;System.Windows.Controls.WebBrowser&rdquo; control. The other Silverlight control will not create a new window for itself; rather it will be created under a single HWND. The WebBrowser control is not a real Silverlight control, but a wrapper around Windows HTML control.&nbsp; These native controls will create their own HWND.</p>
<p>Because of this, the WebBrowser control always overlaps other controls within the application. For example, when the page with the fixed header and scroll functionality are being used or when the WebBrowser control is placed under a menu control. There could be other instances.</p>
<p><b>Solution to the issue:</b></p>
<p>By using the &ldquo;WebBrowserBrush&rdquo;, we can overcome this problem.</p>
<p>The WebBrowserBrush was introduced with the WebBrowser control, and they are designed to work together to display rich HTML content.</p>
<p>WebBrowserBrush is a type of Brush object which paints an area with HTML content. This HTML content is provided by a WebBrowser control. Just like the other brush types, you can use a WebBrowserBrush to fill a rectangle, geometry contents of path and much more.</p>
<p>So, how is this brush going to help us resolve this problem? &nbsp;</p>
<p>To overcome this problem, you can hide the WebBrowser and use a WebBrowserBrush to paint the area with HTML content from the WebBrowser. The WebBrowserBrush will paint the HTML content in the same layer as other control, and will allow other controls to be displayed above it. We can show the WebBrowser control when it is needed. The only thing which we need to consider is to find an appropriate event to handle this logic.</p>
<p><b>Sample implementation:</b></p>
<p>In the sample application below, I want my combobox list to render above the WebBrowser when open. I have used the ComboBox_DropDownChanged event to handle the logic. When the list is open, I hide the WebBrowser control and paint the area with the WebBrowserBrush. I then bring the control back when the list is closed.</p>
<p><b>&nbsp;</b></p>
<pre>- XAML code snippet -</pre>
<pre>&nbsp;</pre>
<pre>&lt;UserControl x:Class="SilverlightApplication1_WebBrowser.MainPage"</pre>
<pre>&nbsp;&nbsp;&nbsp; xmlns="schemas.microsoft.com/winfx/2006/xaml/presentation"</pre>
<pre>&nbsp;&nbsp;&nbsp; xmlns:x="schemas.microsoft.com/winfx/2006/xaml"</pre>
<pre>&nbsp;&nbsp;&nbsp; xmlns:d="schemas.microsoft.com/expression/blend/2008"</pre>
<pre>&nbsp;&nbsp;&nbsp; xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"&gt;</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp; &lt;Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch"&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Grid HorizontalAlignment="Stretch"&nbsp; VerticalAlignment="Stretch"&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Grid.RowDefinitions&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;RowDefinition Height="50" /&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;RowDefinition Height="50" /&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;RowDefinition Height="Auto" /&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Grid.RowDefinitions&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Grid.ColumnDefinitions&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ColumnDefinition Width="*"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ColumnDefinition Width="50"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Grid.ColumnDefinitions&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBox Canvas.ZIndex="10" Grid.Row="0" x:Name="cbTestList"</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DropDownOpened="cbTestList_DropDownOpened" DropDownClosed="cbTestList_DropDownClosed" &gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBox.Items&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="-- Select --" IsSelected="True"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text1"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ComboBoxItem Content="Text2"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text3"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text4"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text5"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text6"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text7"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text8"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text9"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text10"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text11"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text12"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text13"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text14"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ComboBoxItem Content="Text15"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ComboBox.Items&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ComboBox&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;WebBrowser x:Name="wb" Height="500" Width="800" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Canvas.ZIndex="0" HorizontalAlignment="Stretch" </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VerticalAlignment="Stretch" /&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TextBox x:Name="txtUrl" Margin="10" Grid.Row="1" Grid.Column="0"</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;Canvas.ZIndex="10"/&gt;</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Button Grid.Column="1" Grid.Row="1" Margin="10" Canvas.ZIndex="10" Content="Go" </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name="btnLoadContent" Click="btnLoadContent_Click" /&gt;</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Rectangle Grid.Column="0" Height="500" Width="800" Grid.ColumnSpan="2" Grid.Row="2" </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HorizontalAlignment="Stretch" </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VerticalAlignment="Stretch"&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Rectangle.Fill&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;WebBrowserBrush SourceName="wb" x:Name="WBB1"/&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Rectangle.Fill&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Rectangle&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Grid&gt;</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Canvas&gt;</pre>
<pre>&nbsp;&nbsp;&nbsp; &lt;/Grid&gt;</pre>
<pre>&lt;/UserControl&gt;</pre>
<pre>&nbsp;</pre>
<pre>- end -</pre>
<p>&nbsp;</p>
<pre>- C# code snippet -</pre>
<pre>&nbsp;</pre>
<pre>public partial class MainPage : UserControl</pre>
<pre>&nbsp;&nbsp;&nbsp; {</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bool _toggle;</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public MainPage()</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InitializeComponent();</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _toggle = true;</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txtUrl.Text = "www.bing.com";</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wb.Navigate(new Uri(txtUrl.Text, UriKind.Absolute));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void btnLoadContent_Click(object sender, RoutedEventArgs e)</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wb.Navigate(new Uri(txtUrl.Text, UriKind.Absolute));</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void cbTestList_DropDownOpened(object sender, EventArgs e)</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ChangeWebBrowserVisibility();</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void ChangeWebBrowserVisibility()</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (_toggle)</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WBB1.Redraw();</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wb.Visibility = System.Windows.Visibility.Collapsed;</pre>
<pre>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wb.Visibility = System.Windows.Visibility.Visible;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _toggle = !_toggle;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</pre>
<pre>&nbsp;</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void cbTestList_DropDownClosed(object sender, EventArgs e)</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ChangeWebBrowserVisibility();</pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</pre>
<pre>&nbsp;&nbsp;&nbsp; }</pre>
<pre>&nbsp;</pre>
<pre>- end -</pre>
<p>&nbsp;</p>
<p><b>Screen shot from Sample application.</b></p>
<p></p>
<p><b>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/5557.s3.png" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/5557.s3.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/5557.s3.png" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/5557.s3.png" /></a></b></p>
<p><b>Limitations:</b></p>
<p>Though we are able to overcome the problem using a WebBrowserBrush along with the WebBrowser control, we still have a couple of limitations which we need to consider.</p>
<ol>
<li>The user cannot interact with the WebBrowserBrush.</li>
<li>The changes in the WebBrowser control will not reflect automatically unless redrawn.</li>
</ol>
<p><b>&nbsp;Conclusion:</b></p>
<p>This is a simple workaround to the problem and it will work if designed properly, considering the limitation we have.</p>
<p>Happy Coding!</p>
<p>Content developed by: Shiva N Shankar<br />Content reviewed by:&nbsp;Trevor Fellman&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>How to integrate Silverlight Webpart with Sharepoint 2010</title>
      <link>https://docs.microsoft.com/archive/blogs/dsui/how-to-integrate-silverlight-webpart-with-sharepoint-2010</link>
      <pubDate>Mon, 16 May 2011 08:01:07 GMT</pubDate>
      <dc:creator><![CDATA[schalke1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dsui/2011/05/16/how-to-integrate-silverlight-webpart-with-sharepoint-2010/</guid>
      <description><![CDATA[What brings Silverlight and SharePoint together?

Users are expecting rich, compelling...]]></description>
      <content:encoded><![CDATA[<p><span style="text-decoration: underline;">What brings Silverlight and SharePoint together?</span></p>
<ul>
<li>Users are expecting rich, compelling interfaces</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Silverlight is a perfect technology to create Web 2.0 applications in SharePoint</p>
<ul>
<li>Limit page post backs</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Silverlight applications do their processing on the client, eliminating page post backs.</p>
<ul>
<li>Silverlight applications offload processing to the client</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Processing on the client reduces the load on the SharePoint server farm.</p>
<ul>
<li>Silverlight isolates processing on the client</li>
<li>Separation of design and code</li>
</ul>
<p>You can use the MVVM pattern to separate the presentation from the processing later.&nbsp; This makes it easy to change the look and feel of Silverlight applications.</p>
<ul>
<li>Common .NET development techniques</li>
</ul>
<p>Silverlight applications are based on the .NET framework which makes it easy for .NET developers to create them.&nbsp; The client object model may be used to access SharePoint resources from a Silverlight application.</p>
<ul>
<li>Overcome Sandbox limitations</li>
</ul>
<p>Silverlight applications may be used to overcome sandboxed limitations such as the ability to call an external service, or use parts of the .NET framework which are not permitted to run in a sandboxed solution.</p>
<ul>
<li>Ease of deployment</li>
</ul>
<p>Silverlight applications are very easy to deploy.&nbsp; Anyone with the ability to upload a document to a document library can deploy a Silverlight application to a SharePoint site.&nbsp; Additionally, the Silverlight Web Part makes it very easy to place Silverlight applications on SharePoint web pages.</p>
<p>&nbsp;</p>
<p><b><span style="text-decoration: underline;">Let&rsquo;s see a simple project that helps us to understand how to use Silverlight along-with SharePoint</span></b>.</p>
<p>A Silverlight application can be hosted inside a SharePoint site and it is called as a Silverlight WebPart.</p>
<p>Prerequisites:-</p>
<p><a href="https://www.microsoft.com/downloads/en/details.aspx?FamilyID=49c79a8a-4612-4e7d-a0b4-3bb429b46595&amp;displaylang=en">Microsoft SharePoint Foundation 2010</a> </p>
<p><span style="text-decoration: underline;">Here are some steps to upload a Silverlight XAP to the SharePoint site:-</span></p>
<p>1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In Visual Studio 2010, Go to File menu -&gt; New &nbsp;-&gt; Project -&gt; under Installed Templates -&gt; select Visual C# -&gt; under SharePoint section-&gt; 2010 -&gt; select EMPTY SHAREPOINT PROJECT.</p>
<p>2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For example,in this case , lets name our SharePoint project as &ldquo;SharePointSilverlightProjectBlog&rdquo; .</p>
<p>3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Then you will be asked for the URL of your SharePoint site. Enter the URL and Select the &ldquo;Deploy as sandboxed solution&rdquo; option in the dialog and click Finish.</p>
<p>&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/4101.Image1.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/4101.Image1.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/4101.Image1.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/4101.Image1.bmp" border="0" /></a></p>
<p>4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hence, you can see the project created as in the Solution explorer of Visual Studio 2010 </p>
<p>&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/3324.Image2.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/3324.Image2.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/3324.Image2.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/3324.Image2.bmp" border="0" /></a></p>
<p>5)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Since our goal is to integrate Silverlight within SharePoint , lets add a Silverlight application without a website hosting it. Let&rsquo;s name our Silverlight application/project&nbsp; as &ldquo;SilverlightWebpart&rdquo;. Then our solution looks as following :-</p>
<p>&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/6318.Image3.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/6318.Image3.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/6318.Image3.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/6318.Image3.bmp" border="0" /></a></p>
<p>&nbsp;</p>
<p>6)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Let&rsquo;s add the following code to &ldquo;MainPage.xaml&rdquo;&nbsp; file in the Silverlight project :-</p>
<p><i>&lt;UserControl x:Class="SilverlightWebpart.MainPage"</i></p>
<p><i>&nbsp;&nbsp;&nbsp; xmlns="schemas.microsoft.com/winfx/2006/xaml/presentation"</i></p>
<p><i>&nbsp;&nbsp;&nbsp; xmlns:x="schemas.microsoft.com/winfx/2006/xaml"</i></p>
<p><i>&nbsp;&nbsp;&nbsp; xmlns:d="schemas.microsoft.com/expression/blend/2008"</i></p>
<p><i>&nbsp;&nbsp;&nbsp; xmlns:mc="schemas.openxmlformats.org/markup-compatibility/2006"</i></p>
<p><i>&nbsp;&nbsp;&nbsp; mc:Ignorable="d"</i></p>
<p><i>&nbsp;&nbsp;&nbsp; d:DesignHeight="300" d:DesignWidth="400"&gt;</i></p>
<p><i>&nbsp;</i></p>
<p><i>&nbsp;&nbsp;&nbsp; &lt;Grid x:Name="LayoutRoot" Background="White"&gt;</i></p>
<p><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Button Name="btnClk" Height="20" Width="50" Content="Click !!" Click="btnClk_Click"&gt;&lt;/Button&gt;</i></p>
<p><i>&nbsp;&nbsp;&nbsp; &lt;/Grid&gt;</i></p>
<p><i>&lt;/UserControl&gt;</i></p>
<p>&nbsp;</p>
<p>7)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Also add the following code to &ldquo;MainPage.xaml.cs&rdquo; file :-</p>
<p><i>using System;</i></p>
<p><i>using System.Collections.Generic;</i></p>
<p><i>using System.Linq;</i></p>
<p><i>using System.Net;</i></p>
<p><i>using System.Windows;</i></p>
<p><i>using System.Windows.Controls;</i></p>
<p><i>using System.Windows.Documents;</i></p>
<p><i>using System.Windows.Input;</i></p>
<p><i>using System.Windows.Media;</i></p>
<p><i>using System.Windows.Media.Animation;</i></p>
<p><i>using System.Windows.Shapes;</i></p>
<p><i>&nbsp;</i></p>
<p><i>namespace SilverlightWebpart</i></p>
<p><i>{</i></p>
<p><i>&nbsp;&nbsp;&nbsp; public partial class MainPage : UserControl</i></p>
<p><i>&nbsp;&nbsp;&nbsp; {</i></p>
<p><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public MainPage()</i></p>
<p><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</i></p>
<p><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InitializeComponent();</i></p>
<p><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</i></p>
<p><i>&nbsp;</i></p>
<p><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void btnClk_Click(object sender, RoutedEventArgs e)</i></p>
<p><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</i></p>
<p><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox.Show("Hello from Silverlight within SharePoint !!");</i></p>
<p><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</i></p>
<p><i>&nbsp;</i></p>
<p><i>&nbsp;&nbsp;&nbsp; }</i></p>
<p><i>}</i></p>
<p>&nbsp;</p>
<p>8)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Lets just SAVE ALL for now (and not Build).</p>
<p>9)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Now, Add a Module to the SharePoint site. Right click the &ldquo;SharePointSilverlightProjectBlog&rdquo; SharePoint project and go to ADD NEW ITEM and in the dialog Select &ldquo;Module &rdquo; under installed templates for SharePoint -&gt; 2010 .</p>
<p>10)&nbsp;&nbsp; Name the Module as &ldquo;DemoModule&rdquo;.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/2538.Image4.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/2538.Image4.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/2538.Image4.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/2538.Image4.bmp" border="0" /></a></p>
<p>11)&nbsp;&nbsp; After we add the Module it would contain two files under it by default:-</p>
<p>&nbsp;</p>
<p>a)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Elements.xml</p>
<p>b)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sample.txt</p>
<p>&nbsp;</p>
<p>12)&nbsp;&nbsp; It&rsquo;s ok if you delete the Sample.txt file.</p>
<p>13)&nbsp;&nbsp; Again lets do SAVE ALL .</p>
<p>14)&nbsp;&nbsp; Let&rsquo;s jump to our Silverlight project &ldquo;SilverlightWebpart&rdquo; and right click it in the solution explorer window and select Properties.</p>
<p>15)&nbsp;&nbsp; Go to the &ldquo;Build Events&rdquo; tab and click the &ldquo;Edit Post-build&hellip;&rdquo; button and enter the following line in the dialog that appears :-</p>
<p><i>copy &ldquo;$(TargetDir)SilverlightWebpart.xap&rdquo; &ldquo;$(SolutionDir)SharePointSilverlightProjectBlog\DemoModule" </i></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/1385.Image5.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/1385.Image5.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/1385.Image5.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/1385.Image5.bmp" border="0" /></a></p>
<p>16)&nbsp;&nbsp; Click OK and Save it.</p>
<p>17)&nbsp;&nbsp; Adding the above content in the post-build events ensures that the visual studio adds the latest build of the XAP file generated from the &ldquo;SilverlightWebpart&rdquo; application to the &ldquo;DemoModule&rdquo; section of the &ldquo;SharePointSilverlightProjectBlog&rdquo; project.</p>
<p>18)&nbsp;&nbsp; So now if we build the Silverlight project, we would find the &ldquo;SilverlightWebpart.xap&rdquo; file under the &ldquo;DemoModule&rdquo;.</p>
<p>19)&nbsp;&nbsp; Make sure the XAP file is included in the Module as following :-</p>
<p>&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/5531.Image6.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/5531.Image6.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/5531.Image6.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/5531.Image6.bmp" border="0" /></a></p>
<p>20)&nbsp;&nbsp; Now lets build the entire solution and then try to deploy the &ldquo;SharePointSilverlightProjectBlog&rdquo; project to the SharePoint site.</p>
<p>21)&nbsp;&nbsp; To achieve this, right-click the &ldquo;SharePointSilverlightProjectBlog&rdquo; project and click &ldquo;Deploy&rdquo;</p>
<p>22)&nbsp;&nbsp; Now the &ldquo;SharePointSilverlightProjectBlog&rdquo; project is deployed in the SharePoint site.</p>
<p>&nbsp;23)&nbsp;&nbsp; Let&rsquo;s open the SharePoint site in the browser and select&nbsp; &ldquo;Page </p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/7411.Image7.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/7411.Image7.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/7411.Image7.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/7411.Image7.bmp" border="0" /></a></p>
<p>24)&nbsp;&nbsp; Select Edit.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/1121.Image8.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/1121.Image8.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/1121.Image8.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/1121.Image8.bmp" border="0" /></a></p>
<p>25)&nbsp;&nbsp; Having done that Select &ldquo;Insert&rdquo; tab and click &ldquo;Web Part&rdquo; . </p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/7635.Image9.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/7635.Image9.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/7635.Image9.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/7635.Image9.bmp" border="0" /></a></p>
<p>26)&nbsp;&nbsp; In &ldquo;Categories&rdquo;, select &ldquo;Media and content&rdquo;&nbsp; and correspondingly in &ldquo;Web Parts&rdquo; column, Select &ldquo;Silverlight Web Part&rdquo; Having Selected the &ldquo;Silverlight Web Part&rdquo; , click on &ldquo;Add&rdquo; button that appears on the right side.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/6521.Image10.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/6521.Image10.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/6521.Image10.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/6521.Image10.bmp" border="0" /></a></p>
<p>&nbsp;</p>
<p>27)&nbsp;&nbsp; After clicking add, a small pop-up will appear asking for the URL of the Silverligth content(.xap) file. Enter the URL in the following format as :0</p>
<p><a href="mysharepointsite/DemoModule/SilverlightWebpart.xap"><i>MySharePointSite/DemoModule/SilverlightWebpart.xap</i></a><i>&nbsp;</i></p>
<p><i>&nbsp;</i></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/8154.Image11.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/8154.Image11.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/8154.Image11.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/8154.Image11.bmp" border="0" /></a></p>
<p>28)&nbsp;&nbsp; Then click OK and then you can see you Silverlight web part appear in the SharePoint site as :</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/4214.Image12.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/4214.Image12.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/4214.Image12.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/4214.Image12.bmp" border="0" /></a></p>
<p>29)&nbsp;&nbsp; As you cans ee the blue border is the boundary of the Silverlight web part and the Silverlight application has a button in it. When you click the button, it acts like a normal Silverlight application and responds to the user interaction and a Message Box is popped, for which we wrote code in &ldquo;MainPage.xaml.cs&rdquo;.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/0407.Image13.bmp" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/0407.Image13.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/26/93/0407.Image13.bmp" original-url="blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-26-93/0407.Image13.bmp" border="0" /></a></p>
<p>&nbsp;</p>
<h1>Content By - Sagar Joshi</h1>]]></content:encoded>
    </item>
    <item>
      <title>Launching WPF application using CLR hosting from C++ application</title>
      <link>https://docs.microsoft.com/archive/blogs/dsui/launching-wpf-application-using-clr-hosting-from-c-application</link>
      <pubDate>Thu, 19 Aug 2010 10:36:00 GMT</pubDate>
      <dc:creator><![CDATA[schalke1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dsui/2010/08/19/launching-wpf-application-using-clr-hosting-from-c-application/</guid>
      <description><![CDATA[Recently, I was working with one of my developer customers.&nbsp;Customer's&nbsp;objective was to...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Recently, I was working with one of my developer customers.&nbsp;Customer's&nbsp;objective was to launch a WPF application from a C++ console based application.&nbsp; </span><span style="color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">To <span style="line-height: 115%; font-family: 'Calibri','sans-serif'; color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: HI;">achieve </span>the same the customer&nbsp;was using CLRHosting and launching WPF application by calling ExecuteInDefaultAppDomain method. &nbsp;</span><span style="color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">&nbsp;<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">The customer developed the application, but when he tried to execute it,&nbsp;C++ application&nbsp;failed with a&nbsp;first chance exception on ExecuteInDefaultAppDomain and WPF application which prevented it from getting launched.</span><span style="color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Here is the code used for CLR hosting and launching a method in assembly (WPF) by calling ExecuteInDefaultAppDomain.&nbsp; </span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"></span><span style="color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">int main(int argc, _TCHAR* argv[])</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">{</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; // Bind to the runtime.</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; ICLRRuntimeHost *pClrHost = NULL;</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; HRESULT hrCorBind = CorBindToRuntimeEx(</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL,&nbsp;&nbsp; // Load the latest CLR version available</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; L"wks", // Workstation GC ("wks" or "svr" overrides)</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // No flags needed</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CLSID_CLRRuntimeHost,</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IID_ICLRRuntimeHost,</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (PVOID*)&amp;pClrHost);</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; // Construct our host control object.</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; DHHostControl *pHostControl = new DHHostControl(pClrHost);</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; </span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; // Notify the CLR that this host implements hosting managers.</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; pClrHost-&gt;SetHostControl(pHostControl);</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;</span><span style="line-height: 125%; font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; // Now, start the CLR.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; HRESULT hrStart = pClrHost-&gt;Start();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #333333; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; // Load an assembly and execute a method in it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp; HRESULT hrExecute = pClrHost-&gt;ExecuteInDefaultAppDomain(<o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwzAssemblyPath, pwzAssemblyName,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pwzMethodName, pwzMethodArgs,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;retVal);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="line-height: 125%; font-family: 'Courier New'; color: #003366; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">pwzMethodName in the code above, is the method defined in WPF application, the purpose of this method in WPF application is to launch the WPF application itself by calling Main method while pwzAssemblyName is the name of WPF application.</span><span style="color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">The code snippet is part of following MSDN article which talks about CLR hosting:</span><span style="color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><a href="https://msdn.microsoft.com/en-us/magazine/cc163567.aspx"><span style="font-family: 'Calibri','sans-serif'; color: #003366;">msdn.microsoft.com/en-us/magazine/cc163567.aspx</span></a></span><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"> </span><span style="color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><b><i><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Please note that code above can be used to launch a method from any assembly and is not specific to WPF.</span></i></b><span style="color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Running the code outside the debugger gave the following error-</span><span style="color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #003366; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">System.Windows.Markup.XamlParseException: Cannot create instance of 'Window1' defined in assembly WpfApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation.&nbsp; Error in markup file 'Window1.xaml' Line 1 Position 9. ---&gt; System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.InvalidOperationException: <b><span style="background: yellow; mso-highlight: yellow;">The calling thread must be STA, because many UI components require this.</span></b></span><span style="color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><o:p></o:p></span></span></p>
<p class="MsoNormal"><b><span style="color: #002060; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">As the message clearly indicates that calling thread needs to be STA and it's known that WPF is also STA. taking the clue I used following line of code to make the C++ console based application STA.<o:p></o:p></span></span></b></p>
<p class="MsoNormal"><b><span style="color: #002060; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Courier New'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);<o:p></o:p></span></span></b></p>
<p class="MsoNormal"><b><span style="color: #002060; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-bidi-language: HI; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Adding the above line of code did the trick and the WPF application launched fine!<o:p></o:p></span></span></b></p>
<p class="MsoNormal"><span style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-family: 'Arial Black','sans-serif'; color: #002060; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-ansi-language: EN-IN; mso-bidi-language: HI;">Content By &ndash; Sumit Gupta</span><span style="font-family: 'Arial','sans-serif'; color: #002060; font-size: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-language: HI;"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></p>]]></content:encoded>
    </item>
    <item>
      <title>Issues using Response.Redirect in Silverlight</title>
      <link>https://docs.microsoft.com/archive/blogs/dsui/issues-using-response-redirect-in-silverlight</link>
      <pubDate>Thu, 12 Aug 2010 10:20:00 GMT</pubDate>
      <dc:creator><![CDATA[schalke1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dsui/2010/08/12/issues-using-response-redirect-in-silverlight/</guid>
      <description><![CDATA[I was working with one of customer's today, on a Silverlight application. The customer wanted to...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;"><span style="font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: HI;">
<p><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">I was working with one of customer's today, on a Silverlight application. The customer wanted to make the browser redirect the client to a different URL. As in the current scenario the re-direction was to be made to an internal Silverlight Page within the application we had to use something like-</span><o:p></o:p><span></span></p>
<span></span><span></span></span></span></p>
<p><span><span><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"></span></span><span><span><span style="font-size: small;">Response.Redirect(</span><a href="localhost:49527/SilverlightApplication2TestPage.aspx#/About"></a><span><span style="color: #000000;"><span style="font-size: small;">);<o:p></o:p></span></span></span></span><span style="color: #002060;"><span><span style="font-size: small;">localhost/SilverlightSampleTestPage.aspx#/About</span></span></span></span></span>
<p><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">In the above example we are trying to redirect to About page.<o:p></o:p></span></span></p>
<p><span style="font-size: small;"><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">The application worked liked a charm until it was noticed that when&nbsp;redirected to the About page, the About page would get loaded twice. In order to confirm the same, we used Fiddler which helped us confirm the behavior. </span><o:p></o:p><span></span></span></p>
<span></span><span></span>
<p><span style="font-size: small;"><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">On further investigation&nbsp;it was&nbsp;found that </span><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Response.Redirect causes the browser to do a fresh navigation rather than fragment navigation. Due to this Internet Explorer demands for a new copy of the file and hence loads it twice. This is by design. </span><o:p></o:p></span></p>
<p><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">As the behavior cannot be changed, the following workaround can be used-<o:p></o:p></span></span></p>
<p><span style="font-size: small;"><span style="font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;">1)<span style="line-height: normal; font-variant: normal; font-style: normal; font-family: 'Times New Roman'; font-weight: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Create an initialization parameter, for example initparam.</span><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><o:p></o:p></span></span></p>
<p><span style="font-size: small;"><span style="font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;">2)<span style="line-height: normal; font-variant: normal; font-style: normal; font-family: 'Times New Roman'; font-weight: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Assign the page name to which the re-direction is required, to the value attribute, example </span><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: 'Courier New'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-no-proof: yes;">value="link=/About"</span><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><o:p></o:p></span></span></p>
<p><span style="font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-size: small;">3)<span style="line-height: normal; font-variant: normal; font-style: normal; font-family: 'Times New Roman'; font-weight: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span><span style="font-size: small;"><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Write the following code to redirect to the new page mentioned in the value attribute<br /></span><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: 'Courier New'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-no-proof: yes;">Application.Current.Host.NavigationState = App.Current.Resources["link"].ToString();</span><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;"><o:p></o:p></span></span></p>
<p><span style="font-size: small;"><span style="font-family: 'Calibri','sans-serif'; color: #1f497d; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;">4)<span style="line-height: normal; font-variant: normal; font-style: normal; font-family: 'Times New Roman'; font-weight: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 'Calibri','sans-serif'; color: #002060; mso-bidi-font-family: Arial; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">This will help us, get the same results as Response.Rediect without the issue of the page loading twice.<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="line-height: 115%; color: #002060; font-size: 12pt;"><o:p><span style="font-size: small;">&nbsp;</span></o:p></span></p>
</p>
<p><span lang="EN-IN" style="font-family: 'Arial Black', 'sans-serif'; font-size: 12pt;">Content By &ndash; Sandeep Chalke</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Using Silverlight to upload more than 8KB of data from a WCF Service</title>
      <link>https://docs.microsoft.com/archive/blogs/dsui/using-silverlight-to-upload-more-than-8kb-of-data-from-a-wcf-service</link>
      <pubDate>Tue, 01 Jun 2010 12:34:00 GMT</pubDate>
      <dc:creator><![CDATA[schalke1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dsui/2010/06/01/using-silverlight-to-upload-more-than-8kb-of-data-from-a-wcf-service/</guid>
      <description><![CDATA[Recently, I encountered an issue where one of my customer was trying to upload more than 8KB (8192...]]></description>
      <content:encoded><![CDATA[<p><span style="color: #003366;">Recently, I encountered an issue where one of my customer was trying to upload more than 8KB (8192 characters) of data from a WCF Service which was consumed by a Silverlight client. The Silverlight application would work fine, till the data upload was limited to 8192 characters, but just increasing it to 8193 characters would throw the following error-</span></p>
<p><strong><span style="color: #003366;">"An exception occurred during the operation, making the result invalid. Check the InnerException for exception details." </span></strong></p>
<p><span style="color: #003366;">If we step through the code the InnerException looks like the following-</span></p>
<p><strong><span style="color: #003366;">System.ServiceModel.CommunicationException was unhandled by user code<br />&nbsp; Message=The remote server returned an error: NotFound.<br />&nbsp; StackTrace:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at WCFTest.ServiceReference.TestServiceClient.TestServiceClientChannel.EndDoWork(IAsyncResult result)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at WCFTest.ServiceReference.TestServiceClient.WCFTest.ServiceReference.ITestService.EndDoWork(IAsyncResult result)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at WCFTest.ServiceReference.TestServiceClient.OnEndDoWork(IAsyncResult result)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)<br />&nbsp; InnerException: System.Net.WebException<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message=The remote server returned an error: NotFound.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StackTrace:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InnerException: System.Net.WebException<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message=The remote server returned an error: NotFound.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StackTrace:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.Net.Browser.BrowserHttpWebRequest.&lt;&gt;c__DisplayClass5.&lt;EndGetResponse&gt;b__4(Object sendState)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at System.Net.Browser.AsyncHelper.&lt;&gt;c__DisplayClass2.&lt;BeginOnUI&gt;b__0(Object sendState)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InnerException: </span></strong></p>
<p><span style="color: #003366;">I found many posts which gave solution to the issue and said following those would help one upload more than 8KB of data, but none seemed to help. One, thing was clear, the solution had to do with changing the WCF Service configuration. </span></p>
<p><span style="color: #003366;">On doing much of research, I got a the correct solution, which is as follows- </span></p>
<p><span style="color: #003366;">A) In the Visual Studio open the solution which exhibits the issue. For now let&rsquo;s call it WCFTest. </span></p>
<p><span style="color: #003366;">B) Go to Tools -&gt; WCF Service Configuration Editor. </span></p>
<p><span style="color: #003366;">C) Click File -&gt; Open and browser to the Web.Config for the WCFTest.Web project. </span></p>
<p><span style="color: #003366;">D) Select Bindings -&gt; New Binding Configuration. </span></p>
<p><span style="color: #003366;">E) Select basicHttpBinding and give a name for example - LargeBinding. </span></p>
<p><span style="color: #003366;">F) Select LargeBinding under Bindings and change MaxBufferPoolSize, MaxBufferSize, MaxReceivedMessageSize, MaxArrayLenght, MaxBytesPerRead to 2147483647. </span></p>
<p><span style="color: #003366;">G) Select Services -&gt; WCFTest.Web.TestService -&gt; Endpoints -&gt; Select the binding which is used to bind the WCF Service, by default. In this case, let's assume it to be TestBinding. Change the BindingConfiguration to LargeBinding. </span></p>
<p><span style="color: #003366;">H) Save the Web.Config. </span></p>
<p><span style="color: #003366;">I) Open the ServiceReference.ClientConfig file in&nbsp; WCF Service Configuration Editor. </span></p>
<p><span style="color: #003366;">J) Go to Bindings -&gt; TestBinding (basicHTTPBinding) and change the MaxBufferSize and MaxReceivedMessageSize to 2147483647. </span></p>
<p><span style="color: #003366;">K) Save the ServiceReference.ClientConfig file and exit out of WCF Service Configuration Editor. </span></p>
<p><span style="color: #003366;">L) Build the solution and now the WCF Service should be able to upload more than 8K of data. </span></p>
<p><span style="color: #003366;">Hope this helps!!!!</span></p>
<p><span lang="EN-IN" style="font-family: 'Arial Black', 'sans-serif'; font-size: 12pt;"><span style="color: #003366;">Content By &ndash; Sandeep Chalke</span></span></p>]]></content:encoded>
    </item>
  </channel>
</rss>