<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ferry Meidianto &#187; silverlight 3</title>
	<atom:link href="http://blog.meidianto.com/tag/silverlight-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.meidianto.com</link>
	<description>/* Living in .NET World */</description>
	<lastBuildDate>Mon, 02 Jan 2012 12:50:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<div id='fb-root'></div>
					<script type='text/javascript'>
						window.fbAsyncInit = function()
						{
							FB.init({appId: null, status: true, cookie: true, xfbml: true});
						};
						(function()
						{
							var e = document.createElement('script'); e.async = true;
							e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
							document.getElementById('fb-root').appendChild(e);
						}());
					</script>	
						<item>
		<title>&#8220;Invalid FORMATETC structure&#8221; error on control drag n drop</title>
		<link>http://blog.meidianto.com/2010/01/18/e2809cinvalid-formatetc-structuree2809d-error-on-control-drag-n-drop/</link>
		<comments>http://blog.meidianto.com/2010/01/18/e2809cinvalid-formatetc-structuree2809d-error-on-control-drag-n-drop/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 03:39:00 +0000</pubDate>
		<dc:creator>Ferry Meidianto</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[silverlight 3]]></category>
		<category><![CDATA[telerik]]></category>
		<category><![CDATA[VS2008]]></category>

		<guid isPermaLink="false">http://blog.meidianto.com/2010/01/18/e2809cinvalid-formatetc-structuree2809d-error-on-control-drag-n-drop/</guid>
		<description><![CDATA[Today when I was developing Silverlight app using Telerik RadControls, there was an error “Invalid FORMATETC stucture” prevented me to complete the drag n drop of RadControls to the XAML editor. I didn’t have any idea what was caused it because I could still drag n drop the Button control to the XAML. I thought [...]]]></description>
			<content:encoded><![CDATA[<p>Today when I was developing Silverlight app using Telerik RadControls, there was an error “Invalid FORMATETC stucture” prevented me to complete the drag n drop of RadControls to the XAML editor.</p>
<p>I didn’t have any idea what was caused it because I could still drag n drop the Button control to the XAML. I thought it was Telerik but it could be anything.</p>
<p>Then the fast way to get the answer was of course Google. </p>
<p>Oops there are may results when I searched <strong>invalid FORMATETC</strong>, that’s a good sign to get the answer. Yeah it’s not Telerik specific error but Visual Studio error. It’s caused by the reference of toolbox items were messed up.</p>
<p>The solution was simply resetting the toolbox items by right clicking the toolbox then choosing <strong>Reset Toolbox</strong>. </p>
<p>Be patient, it could take sometime to reload all toolbox items.</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.meidianto.com/2010/01/18/e2809cinvalid-formatetc-structuree2809d-error-on-control-drag-n-drop/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.meidianto.com/2010/01/18/e2809cinvalid-formatetc-structuree2809d-error-on-control-drag-n-drop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with Image.Source on Silverlight 3</title>
		<link>http://blog.meidianto.com/2009/10/13/working-with-imagesource-on-silverlight-3/</link>
		<comments>http://blog.meidianto.com/2009/10/13/working-with-imagesource-on-silverlight-3/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 02:59:00 +0000</pubDate>
		<dc:creator>Ferry Meidianto</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[silverlight 3]]></category>

		<guid isPermaLink="false">http://blog.meidianto.com/2009/10/13/working-with-imagesource-on-silverlight-3/</guid>
		<description><![CDATA[Below are some options to work with Image.Source 1. Embedded in the .xap file as Content Note that the Build Action is “Content” XAML &#60;Image x:Name=&#34;imgContent&#34; Source=&#34;/Assets/Images/2.jpg&#34; /&#62; &#160;Code (C#) imgContent.Source = new BitmapImage(new Uri(&#34;/Assets/Images/2.jpg&#34;, UriKind.Relative)); 2. Embedded in the .xap file as Resource Note that the Build Action is “Resource” &#160;XAML &#60;Image x:Name=&#34;imgResource&#34; Source=&#34;/SilverlightApplication1;component/Assets/Images/1.jpg&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Below are some options to work with Image.Source</p>
<p><strong>1. Embedded in the .xap file as <span style="text-decoration: underline">Content</span></strong></p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.meidianto.com/wp-content/uploads/2010/05/image24.png" width="212" height="177" /> </p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.meidianto.com/wp-content/uploads/2010/05/image25.png" width="211" height="164" /> </p>
<p>Note that the Build Action is “Content”</p>
<p><strong>XAML</strong></p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Image</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;imgContent&quot;</span> <span style="color: #ff0000">Source</span><span style="color: #0000ff">=&quot;/Assets/Images/2.jpg&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<p></div>
<p>&#160;<strong>Code (C#)</strong></p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">imgContent.Source = <span style="color: #0000ff">new</span> BitmapImage(<span style="color: #0000ff">new</span> Uri(<span style="color: #006080">&quot;/Assets/Images/2.jpg&quot;</span>, UriKind.Relative));</pre>
<p></div>
<p><strong>2. Embedded in the .xap file as <span style="text-decoration: underline">Resource</span></strong></p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.meidianto.com/wp-content/uploads/2010/05/image26.png" width="211" height="171" /> </p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.meidianto.com/wp-content/uploads/2010/05/image27.png" width="213" height="166" /> </p>
<p>Note that the Build Action is “Resource”</p>
<p>&#160;<strong>XAML</strong></p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Image</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;imgResource&quot;</span> <span style="color: #ff0000">Source</span><span style="color: #0000ff">=&quot;/SilverlightApplication1;component/Assets/Images/1.jpg&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<p></div>
<p>&#160;<strong>Code (C#)</strong></p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">imgResource.Source = <span style="color: #0000ff">new</span> BitmapImage(<span style="color: #0000ff">new</span> Uri(<span style="color: #006080">&quot;/SilverlightApplication1;component/Assets/Images/1.jpg&quot;</span>, UriKind.Relative));</pre>
<p></div>
<p>&#160;<strong>3. Absolute URL</strong></p>
<p>The file is stored anywhere in the internet</p>
<p><strong>XAML</strong></p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Image</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;imgAbsolute&quot;</span> <span style="color: #ff0000">Source</span><span style="color: #0000ff">=&quot;http://i3.silverlight.net/avatar/meidianto.jpg?cdn_id=10092009&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<p></div>
<p>&#160;<strong>Code (C#)</strong></p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">imgAbsolute.Source = <span style="color: #0000ff">new</span> BitmapImage(<span style="color: #0000ff">new</span> Uri(<span style="color: #006080">&quot;http://i3.silverlight.net/avatar/meidianto.jpg?cdn_id=10092009&quot;</span>, UriKind.Absolute));</pre>
<p></div>
<p>&#160;<strong>4. Stored inside the web application/website</strong></p>
<p>Note: in this example the image is stored in the same folder as the .xap file</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.meidianto.com/wp-content/uploads/2010/05/image28.png" width="214" height="194" /> </p>
<p>&#160;<strong>XAML</strong></p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Image</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;imgServer&quot;</span> <span style="color: #ff0000">Source</span><span style="color: #0000ff">=&quot;/3.jpg&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<p></div>
<p>&#160;<strong>Code (C#)</strong></p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;,courier,monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">imgServer.Source = <span style="color: #0000ff">new</span> BitmapImage(<span style="color: #0000ff">new</span> Uri(<span style="color: #006080">&quot;/3.jpg&quot;</span>, UriKind.Relative));</pre>
<p></div>
<p>&#160;<strong>5. Async Network Call</strong></p>
<p>Note: in this example the image is stored in the same folder as the .xap file as above</p>
<p><strong>Code (C#)</strong></p>
</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> LoadImage(){    WebClient client = <span style="color: #0000ff">new</span> WebClient();    client.OpenReadCompleted += <span style="color: #0000ff">new</span> OpenReadCompletedEventHandler(client_OpenReadCompleted);    client.OpenReadAsync(<span style="color: #0000ff">new</span> Uri(<span style="color: #006080">&quot;3.jpg&quot;</span>, UriKind.Relative));}

<span style="color: #0000ff">void</span> client_OpenReadCompleted(<span style="color: #0000ff">object</span> sender, OpenReadCompletedEventArgs e){    <span style="color: #0000ff">if</span> (e.Error == <span style="color: #0000ff">null</span>        &amp;&amp; e.Result != <span style="color: #0000ff">null</span>)    {        BitmapImage img = <span style="color: #0000ff">new</span> BitmapImage();        img.SetSource(e.Result);

        imgServer.Source = img;    }}
</pre>
<p></div>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.meidianto.com/2009/10/13/working-with-imagesource-on-silverlight-3/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.meidianto.com/2009/10/13/working-with-imagesource-on-silverlight-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

