<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>windows-presentation-foundation &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/windows-presentation-foundation/</link>
	<description>Feed of posts on WordPress.com tagged "windows-presentation-foundation"</description>
	<pubDate>Thu, 24 Dec 2009 01:29:39 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Windows Presentation Foundation - confused and frustrated]]></title>
<link>http://softhell.wordpress.com/2009/11/30/windows-presentation-foundation-confused-and-frustrated/</link>
<pubDate>Mon, 30 Nov 2009 02:45:21 +0000</pubDate>
<dc:creator>idevelop4food</dc:creator>
<guid>http://softhell.wordpress.com/2009/11/30/windows-presentation-foundation-confused-and-frustrated/</guid>
<description><![CDATA[While going through the design phase of our new in-house enterprise-level application, one of the to]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>While going through the design phase of our new in-house enterprise-level application, one of the topics our team touched upon is whether we should look into WPF. I think the idea was compeling and besides, it&#8217;s always nice to jump into something new. I had some time to mess around with WPF and i have to admit, the things that i don&#8217;t like about it are piling up by the hour.</p>
<p><strong>WPF roadmap</strong></p>
<p>My biggest question is whether WPF will actually replace WinForms. The lack of definite answer from Microsoft leads me to think that this is probably what&#8217;s going to happen when the framework matures. I have read a few blogs where some folks suggest otherwise. However, I just don&#8217;t see a reason why you would consider supporting WinForms when you have something much superior and flexible to offer. Aside from that, what&#8217;s stopping Microsoft from screwing a major part of their community developing in WinForms. They&#8217;ve already done it with Web Service Enhancements and its support in Visual Studio 2008. VS 2008 itself was pretty much abandoned after the first service pack release, and according to <a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=498237" target="_blank">this</a>, we can all suck a big fat one because Microsoft sees more value in getting your benjamins for new licenses of VS 2010 than actually releasing a new service pack for potentially one of the worst Visual Studio releases. (if it isn&#8217;t the worst, it&#8217;s probably up there with the shitty ones)</p>
<p><strong>Flashy design or back to WinForms?<br />
</strong></p>
<p>There is no doubt that WPF is a good enhancement to software design process. It&#8217;s a powerful framework and with power comes complexity. Unfortunately, managing that complexity comes at a significant expense. You can either screw around with the XML markup that generates trendy UI or you can get Expression Blend and screw with it, which adds another layer of complexity on its own. Your other option is, of course, to hire a good UI designer who&#8217;s not only familiar with all of the tools necessary to work with the framework, but who can also do some design, animation programming and etc. I don&#8217;t know what the statistic is for software companies hiring graphics designers, but i have yet to work for one which actually did. Besides, considering how new this technology is, I can only wonder how difficult it would be to fill such a position.</p>
<p><strong>Working with Expression Blend</strong></p>
<p>My exposure with Blend was very limited and frustrating. I&#8217;ve had the chance to work with Expression Blend 2, which appears to be out of date since the version 3 is out already. I&#8217;m sure a lot of folks worked with Photoshop and its intuitive UI. It seemed much of Blend interface is borrowed from Photoshop, which at first was a great indicator. However, working with the application revealed that it is a new charlie foxtrot from Microsoft. I played around with a few features and tried what i thought was going to be an easy task &#8211; adding background image to a rectangle. I spent an hour attempting to do this and got absolutely nowhere. As was explained in this <a href="http://www.ikriv.com/blog/?p=206" target="_blank">article</a>, performing such a simple task is completely counter-intuitive. At this point, i had absolutely no doubt in my mind that this wasn&#8217;t going to go anywhere, and off this hunk of shit went from my machine. What a complete waste of time that was.</p>
<p><strong>A good WPF showcase project?</strong></p>
<p>I find it really difficult to actually get my hands on one. <a href="http://msdn.microsoft.com/en-us/netframework/bb499684.aspx" target="_blank">StockTrader</a> is a good candidate for a sample WPF project to look at. However, most of its focus is on service-oriented software design, not so much on WPF. And it shows, as the project is just scratching the surface when it comes to WPF. Otherwise, i can&#8217;t recall any showcase projects with decent UI implementation. I wonder why Microsoft hasn&#8217;t stepped in and released a real-world WPF solution, just like they did Oxite for ASP.NET MVC. The lack of any decent material on WPF and Blend is also pretty astounding for such a hype both caused. All i was able to find was bits and pieces of information, nothing concrete like design patterns, specific design guidelines and such. It just seems like everything&#8217;s up in the air at this point.</p>
<p>I&#8217;m not even sure how to conclude this. I would probably still consider utilizing WPF for new solutions. You still have your standard set of controls and everything to get you started. The unfortunate thing is that you&#8217;ll probably not going to benefit much from the main features of the framework, but you&#8217;ll have to migrate at some point. Might as well do it now and hope that MS enhances their tools a little as the whole thing matures.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Hosting Winforms in Firefox]]></title>
<link>http://anoriginalidea.wordpress.com/2009/11/16/hosting-winforms-in-firefox/</link>
<pubDate>Mon, 16 Nov 2009 01:42:39 +0000</pubDate>
<dc:creator>anoriginalidea</dc:creator>
<guid>http://anoriginalidea.wordpress.com/2009/11/16/hosting-winforms-in-firefox/</guid>
<description><![CDATA[&#160; I have a strange fascination with hybrids.&#160; Combining old and new technologies in bizarr]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>&#160;<a href="http://anoriginalidea.files.wordpress.com/2009/11/image.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://anoriginalidea.files.wordpress.com/2009/11/image_thumb.png?w=239&#038;h=244" width="239" height="244" /></a> </p>
<p>I have a strange fascination with hybrids.&#160; Combining old and new technologies in bizarre and interesting ways.&#160;&#160; Why must developers make “the choice” between a web or native technology? It would be great to build applications that would increase or decrease in features depending on the platform they were run on.</p>
<p>&#160;</p>
<p><a href="http://anoriginalidea.files.wordpress.com/2009/11/clip_image002.jpg"><img style="display:inline;border-width:0;" title="clip_image002" border="0" alt="clip_image002" src="http://anoriginalidea.files.wordpress.com/2009/11/clip_image002_thumb.jpg?w=244&#038;h=163" width="244" height="163" /></a></p>
<p>Do you have a Winforms application that you’d like to host in a web browser?&#160; There’s an interesting technique you can use to do this enabled by .net Framework 3.5.</p>
<p>The .net framework provides the ability to create WPF web applications (commonly called XBAP).&#160; WPF has the ability, in turn, to host Winforms.&#160; </p>
<p><strong>Security</strong></p>
<p>It appears that in order to do this effectively, it’s necessary to deploy your XBAP application as a “Full Trust” application.</p>
<p><a href="http://anoriginalidea.files.wordpress.com/2009/11/image1.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://anoriginalidea.files.wordpress.com/2009/11/image_thumb1.png?w=244&#038;h=118" width="244" height="118" /></a> </p>
<p><strong>The code</strong></p>
<p>To use this, create an XBAP project, then a page a “WinformHost” control on it.&#160;&#160; The XAML could look like this:</p>
<p> <code>
<p>&#60;Page x:Class=&#34;Page1&#34;      <br />&#160;&#160;&#160; xmlns=&#34;<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation&#34;">http://schemas.microsoft.com/winfx/2006/xaml/presentation&#34;</a>       <br />&#160;&#160;&#160; xmlns:x=&#34;<a href="http://schemas.microsoft.com/winfx/2006/xaml&#34;">http://schemas.microsoft.com/winfx/2006/xaml&#34;</a>       <br />&#160;&#160;&#160; Title=&#34;Page1&#34;&#62;       <br />&#160;&#160;&#160; &#60;DockPanel LastChildFill=&#34;True&#34;&#62;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;Button Name=&#34;Button1&#34;&#160; DockPanel.Dock=&#34;Bottom&#34;&#160; &#62;This is a WPF Button&#60;/Button&#62;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;WindowsFormsHost Name=&#34;WinformHost&#34;&#160;&#160; /&#62;       <br />&#160;&#160;&#160; &#60;/DockPanel&#62;       <br />&#60;/Page&#62;</p>
<p> </code>
<p>Then, create some code to instantiate your winform and show it on the Winform host:</p>
<p> <code>
<p>Class Page1 </p>
<p>&#160;&#160;&#160; Private Sub Page1_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim loForm As New HelloWorldWinform </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; WinformHost.Child = WinformToUserControl.GetWrapper(loForm)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; loForm.Show() </p>
<p>&#160;&#160;&#160; End Sub      <br />End Class</p>
<p> </code>
<p>Here’s the subroutine:</p>
<p> <code>
<p>Public NotInheritable Class WinformToUserControl      </p>
<p>&#160;&#160;&#160; Public Shared Function GetWrapper(ByVal form As System.Windows.Forms.Form) As System.Windows.Forms.Control       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dim loPanel As New System.Windows.Forms.Panel       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; loPanel.Dock = Forms.DockStyle.Fill       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ShowFormInControl(loPanel, form)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Return loPanel       <br />&#160;&#160;&#160; End Function</p>
<p>&#160;&#160;&#160; Private Shared Sub ShowFormInControl(ByVal ctl As System.Windows.Forms.Control, ByVal frm As System.Windows.Forms.Form) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; frm.TopLevel = False      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; frm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; frm.AutoScaleMode = Forms.AutoScaleMode.Dpi       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ctl.Controls.Add(frm) </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; frm.Dock = Forms.DockStyle.Fill      </p>
<p>&#160;&#160;&#160; End Sub      <br />End Class</p>
</p>
<p>&#160;&#160;&#160; </code>
<p><strong>Interesting bits and pieces</strong></p>
<p>We found that in order for the items inside the control to scale properly, the AutoScaleMode property on the Winform must be set to Dpi instead of the default, which is Font.&#160; I have a feeling this is because Dpi is the mode preferred for WPF, but I am uncertain.</p>
<p>In the sample WinformToUserControl class I found it better to contain the Winform inside a panel rather than exposing the Winform directly.&#160; It seemed to make it more stable.&#160; Feel free to experiment with taking it off.</p>
<p><strong>Gotchas</strong></p>
<p>As of time of writing, Firefox on my Windows 7 64 bit machine steadfastly refuses to run xbap.&#160; It appears the “Windows Presentation Foundation” addin has not been automatically installed.&#160; I have no idea how to install it.&#160; There&#8217; appears to be no information about how to do so.&#160; So if you have it, good for you.&#160; If you don’t….try re-installing the .net framework 3.51 (which didn’t work for me…)</p>
<p>I do know there was some controversy about this addin being temporarily blacklisted by Mozilla due to security concerns last month, but that’s all over now isn’t it?&#160;&#160; </p>
<p>&#160;</p>
<h4>Download</h4>
<p>You can download a <a href="http://cid-5f1708eb705d1c65.skydrive.live.com/self.aspx/Public/HostingWinformsInFirefox.zip">sample project here</a>.</p>
<p><a href="http://anoriginalidea.files.wordpress.com/2009/11/image2.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://anoriginalidea.files.wordpress.com/2009/11/image_thumb2.png?w=231&#038;h=162" width="231" height="162" /></a> </p>
<h4>Links</h4>
<ul>
<li>I didn’t use anything from this project, but you might find it interesting <a href="http://mdiwinman.codeplex.com">MdiWindowManager</a> </li>
<li>StackOverflow <a href="http://stackoverflow.com/questions/543087/custom-class-for-dealing-with-embedding-in-forms">post on Embedding winforms in usercontrols</a> </li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[chronos: elementos del escritorio]]></title>
<link>http://carlosga.wordpress.com/2009/11/04/chronos-elementos-del-escritorio/</link>
<pubDate>Tue, 03 Nov 2009 23:19:46 +0000</pubDate>
<dc:creator>Carlos</dc:creator>
<guid>http://carlosga.wordpress.com/2009/11/04/chronos-elementos-del-escritorio/</guid>
<description><![CDATA[Sigo con los cambios para la implementación el sistema de elementos del escritorio, intentando integ]]></description>
<content:encoded><![CDATA[Sigo con los cambios para la implementación el sistema de elementos del escritorio, intentando integ]]></content:encoded>
</item>
<item>
<title><![CDATA[Novedades en chronos &hellip;]]></title>
<link>http://carlosga.wordpress.com/2009/11/02/novedades-en-chronos/</link>
<pubDate>Mon, 02 Nov 2009 17:17:22 +0000</pubDate>
<dc:creator>Carlos</dc:creator>
<guid>http://carlosga.wordpress.com/2009/11/02/novedades-en-chronos/</guid>
<description><![CDATA[Me he instalado el la beta 2 del Visual Studio 2010 y he migrado los fuentes de Chronos a la nueva v]]></description>
<content:encoded><![CDATA[Me he instalado el la beta 2 del Visual Studio 2010 y he migrado los fuentes de Chronos a la nueva v]]></content:encoded>
</item>
<item>
<title><![CDATA[Firefox bloque une extension Microsoft]]></title>
<link>http://code98.wordpress.com/2009/10/21/firefox-bloque-une-extension-microsoft/</link>
<pubDate>Wed, 21 Oct 2009 17:50:53 +0000</pubDate>
<dc:creator>Younes</dc:creator>
<guid>http://code98.wordpress.com/2009/10/21/firefox-bloque-une-extension-microsoft/</guid>
<description><![CDATA[Firefox vient de blacklister un module complémentaire de Microsoft: &#8220;Windows Presentation Foun]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Firefox vient de blacklister un module complémentaire de Microsoft: &#8220;Windows Presentation Foundation&#8221;<br />
La raison ? Firefox a déterminé que le module complémentaire est connu pour causer des problèmes de stabilité ou de sécurité.</p>
<p><img src="http://i80.servimg.com/u/f80/11/70/06/47/winpre10.jpg" alt="module Windows Presentation foundation" /></p>
<p>Je demande est ce que Microsoft a fait ça exprès pour diminuer la popularité de FF ? xD</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Mozilla bloqueia duas extensões da Microsoft para o Firefox.]]></title>
<link>http://almalivre.wordpress.com/2009/10/20/mozilla-bloqueia-duas-extensoes-da-microsoft-para-o-firefox/</link>
<pubDate>Tue, 20 Oct 2009 13:03:28 +0000</pubDate>
<dc:creator>stellarium</dc:creator>
<guid>http://almalivre.wordpress.com/2009/10/20/mozilla-bloqueia-duas-extensoes-da-microsoft-para-o-firefox/</guid>
<description><![CDATA[Começa a parecer que é de propósito. A Microsoft liberou duas extensões para o Internet Explorer e M]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://almalivre.wordpress.com/files/2009/07/broken_windows.jpeg"><img class="alignright size-full wp-image-136" title="broken_windows" src="http://almalivre.wordpress.com/files/2009/07/broken_windows.jpeg" alt="broken_windows" width="116" height="77" /></a>Começa a parecer que é de propósito.  A Microsoft liberou duas extensões para o Internet Explorer e Mozilla Firefox com vulnerabilidades graves. Uma dessas extensões, lançada em fevereiro, também enviava informações do usuário para a Microsoft, sem o seu conhecimento ou consentimento. <!--more-->Trata-se da .Net Framework 3.5 Service Pack 1, que continha uma falhade segurança que poderia ser explorada simplesmente entrando-se num site com conteúdo malicioso. A correção para o Internet Explorer foi realizada em 13/10 (8 meses depois de liberada a atualização defeituosa). Esta falha também está relacionada a outro plugin, o Windows Presentation Foundation.</p>
<p>A Fundação Mozilla comunicou à Microsoft que bloqueou ambas as extensões no navegador Firefox.</p>
<p>Se você utiliza o navegador Mozilla Firefox, a Fundação Mozilla lançou a página <a title="Plugin Check" href="http://www.mozilla.com/en-US/plugincheck/" target="_blank">Plugin Check </a>para que seus usuários atualizem seus plugins, já que alguns novos plugins do RealPlayer, Adobe Flash e Microsoft Silverlight não têm suas atualizações feitas automaticamente pelo site de addons (<a title="Addons Site" href="http://addons.mozilla.org" target="_blank">http://addons.mozilla.org</a>)</p>
<p>É bom lembrar que essas extensões da Microsoft são apenas para navegadores rodando em sistemas operacionais Windows. Quem está utilizando GNU/Linux pode ficar tranquilo, desde que não esteja utilizando navegadores via WINE.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Η Mozilla απενεργοποιεί add-on της Microsoft για τον Firefox και το επανενεργοποιεί τρεις μέρες μετά]]></title>
<link>http://xollothnews.wordpress.com/2009/10/20/%ce%b7-mozilla-%ce%b1%cf%80%ce%b5%ce%bd%ce%b5%cf%81%ce%b3%ce%bf%cf%80%ce%bf%ce%b9%ce%b5%ce%af-add-on-%cf%84%ce%b7%cf%82-microsoft-%ce%b3%ce%b9%ce%b1-%cf%84%ce%bf%ce%bd-firefox-%ce%ba%ce%b1%ce%b9/</link>
<pubDate>Tue, 20 Oct 2009 08:53:14 +0000</pubDate>
<dc:creator>xollothnews</dc:creator>
<guid>http://xollothnews.wordpress.com/2009/10/20/%ce%b7-mozilla-%ce%b1%cf%80%ce%b5%ce%bd%ce%b5%cf%81%ce%b3%ce%bf%cf%80%ce%bf%ce%b9%ce%b5%ce%af-add-on-%cf%84%ce%b7%cf%82-microsoft-%ce%b3%ce%b9%ce%b1-%cf%84%ce%bf%ce%bd-firefox-%ce%ba%ce%b1%ce%b9/</guid>
<description><![CDATA[Η Mozilla απενεργοποιεί add-on της Microsoft για τον Firefox και το επανενεργοποιεί τρεις μέρες μετά]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://e-pcmag.gr/news/61193">Η Mozilla απενεργοποιεί add-on της Microsoft για τον Firefox και το επανενεργοποιεί τρεις μέρες μετά &#124; PC Magazine</a><br />
<a class="lightbox-processed" rel="lightshow[field_first_image][]" href="http://e-pcmag.gr/files/add-on.jpg"><img src="http://e-pcmag.gr/files/imagecache/news_fullnode/add-on.jpg" alt="" width="250" height="182" /></a>Τελικά, φαίνεται ότι ήταν περιττή η αναστάτωση που προκλήθηκε από την ξαφνική ενοχοποίηση ενός browser add-on της Microsoft. Λίγες ημέρες πριν, η Mozilla ανακοίνωσε στους χρήστες του Firefox ότι είναι εκτεθειμένοι σε κίνδυνο λόγω του add-on <a class="zem_slink" title=".NET Framework" rel="homepage" href="http://msdn.microsoft.com/netframework/">Microsoft .NET Framework</a> Assistant. Η Mozilla θεώρησε ότι το εν λόγω add-on μπορεί να αποτελέσει το όχημα για παραβίαση της ασφάλειας του υπολογιστή και ξεκίνησε επείγουσες διαβουλεύσεις με τη Microsoft.<a href="http://e-pcmag.gr/news/61193">[next]</a></p>
<div class="zemanta-pixie" style="margin-top:10px;height:15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/ff22aa27-c832-86ef-adf5-d2b8bf083de3/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/reblog_e.png?x-id=ff22aa27-c832-86ef-adf5-d2b8bf083de3" alt="Reblog this post [with Zemanta]" /></a></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[فایرفاکس رخنه امنیتی مایکروسافت را خنثی می کند]]></title>
<link>http://tjs87.wordpress.com/2009/10/20/%d9%81%d8%a7%db%8c%d8%b1%d9%81%d8%a7%da%a9%d8%b3-%d8%b1%d8%ae%d9%86%d9%87-%d8%a7%d9%85%d9%86%db%8c%d8%aa%db%8c-%d9%85%d8%a7%db%8c%da%a9%d8%b1%d9%88%d8%b3%d8%a7%d9%81%d8%aa-%d8%b1%d8%a7-%d8%ae%d9%86/</link>
<pubDate>Tue, 20 Oct 2009 08:12:09 +0000</pubDate>
<dc:creator>tjsoftware</dc:creator>
<guid>http://tjs87.wordpress.com/2009/10/20/%d9%81%d8%a7%db%8c%d8%b1%d9%81%d8%a7%da%a9%d8%b3-%d8%b1%d8%ae%d9%86%d9%87-%d8%a7%d9%85%d9%86%db%8c%d8%aa%db%8c-%d9%85%d8%a7%db%8c%da%a9%d8%b1%d9%88%d8%b3%d8%a7%d9%81%d8%aa-%d8%b1%d8%a7-%d8%ae%d9%86/</guid>
<description><![CDATA[تاریخ ارسال خبر اصلی   : 26 مهر ترجمه و بازنویسی :  بابک فخریلو اگر از مرورگر  Firefox استفاده می کن]]></description>
<content:encoded><![CDATA[تاریخ ارسال خبر اصلی   : 26 مهر ترجمه و بازنویسی :  بابک فخریلو اگر از مرورگر  Firefox استفاده می کن]]></content:encoded>
</item>
<item>
<title><![CDATA[Mozilla loại bỏ plug-in của Microsoft trong Firefox]]></title>
<link>http://netvietnam.org/2009/10/20/mozilla-lo%e1%ba%a1i-b%e1%bb%8f-plug-in-c%e1%bb%a7a-microsoft-trong-firefox/</link>
<pubDate>Mon, 19 Oct 2009 17:58:35 +0000</pubDate>
<dc:creator>Nhân Mã</dc:creator>
<guid>http://netvietnam.org/2009/10/20/mozilla-lo%e1%ba%a1i-b%e1%bb%8f-plug-in-c%e1%bb%a7a-microsoft-trong-firefox/</guid>
<description><![CDATA[Vào hôm thứ sáu vừa qua Mozilla đã loại bỏ một phần mềm do Microsoft sản xuất ra khỏi ứng dụng trình]]></description>
<content:encoded><![CDATA[Vào hôm thứ sáu vừa qua Mozilla đã loại bỏ một phần mềm do Microsoft sản xuất ra khỏi ứng dụng trình]]></content:encoded>
</item>
<item>
<title><![CDATA[Η Mozilla μπλοκάρει το plug-in της Microsoft]]></title>
<link>http://xollothnews.wordpress.com/2009/10/19/%ce%b7-mozilla-%ce%bc%cf%80%ce%bb%ce%bf%ce%ba%ce%ac%cf%81%ce%b5%ce%b9-%cf%84%ce%bf-plug-in-%cf%84%ce%b7%cf%82-microsoft/</link>
<pubDate>Mon, 19 Oct 2009 09:45:35 +0000</pubDate>
<dc:creator>xollothnews</dc:creator>
<guid>http://xollothnews.wordpress.com/2009/10/19/%ce%b7-mozilla-%ce%bc%cf%80%ce%bb%ce%bf%ce%ba%ce%ac%cf%81%ce%b5%ce%b9-%cf%84%ce%bf-plug-in-%cf%84%ce%b7%cf%82-microsoft/</guid>
<description><![CDATA[Η Mozilla μπλοκάρει το plug-in της Microsoft &#8211; Mozilla μπλοκάρει το λογισμικό της Microsoft, F]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.pcw.gr/Article/Security/Mozilla_blocks_software_Microsoft_Firefox/240-4669.html">Η Mozilla μπλοκάρει το plug-in της Microsoft &#8211; Mozilla μπλοκάρει το λογισμικό της Microsoft, Firefox, κακόβουλο λογισμικό &#8211; PCW</a><br />
<img src="http://www.pcw.gr/files/Image/Articles/General/Mozilla/firefox.jpg" alt="" />Η εταιρεία μπλόκαρε, την Παρασκευή, το plug-in που είχε «εμφυτέψει» η Microsoft στον Firefox και το οποίο έβαζε τους χρήστες του browser σε κίνδυνο</p>
<p>Όπως δήλωσε ο <a class="zem_slink" title="Mike Shaver" rel="crunchbase" href="http://www.crunchbase.com/person/mike-shaver">Mike Shaver</a>, εκπρόσωπος της Mozilla,η εταιρεία πήρε προληπτικά μέτρα μπλοκάροντας το λογισμικό της Microsoft που βρέθηκε στον Firefox και το οποίο αποτελούνταν από δύο μέρη – το add-on με την ονομασία “<a class="zem_slink" title=".NET Framework" rel="homepage" href="http://msdn.microsoft.com/netframework/">.NET Framework</a> Assistant” και το plug-in “<a class="zem_slink" title="Windows Presentation Foundation" rel="wikipedia" href="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation">Windows Presentation Foundation</a>”.[<a href="http://www.pcw.gr/Article/Security/Mozilla_blocks_software_Microsoft_Firefox/240-4669.html">next]</a></p>
<div class="zemanta-pixie" style="margin-top:10px;height:15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/60e92185-acac-8948-8b0a-8eba92e7f457/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/reblog_e.png?x-id=60e92185-acac-8948-8b0a-8eba92e7f457" alt="Reblog this post [with Zemanta]" /></a></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Mozilla blocks Microsoft's Firefox plugin]]></title>
<link>http://basshead.wordpress.com/2009/10/19/mozilla-blocks-microsofts-firefox-plugin/</link>
<pubDate>Mon, 19 Oct 2009 07:50:52 +0000</pubDate>
<dc:creator>basshead</dc:creator>
<guid>http://basshead.wordpress.com/2009/10/19/mozilla-blocks-microsofts-firefox-plugin/</guid>
<description><![CDATA[Monday mornings are not known for amusing news, but today is different. I fired up Firefox on my wor]]></description>
<content:encoded><![CDATA[Monday mornings are not known for amusing news, but today is different. I fired up Firefox on my wor]]></content:encoded>
</item>
<item>
<title><![CDATA[Logging display and WPF]]></title>
<link>http://peteohanlon.wordpress.com/2009/10/12/logging-display-and-wpf/</link>
<pubDate>Mon, 12 Oct 2009 21:12:15 +0000</pubDate>
<dc:creator>peteohanlon</dc:creator>
<guid>http://peteohanlon.wordpress.com/2009/10/12/logging-display-and-wpf/</guid>
<description><![CDATA[A question appeared over on the Code Project forums today about binding the output from log4net into]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>A question appeared over on the <a href="http://www.codeproject.com/Messages/3230562/Binding-StringWriter-to-WPF-TextBox.aspx" target="_self">Code Project forums</a> today about binding the output from log4net into WPF. The question asked was:</p>
<address>&#8220;I&#8217;m trying to use Log4net to log messages within my application. I&#8217;m adding a WPF window and want to stream the messages to the window. Log4net provides a TextWriterAppender that takes a StringWriter and writes logged events to the StringWriter, flushing it after each event.I want to simply connect the output of the StringWriter as the Text property on a TextBox. When I started this, it seemed simple and obvious &#8211; now I&#8217;m less sure. Ideally, I would simply like to bind the StringWriter to the TextBox, but haven&#8217;t found the incantation.</p>
<p>The basic problem is that the StringWriter doesn&#8217;t provide something like the INotifyPropertyChanged event to trigger code output a new log message (unless there is something behind the scenes I haven&#8217;t found).</p>
<p>I&#8217;ve see many examples of binding, all of which seem to presume that I have control over the writer itself. Am I missing something simple (I hope), or is this really not that straightforward.&#8221;</p>
</address>
<p>This is a very good question, so I thought I&#8217;d knock together a quick sample application to demonstrate how to do this. The first thing to remember is that log4net allows you to create your own appenders and use them in your application. The second thing to remember is that you need to hook INotifyPropertyChanged into the mechanism. To that end, I created the following appender:</p>
<pre class="brush: csharp;">
namespace log4netSample.Logging
{
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using log4net.Appender;
  using System.ComponentModel;
  using System.IO;
  using System.Globalization;
  using log4net;
  using log4net.Core;

  /// &#60;summary&#62;
  /// The appender we are going to bind to for our logging.
  /// &#60;/summary&#62;
  public class NotifyAppender : AppenderSkeleton, INotifyPropertyChanged
  {
    #region Members and events
    private static string _notification;
    private event PropertyChangedEventHandler _propertyChanged;

    public event PropertyChangedEventHandler PropertyChanged
    {
      add { _propertyChanged += value; }
      remove { _propertyChanged -= value; }
    }
    #endregion

    /// &#60;summary&#62;
    /// Get or set the notification message.
    /// &#60;/summary&#62;
    public string Notification
    {
      get
      {
        return _notification; ;
      }
      set
      {
        if (_notification != value)
        {
          _notification = value;
          OnChange();
        }
      }
    }

    /// &#60;summary&#62;
    /// Raise the change notification.
    /// &#60;/summary&#62;
    private void OnChange()
    {
      PropertyChangedEventHandler handler = _propertyChanged;
      if (handler != null)
      {
        handler(this, new PropertyChangedEventArgs(string.Empty));
      }
    }

    /// &#60;summary&#62;
    /// Get a reference to the log instance.
    /// &#60;/summary&#62;
    public NotifyAppender Appender
    {
      get
      {
        return Log.Appender;
      }

    }

    /// &#60;summary&#62;
    /// Append the log information to the notification.
    /// &#60;/summary&#62;
    /// &#60;param name=&#34;loggingEvent&#34;&#62;The log event.&#60;/param&#62;
    protected override void Append(LoggingEvent loggingEvent)
    {
      StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);
      Layout.Format(writer, loggingEvent);
      Notification += writer.ToString();
    }
  }
}
</pre>
<p>Whenever a new message is appended, the Notification is updated and the PropertyChangedEventHandler is called to notify the calling application that the binding has been updated. In order to use this appender, you need to hook it into your configuration:</p>
<pre class="brush: xml;">
&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34; ?&#62;
&#60;configuration&#62;
  &#60;configSections&#62;
    &#60;section name=&#34;log4net&#34;
      type=&#34;log4net.Config.Log4NetConfigurationSectionHandler, log4net&#34; /&#62;
  &#60;/configSections&#62;
  &#60;appSettings&#62;
    &#60;add key=&#34;log4net.Internal.Debug&#34; value=&#34;false&#34;/&#62;
  &#60;/appSettings&#62;
  &#60;system.diagnostics&#62;
    &#60;trace autoflush=&#34;true&#34;&#62;
      &#60;listeners&#62;
        &#60;add name=&#34;textWriterTraceListener&#34;
             type=&#34;System.Diagnostics.TextWriterTraceListener&#34;
             initializeData=&#34;C:\log4net_internal.log&#34;/&#62;
      &#60;/listeners&#62;
    &#60;/trace&#62;
  &#60;/system.diagnostics&#62;
  &#60;log4net&#62;
    &#60;appender name=&#34;NotifyAppender&#34; type=&#34;log4netSample.Logging.NotifyAppender&#34; &#62;
      &#60;layout type=&#34;log4net.Layout.PatternLayout&#34;&#62;
        &#60;param name=&#34;Header&#34; value=&#34;[Header]\r\n&#34; /&#62;
        &#60;param name=&#34;Footer&#34; value=&#34;[Footer]\r\n&#34; /&#62;
        &#60;param name=&#34;ConversionPattern&#34; value=&#34;%d [%t] %-5p %c %m%n&#34; /&#62;
      &#60;/layout&#62;
    &#60;/appender&#62;

    &#60;root&#62;
      &#60;level value=&#34;ALL&#34; /&#62;
      &#60;appender-ref ref=&#34;NotifyAppender&#34; /&#62;
    &#60;/root&#62;
  &#60;/log4net&#62;
&#60;/configuration&#62;
</pre>
<p><em>Note that you might want to add the <a href="http://logging.apache.org/log4net/release/manual/configuration.html" target="_blank">following line into your AssemblyInfo.cs</a> file:</em></p>
<pre class="brush: csharp;">
[assembly: log4net.Config.XmlConfigurator(Watch=true)]
</pre>
<p>I find the following class really helpful when logging:</p>
<pre class="brush: csharp;">
namespace log4netSample.Logging
{
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using log4net;
  using log4net.Config;
  using log4net.Appender;
  using log4net.Repository.Hierarchy;

  public enum LogLevel
  {
    Debug = 0,
    Error = 1,
    Fatal = 2,
    Info = 3,
    Warning = 4
  }
  /// &#60;summary&#62;
  /// Write out messages using the logging provider.
  /// &#60;/summary&#62;
  public static class Log
  {
    #region Members
    private static readonly ILog _logger = LogManager.GetLogger(typeof(Log));
    private static Dictionary&#60;LogLevel, Action&#60;string&#62;&#62; _actions;
    #endregion

    /// &#60;summary&#62;
    /// Static instance of the log manager.
    /// &#60;/summary&#62;
    static Log()
    {
      XmlConfigurator.Configure();
      _actions = new Dictionary&#60;LogLevel, Action&#60;string&#62;&#62;();
      _actions.Add(LogLevel.Debug, WriteDebug);
      _actions.Add(LogLevel.Error, WriteError);
      _actions.Add(LogLevel.Fatal, WriteFatal);
      _actions.Add(LogLevel.Info, WriteInfo);
      _actions.Add(LogLevel.Warning, WriteWarning);
    }

    /// &#60;summary&#62;
    /// Get the &#60;see cref=&#34;NotifyAppender&#34;/&#62; log.
    /// &#60;/summary&#62;
    /// &#60;returns&#62;The instance of the &#60;see cref=&#34;NotifyAppender&#34;/&#62; log, if configured.
    /// Null otherwise.&#60;/returns&#62;
    public static NotifyAppender Appender
    {
      get
      {
        foreach (ILog log in LogManager.GetCurrentLoggers())
        {
          foreach (IAppender appender in log.Logger.Repository.GetAppenders())
          {
            if (appender is NotifyAppender)
            {
              return appender as NotifyAppender;
            }
          }
        }
        return null;
      }
    }

    /// &#60;summary&#62;
    /// Write the message to the appropriate log based on the relevant log level.
    /// &#60;/summary&#62;
    /// &#60;param name=&#34;level&#34;&#62;The log level to be used.&#60;/param&#62;
    /// &#60;param name=&#34;message&#34;&#62;The message to be written.&#60;/param&#62;
    /// &#60;exception cref=&#34;ArgumentNullException&#34;&#62;Thrown if the message is empty.&#60;/exception&#62;
    public static void Write(LogLevel level, string message)
    {
      if (!string.IsNullOrEmpty(message))
      {
        if (level &#62; LogLevel.Warning &#124;&#124; level &#60; LogLevel.Debug)
          throw new ArgumentOutOfRangeException(&#34;level&#34;);

        // Now call the appropriate log level message.
        _actions[level](message);
      }
    }

    #region Action methods
    private static void WriteDebug(string message)
    {
      if (_logger.IsDebugEnabled)
        _logger.Debug(message);
    }

    private static void WriteError(string message)
    {
      if (_logger.IsErrorEnabled)
        _logger.Error(message);
    }

    private static void WriteFatal(string message)
    {
      if (_logger.IsFatalEnabled)
        _logger.Fatal(message);
    }

    private static void WriteInfo(string message)
    {
      if (_logger.IsInfoEnabled)
        _logger.Info(message);
    }

    private static void WriteWarning(string message)
    {
      if (_logger.IsWarnEnabled)
        _logger.Warn(message);
    }
    #endregion
  }
}
</pre>
<p>It&#8217;s a simple matter then to do something like Log.Write(LogLevel.Info, &#8220;This is my message&#8221;);</p>
<p>If you download the attached sample, you&#8217;ll get to see the whole application running in all its glory, and you can see how updating the log results in the output being updated. Don&#8217;t forget to rename the .doc file to .zip when you save it.</p>
<p><a href="http://peteohanlon.wordpress.com/files/2009/10/log4netsamplezip.doc">log4netsamplezip</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Catchup: limit++]]></title>
<link>http://slizerboy.wordpress.com/2009/10/05/catchup-limit/</link>
<pubDate>Mon, 05 Oct 2009 09:35:44 +0000</pubDate>
<dc:creator>Robert Chow</dc:creator>
<guid>http://slizerboy.wordpress.com/2009/10/05/catchup-limit/</guid>
<description><![CDATA[So, after having already written a couple lengthy posts, I thought I&#8217;d finished, then it struc]]></description>
<content:encoded><![CDATA[So, after having already written a couple lengthy posts, I thought I&#8217;d finished, then it struc]]></content:encoded>
</item>
<item>
<title><![CDATA[Creating a video application in WPF - Part I]]></title>
<link>http://hacktheugly.wordpress.com/2009/09/29/creating-a-video-application-in-wpf-part-one/</link>
<pubDate>Wed, 30 Sep 2009 01:26:03 +0000</pubDate>
<dc:creator>Gopal</dc:creator>
<guid>http://hacktheugly.wordpress.com/2009/09/29/creating-a-video-application-in-wpf-part-one/</guid>
<description><![CDATA[WPF (Windows Presentaion Foundation) has some cool features that attract most of the GUI developers ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>WPF (Windows Presentaion Foundation) has some cool features that attract most of the GUI developers to migrate to it. Since WPF uses a markup language called XAML(eXtensible Application Markup Language) you can make your GUI application with ease and higher degree of confidence. Another good part of WPF is that you can program it in C# or Visual Basic.Net, which makes it manageable compared to applications programmed in native language like C++. Built on top of DirectX, with WPF you can harness the power which you can acquire by programming the DirectX API. But, If you are a developer who really wants to hardcode, then I would like you to go and try using the DirectX API.</p>
<p>Here is a sample application that plays video</p>
<p>First create a new WPF application in Visual Studio. Drag the MediaElement Control to the stage. Manually you can do that by writing similar code as given below. In this article I the video that I used is the Windows Vista sample video. You can specify the source of your own video for the Source attribute.</p>
<p>&#60;MediaElement Name=&#8221;myVid&#8221; Source=&#8221;C:\Users\Public\Videos\Sample Videos\Bear.wmv&#8221; LoadedBehavior=&#8221;Manual&#8221; Width=&#8221;320&#8243; Height=&#8221;240&#8243; /&#62;</p>
<p><strong>Add 3 button controls on the designer window to control the media playback.</strong></p>
<p>&#60;StackPanel Orientation=&#8221;Horizontal&#8221; Margin=&#8221;0,10,0,0&#8243;&#62;<br />
&#60;Button Content=&#8221;Play&#8221; Margin=&#8221;0,0,10,0&#8243; Padding=&#8221;5&#8243; Click=&#8221;mediaPlay&#8221; /&#62;<br />
&#60;Button Content=&#8221;Pause&#8221; Margin=&#8221;0,0,10,0&#8243; Padding=&#8221;5&#8243; Click=&#8221;mediaPause&#8221; /&#62;<br />
&#60;Button x:Name=&#8221;muteButt&#8221; Content=&#8221;Mute&#8221; Padding=&#8221;5&#8243; Click=&#8221;mediaMute&#8221; /&#62;<br />
&#60;/StackPanel&#62;</p>
<p><strong>Add the following code in your Window1.xaml.cs file </strong></p>
<p>void mediaPlay(Object sender, EventArgs e){</p>
<p>myVid.Play();</p>
<p>}</p>
<p>void mediaPause(Object sender, EventArgs e){</p>
<p>myVid.Pause();</p>
<p>}</p>
<p>void mediaMute(Object sender, EventArgs e){</p>
<p>if (myVid.Volume == 100){</p>
<p>myVid.Volume = 0;</p>
<p>muteButt.Content =</p>
<p>&#8220;Listen&#8221;;<br />
}</p>
<p>else</p>
<p>{</p>
<p>myVid.Volume = 100;</p>
<p>muteButt.Content =</p>
<p>&#8220;Mute&#8221;;<br />
}</p>
<p>}</p>
<p><strong>Press F5 to test your application.<br />
</strong></p>
<pre>
<div><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"> </span></span></span></span></span></span></div>
</pre>
<p><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;"> </span></span><span style="color:#0000ff;font-size:x-small;"><span style="font-size:x-small;"><span style="color:#000000;"> </span></span></span></p>
<p style="text-align:center;"><span style="color:#a31515;font-size:x-small;"><span style="font-size:x-small;"><span style="color:#000000;"><a href="http://hacktheugly.wordpress.com/files/2009/09/test_proj.jpg"><img class="size-full wp-image-472 aligncenter" title="test_proj" src="http://hacktheugly.wordpress.com/files/2009/09/test_proj.jpg" alt="test_proj" width="362" height="346" /></a></span></span></span></p>
<p><span style="color:#a31515;font-size:x-small;"><span style="color:#a31515;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"><span style="color:#0000ff;font-size:x-small;"> </span></span></span></span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Textbox Drag/Drop in WPF]]></title>
<link>http://peteohanlon.wordpress.com/2009/09/28/textbox-dragdrop-in-wpf/</link>
<pubDate>Mon, 28 Sep 2009 09:17:26 +0000</pubDate>
<dc:creator>peteohanlon</dc:creator>
<guid>http://peteohanlon.wordpress.com/2009/09/28/textbox-dragdrop-in-wpf/</guid>
<description><![CDATA[So last week, somebody posted a question on Code Project about why a Drag Drop into a TextBox in WPF]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>So last week, somebody posted <a href="http://www.codeproject.com/Messages/3212151/Why-doesnt-the-AllowDrop-property-work-with-a-Text.aspx" target="_blank">a question on Code Project</a> about why a Drag Drop into a TextBox in WPF doesn&#8217;t actually work. When you attempt to drag and drop an item into a TextBox, it refuses to cooperate and leaves the mouse cursor as the Drop denied cursor and you can&#8217;t drop into the field. (Incidentally, this behaviour also applies to RichTextBox and FlowDocument controls). The reason that you can&#8217;t drop into these fields, even if you set AllowDrop to true, is that these particular controls mark drag and drop events as handled, preventing you from handling them yourself.</p>
<p>Now this might seem like a big problem &#8211; it certainly makes it look like you can&#8217;t drag/drop into a textbox, and this would seem to be a huge oversight on Microsoft&#8217;s part. Fortunately, with a little bit of knowledge of how WPF handles commands, it&#8217;s actually fairly easy to come up with a workaround. Remember that I said that WPF marks these operations as handled? This is the key to being able to work around it &#8211; each particular event (such as a DragOver event), also has a corresponding Preview event which we can hook into to perform our processing. Before I show you the code though, the OP posted a follow up query:</p>
<address>&#8220;A specific question I have about your solution is that you get the standard mouse cursor with the plus sign inside a box when the drag operation enters the edit box. In my initial solution to the drop into a ListBox I got a mouse cursor with an empty box, not the box with the plus sign. By experimenting I determined that you achieve this with the code you have in the PreviewDrag events. What about that code gets you the cursor with the plus sign, avoiding that anemic cursor without the plus sign?&#8221;</address>
<p>The following filename drag/drop sample demonstrates how changing the DragDropEffects parameter changes the appearance of the drop cursor, in answer to the Original Posters followup question:</p>
<pre class="brush: xml;">
&#60;Window x:Class=&#34;SampleDragDrop.Window1&#34;
  xmlns=&#34;http://schemas.microsoft.com/winfx/2006/xaml/presentation&#34;
  xmlns:x=&#34;http://schemas.microsoft.com/winfx/2006/xaml&#34;
  xmlns:sys=&#34;clr-namespace:System;assembly=mscorlib&#34;
  Title=&#34;Window1&#34; Height=&#34;274&#34; Width=&#34;300&#34;&#62;
  &#60;Window.Resources&#62;
    &#60;ObjectDataProvider
        MethodName=&#34;GetValues&#34;
        ObjectType=&#34;{x:Type sys:Enum}&#34;
        x:Key=&#34;DragProvider&#34;&#62;
      &#60;ObjectDataProvider.MethodParameters&#62;
        &#60;x:Type TypeName=&#34;DragDropEffects&#34; /&#62;
      &#60;/ObjectDataProvider.MethodParameters&#62;
    &#60;/ObjectDataProvider&#62;
    &#60;Style TargetType=&#34;{x:Type TextBlock}&#34;&#62;
      &#60;Setter Property=&#34;Margin&#34; Value=&#34;3&#34; /&#62;
      &#60;Setter Property=&#34;VerticalAlignment&#34; Value=&#34;Center&#34; /&#62;
    &#60;/Style&#62;
  &#60;/Window.Resources&#62;
  &#60;Grid&#62;
    &#60;Grid.ColumnDefinitions&#62;
      &#60;ColumnDefinition Width=&#34;101*&#34; /&#62;
      &#60;ColumnDefinition Width=&#34;177*&#34; /&#62;
    &#60;/Grid.ColumnDefinitions&#62;
    &#60;Grid.RowDefinitions&#62;
      &#60;RowDefinition Height=&#34;27*&#34; /&#62;
      &#60;RowDefinition Height=&#34;203.258*&#34; /&#62;
      &#60;RowDefinition Height=&#34;Auto&#34; /&#62;
    &#60;/Grid.RowDefinitions&#62;
    &#60;TextBlock Text=&#34;Drag Drop Effects&#34; Grid.Column=&#34;0&#34; Grid.Row=&#34;0&#34; /&#62;
    &#60;TextBlock Text=&#34;Drop target&#34; Grid.Column=&#34;0&#34; Grid.Row=&#34;1&#34; /&#62;
    &#60;TextBlock Text=&#34;Handled&#34; Grid.Column=&#34;0&#34; Grid.Row=&#34;2&#34; /&#62;
    &#60;ComboBox
      x:Name=&#34;cboDropEffects&#34;
      Grid.Row=&#34;0&#34;
      Grid.Column=&#34;1&#34;
      Margin=&#34;2&#34;
      SelectedIndex=&#34;0&#34;
      ItemsSource=&#34;{Binding Source={StaticResource DragProvider}}&#34; /&#62;
    &#60;TextBox
      Grid.Row=&#34;1&#34;
      Grid.Column=&#34;1&#34;
      Margin=&#34;2&#34;
      PreviewDragEnter=&#34;TextBox_PreviewDragEnter&#34;
      PreviewDragOver=&#34;TextBox_PreviewDragEnter&#34;
      PreviewDrop=&#34;TextBox_PreviewDrop&#34; /&#62;
    &#60;CheckBox x:Name=&#34;chkHandled&#34; IsChecked=&#34;True&#34; Grid.Row=&#34;2&#34; Grid.Column=&#34;1&#34; Margin=&#34;2&#34; /&#62;
  &#60;/Grid&#62;
&#60;/Window&#62;
</pre>
<p>If you look carefully at the code, you see that we bind PreviewDragEnter and the PreviewDragOver to the same event handler. The PreviewDrop event maps to a different event handler, where we actually perform the drop of the filename.</p>
<pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SampleDragDrop
{
  /// &#60;summary&#62;
  /// Interaction logic for Window1.xaml
  /// &#60;/summary&#62;
  public partial class Window1 : Window
  {
    public Window1()
    {
      InitializeComponent();
    }

    private void TextBox_PreviewDragEnter(object sender, DragEventArgs e)
    {
      e.Effects = (DragDropEffects)cboDropEffects.SelectedItem;
      if (chkHandled.IsChecked.HasValue)
      {
        e.Handled = chkHandled.IsChecked.Value;
      }
    }

    private void TextBox_PreviewDrop(object sender, DragEventArgs e)
    {
      object text = e.Data.GetData(DataFormats.FileDrop);
      TextBox tb = sender as TextBox;
      if (tb != null)
      {
        tb.Text = string.Format(&#34;{0}&#34;, ((string[])text)[0]);
      }
    }
  }
}
</pre>
<p>When you run the sample, play around with the Drag Drop Effects values, and setting/unsetting the Handled checkbox, to see what behaviour the textbox exhibits (and the answer to the OPs question, is that setting e.Effects to DragDropEffects.All sets the cursor to the relevant cursor).</p>
<p>This sample is available here: <a href="http://peteohanlon.wordpress.com/files/2009/09/sampledragdropzip.doc">SampleDragDrop</a>. Don&#8217;t forget to change the extension from .doc to .zip when you download it.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA["How do I anyway?" : Como criar WPF DataTemplates "on the Fly" (em execução)]]></title>
<link>http://masterpants.wordpress.com/2009/09/25/how-do-i-anyway-como-criar-wpf-datatemplates-on-the-fly-em-execucao/</link>
<pubDate>Fri, 25 Sep 2009 21:40:50 +0000</pubDate>
<dc:creator>masterpants</dc:creator>
<guid>http://masterpants.wordpress.com/2009/09/25/how-do-i-anyway-como-criar-wpf-datatemplates-on-the-fly-em-execucao/</guid>
<description><![CDATA[Ontem estava eu em meu trabalho, lidando com minhas atribuições diárias, quando me deparei com um pr]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Ontem estava eu em meu trabalho, lidando com minhas atribuições diárias, quando me deparei com um problema, precisava criar &#8220;On the fly&#8221; um DataTemplate na aplicação na qual estou trabalhando.</p>
<p>O problema com isso é que o DataTemplate não possui um LogicalTree, apenas um VisualTree, e o elemento VisualTree não recebe nenhum elemento (FrameworkElement), mas sim um FrameworkElementFactory, que irá criar para você os elementos necessarios.</p>
<p>Agora como setar valores nas propriedades de meu elemento se eu não possuo referência do mesmo?<br />
Primeiramente definimos o DataTemplate, e então adicionamos a ele uma nova instância do objeto desejado, e então setamos as propriedades com o uso do método SetValue (do DependencyObject que é a classe &#8220;pai&#8221; do FrameworkElementFactory). Assim sendo o código ficaria:</p>
<p><code><br />
<span style="color:#0000ff;">public</span> <span style="color:#006080;">DataTemplate</span> CriarTemplate()<br />
{<br />
<span style="color:#006080;"> DataTemplate</span> dt = <span style="color:#0000ff;">new</span> <span style="color:#006080;">DataTemplate</span>();<br />
<span style="color:#006080;"> FrameworkElementFactory</span> filho = <span style="color:#0000ff;">new</span> <span style="color:#006080;">FrameworkElementFactory</span>(<span style="color:#0000ff;">typeof</span>(<span style="color:#006080;">Border</span>));<br />
filho.SetValue(<span style="color:#006080;">Border</span>.CornerRadiusProperty, <span style="color:#0000ff;">new</span> CornerRadius(5));<br />
filho.SetValue(<span style="color:#006080;">Border</span>.BackgroundProperty, <span style="color:#0000ff;">new</span> <span style="color:#006080;">LinearGradientBrush</span>(<span style="color:#006080;">Colors</span>.Gray, <span style="color:#006080;">Colors</span>.Black, 90);<br />
dt.VisualTree = filho;<br />
<span style="color:#0000ff;"> return</span> dt;<br />
}<br />
</code></p>
<h4>Raul</h4>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Customizing WPF TextBox Not Easy, But Possible]]></title>
<link>http://dalebarnardonwpf.wordpress.com/2009/09/25/customizing-wpf-textbox/</link>
<pubDate>Fri, 25 Sep 2009 18:06:00 +0000</pubDate>
<dc:creator>barnarddale</dc:creator>
<guid>http://dalebarnardonwpf.wordpress.com/2009/09/25/customizing-wpf-textbox/</guid>
<description><![CDATA[For several days, I looked for hooks into the Windows Presentation Foundation (WPF) System.Windows.C]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>For several days, I looked for hooks into the Windows Presentation Foundation (WPF) System.Windows.Controls.TextBox control to display shadowed text:</p>
<p><a href="http://dalebarnardonwpf.files.wordpress.com/2009/09/image.png"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="image" border="0" alt="image" src="http://dalebarnardonwpf.files.wordpress.com/2009/09/image_thumb.png?w=332&#038;h=178" width="332" height="178" /></a> </p>
<p>WPF does not make the shadow effect easy. Changing the Foreground property can change the text color to any brush (even to a video or an image brush), but it does not achieve the shadow effect.</p>
<p>Using Snoop, I looked at the visual composition of a TextBox:</p>
<p><a href="http://dalebarnardonwpf.files.wordpress.com/2009/09/image1.png"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="image" border="0" alt="image" src="http://dalebarnardonwpf.files.wordpress.com/2009/09/image_thumb1.png?w=161&#038;h=244" width="161" height="244" /></a> </p>
<p>The TextBoxView control shown in Snoop does not have a public API. <a href="http://social.msdn.microsoft.com/Profile/en-US/?user=LesterLobo%20-%20MSFT&#38;referrer=http%3a%2f%2fsocial.msdn.microsoft.com%2fForums%2fen-US%2fwpf%2fthread%2f1ea114ff-1bb7-48c6-9cd6-04f1d1aa92a7&#38;rh=C5Q6sqgXSolV%2b1MVOcBMtFF6jSyUuw%2f4ym%2bOyGmfPeY%3d&#38;sp=forums" target="_blank">Lester Lobo</a> says in <a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/1ea114ff-1bb7-48c6-9cd6-04f1d1aa92a7" target="_blank">this WPF forum post</a>, “It is an internal lightweight class handling the rendering of content in the textbox.” If you re-templated a TextBox to try to replace the TextBoxView, you would have to implement all of the text-management functions provided by a TextBox—no small undertaking.</p>
<p>I then found a blog entry by <a href="http://www.codeproject.com/Members/KenJohnson" target="_blank">Ken Johnson</a> on <a href="http://www.codeproject.com" target="_blank">CodeProject.com</a> describing a clever hack for tricking a TextBox into doing what I wanted. His article is called <a href="http://www.codeproject.com/KB/WPF/CodeBox2.aspx" target="_blank">CodeBox 2</a>, and it uses the following algorithm:</p>
<ol>
<li>Derive a class from TextBox.</li>
<li>Set the Foreground property to Brushes.Transparent. This hides the TextBox’s built-in text rendering.</li>
<li>Override OnRender().</li>
<li>Create a FormattedText object with the TextBox.Text string and set some properties to make it align and wrap just like the TextBoxView would normally do.</li>
<li>Call DrawingContext.DrawText() to output the FormattedText such that it draws in the exact same position as the TextBoxView would normally do. To achieve the shadowed text effect, first use DrawingContext.DrawText() to draw the shadow offset a couple of units from the primary text, and then call it again to draw the primary text.</li>
<li>What you now see is your shadowed text in a fully-functional TextBox. If you highlight text, you are actually interacting with the transparent text that is drawn in the TextBox.</li>
</ol>
<p><a href="http://dalebarnardonwpf.files.wordpress.com/2009/09/image2.png"><img style="border-bottom:0;border-left:0;display:block;float:none;margin-left:auto;border-top:0;margin-right:auto;border-right:0;" title="image" border="0" alt="image" src="http://dalebarnardonwpf.files.wordpress.com/2009/09/image_thumb2.png?w=244&#038;h=155" width="244" height="155" /></a> </p>
<p>It may be a hack, but it’s a clever hack, and aside from some scrolling and margin adjustments described well in <a href="http://www.codeproject.com/KB/WPF/CodeBox2.aspx" target="_blank">Ken Johnson’s article and code</a>, you can implement it relatively painlessly.</p>
<p>WPF’s in-depth text formatting features pay a price in CPU performance. This custom TextBox pays an even bigger price. First, drawing transparent text likely goes through all the formatting and rendering steps for no obvious visual effect. The text formatting likely provides some hit-testing and/or control sizing (layout) features even when formatting invisible text. Second, in addition to drawing transparent text, constructing a new FormattedText object and calling DrawingContext.DrawText() twice (once for the shadow and once for the primary text) adds overhead.</p>
<p>While I have not tested performance of my shadowed-text custom TextBox as shown in the screenshots above, I imagine that it will perform well enough on mid-level computers even with large amounts of text. However, if your application used these shadowed text effects in many places, the accumulation of CPU overhead would likely add up to significant performance problems.</p>
<p>I would appreciate any comments about other ways to draw shadowed text in a TextBox or to gain hooks into TextBox’s inner workings.</p>
<p>Good luck!</p>
<p>Dale</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:ad17111d-b644-4b7e-b136-cfe426cdcb08" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/.NET" rel="tag">.NET</a>,<a href="http://technorati.com/tags/C%23" rel="tag">C#</a>,<a href="http://technorati.com/tags/WPF" rel="tag">WPF</a></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Sketchflow &ndash; &ldquo;Duplicate&rdquo; Bug]]></title>
<link>http://anoriginalidea.wordpress.com/2009/08/27/sketchflow-duplicate-bug/</link>
<pubDate>Wed, 26 Aug 2009 23:43:05 +0000</pubDate>
<dc:creator>anoriginalidea</dc:creator>
<guid>http://anoriginalidea.wordpress.com/2009/08/27/sketchflow-duplicate-bug/</guid>
<description><![CDATA[&#160; &#160; The Problem At the moment I’m trialling Sketchflow for Expression Blend.&#160; There’s]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>&#160;</p>
<p><a href="http://anoriginalidea.files.wordpress.com/2009/08/image3.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://anoriginalidea.files.wordpress.com/2009/08/image_thumb3.png?w=244&#038;h=118" width="244" height="118" /></a> </p>
<p>&#160;</p>
<p><strong>The Problem</strong></p>
<p>At the moment I’m trialling Sketchflow for Expression Blend.&#160; There’s an annoying bug that happens when you use the “Duplicate” action on a node:</p>
<p><a href="http://anoriginalidea.files.wordpress.com/2009/08/image4.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://anoriginalidea.files.wordpress.com/2009/08/image_thumb4.png?w=406&#038;h=280" width="406" height="280" /></a> </p>
<p>If you use this action, sooner or later you’ll end up with this error:</p>
<p>‘InitializeComponent’ is not a member of ‘xxxxxxxxxx.xxxxxxxxxxxxxx’</p>
<p>This can be very frustrating if you are trying to advocate Sketchflow as a prototyping tool for non wpf savvy analysts.</p>
<p><strong>The Workaround</strong></p>
<p>The simplest workaround is to delete the code-behind file.&#160; To do this, go to the project pane and choose “Delete”.</p>
<p><a href="http://anoriginalidea.files.wordpress.com/2009/08/image5.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://anoriginalidea.files.wordpress.com/2009/08/image_thumb5.png?w=365&#038;h=234" width="365" height="234" /></a> </p>
<p>&#160;</p>
<p>At first I tried hard to ensure that the xaml filenames and classnames were correct.&#160; This just causes a cascading comedy of errors.</p>
<p>Upgrading Sketchflow prototype projects to real code is a pipe-dream at the moment.</p>
<p>If you know of a better way of handling this situation (and fixing the errors) more quickly, feel free to comment.&#160; I just want get on with the prototyping.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Chronos: &Uacute;ltimos cambios]]></title>
<link>http://carlosga.wordpress.com/2009/08/20/chronos-ltimos-cambios/</link>
<pubDate>Thu, 20 Aug 2009 18:40:29 +0000</pubDate>
<dc:creator>Carlos</dc:creator>
<guid>http://carlosga.wordpress.com/2009/08/20/chronos-ltimos-cambios/</guid>
<description><![CDATA[… que aún no están subidos en codeplex, pero bueno, … Uso del control Search TextBox de David Owens,]]></description>
<content:encoded><![CDATA[… que aún no están subidos en codeplex, pero bueno, … Uso del control Search TextBox de David Owens,]]></content:encoded>
</item>
<item>
<title><![CDATA[Chinch: Framework para el desarrollo de aplicaciones con Model-View-ViewModel]]></title>
<link>http://carlosga.wordpress.com/2009/08/19/chinch-framework-para-el-desarrollo-de-aplicaciones-con-model-view-viewmodel/</link>
<pubDate>Wed, 19 Aug 2009 10:17:36 +0000</pubDate>
<dc:creator>Carlos</dc:creator>
<guid>http://carlosga.wordpress.com/2009/08/19/chinch-framework-para-el-desarrollo-de-aplicaciones-con-model-view-viewmodel/</guid>
<description><![CDATA[Chinch es unframework para el desarrollo de aplicaciones utilizando Model-View-ViewModel, por lo que]]></description>
<content:encoded><![CDATA[Chinch es unframework para el desarrollo de aplicaciones utilizando Model-View-ViewModel, por lo que]]></content:encoded>
</item>
<item>
<title><![CDATA[Amazing Short Films from District 9 director Neill Blomkamp]]></title>
<link>http://team.pushbomb.com/2009/08/14/amazing_short_fillms_from_neill_blomkamp_director_district_9/</link>
<pubDate>Fri, 14 Aug 2009 14:14:00 +0000</pubDate>
<dc:creator>Damon Wilder Carr</dc:creator>
<guid>http://team.pushbomb.com/2009/08/14/amazing_short_fillms_from_neill_blomkamp_director_district_9/</guid>
<description><![CDATA[What we do: We empower your content with amazing user experience while helping you manage and publis]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div style="float:right;"><a title="Miro: Internet TV" href="http://www.miroguide.com/feeds/12323"><img class="alignright" style="border:0 none;display:inline;margin-left:10px;margin-right:10px;" src="http://subscribe.getmiro.com/img/buttons/wes1.png" border="0" alt="Miro Video Player" width="140" height="45" align="left" /></a></div>
<h3 style="clear:both;"><span style="font-size:xx-small;"><strong>What we do: </strong>We empower your content </span><span style="font-size:xx-small;">with amazing user experience while helping you manage and publish to the widest possible audience with minimal effort.</span></h3>
<h4><a href="http://media.tangentux.com/admin.htm"><img class="size-large wp-image-1844 aligncenter" title="Internet TV Studio 'In a Browser'" src="http://dcarr.wordpress.com/files/2009/08/tangentux.png?w=600" alt="Internet TV Studio 'In a Browser'" width="516" height="307" /></a></h4>
<h3><strong> </strong></h3>
<p style="padding-left:30px;"><strong> </strong></p>
<p style="padding-left:30px;"><strong> </strong></p>
<p>

<!-- TOS violation -->

</p>
<div><span style="font-size:xx-small;"> </span></div>
<p>

<!-- TOS violation -->

</p>
<ul>
<li>
<h4><span style="font-size:xx-small;">We have solved the data incompatibilities and you have one source for iTunes video podcasts, as well as all the <a href="http://en.wikipedia.org/wiki/Media_RSS">Media RSS</a> consumers. What you see in iTunes is using the same format for data we use internally, as well as inside <a href="http://www.boxee.com">Boxee </a>and the other major distribution channels</span></h4>
<ul>
<li>
<h4><span style="font-size:xx-small;">Oone <a href="http://en.wikipedia.org/wiki/Media_RSS">Media RSS</a> stream is driving everything you see as content here. We handle integrating with all of the complex metadata to seamless &#8216;just work&#8217; in almost any environment.<br />
</span></h4>
</li>
</ul>
</li>
<li>
<h4><span style="font-size:xx-small;">We are one of the first to support all existing HD and non-HD formats as well as the emerging and compelling <a href="http://www.iis.net/extensions/SmoothStreaming">Smooth Streaming </a>formats including <a href="http://memorabilia.hardrock.com/">Deep Zoom navigation</a> (click to see what the Hard Rock Cafe achieved)</span><span style="font-size:xx-small;">We are the first company to deliver this for live events combined with synchronized non-static data with auto-transition to on-demand content. <a href="http://smooth.s3.amazonaws.com/deepzoom.htm">See our example here</a></span></h4>
</li>
<li>
<h4><span style="font-size:xx-small;"> </span><span style="font-size:xx-small;">EXPONENTIAL speed improvements (via the cloud-integrated <a href="http://en.wikipedia.org/wiki/Content_Delivery_Network">Content Delivery Netwo</a></span><span style="font-size:xx-small;"><a href="http://en.wikipedia.org/wiki/Content_Delivery_Network">rk</a>)</span></h4>
</li>
<li>
<h4><span style="font-size:xx-small;"> </span><span style="font-size:xx-small;"><strong>High Definition</strong> is now possible for anyone at the levels previously reserved for a handful (Amazon-Google levels we bring to anyone)</span></h4>
</li>
<li></li>
</ul>
<p><span style="font-size:xx-small;">We integrate content encoding, Podcast management and distribution, <a href="http://en.wikipedia.org/wiki/Content_Delivery_Network">CDN deployment</a> for amazingly fast consumer speeds,  streaming media formats, new content creation, live presentation services, Synchronization &#8211; such as presentations with PowerPoint slide integration.</span></p>
<h4>We get you to global best-practices in media in minimal effort or cost</h4>
<h3><span style="font-size:xx-small;">Just explore what we publish such as our <a href="http://smooth.s3.amazonaws.com/featured.htm">District 9 </a>and <a href="http://smooth.s3.amazonaws.com/deepzoom.htm">DeepZoom</a> examples. And we are not a content provider (!). </span></h3>
<h3><span style="font-size:xx-small;"> </span></h3>
<p><span style="font-size:xx-small;">Imagine how fast and easy we can improve your exposure at nearly zero cost.</span></p>
<p><span style="font-size:xx-small;"> </span></p>
<p><span style="font-size:xx-small;"> </span></p>
<p><span style="font-size:xx-small;"> </span></p>
<div class="wlWriterHeaderFooter" style="margin:0;padding:0;">
<div class="shoutIt"><a rev="vote-for" href="http://dotnetshoutout.com/Submit?url=http%3a%2f%2fdcarr.wordpress.com%2f2009%2f08%2f14%2famazing_short_fillms_from_neill_blomkamp_director_district_9%2f&#38;title=Amazing+Short+Films+from+District+9+director+Neill+Blomkamp"><img style="border:0;" src="http://dotnetshoutout.com/image.axd?url=http://dcarr.wordpress.com/2009/08/14/amazing_short_fillms_from_neill_blomkamp_director_district_9/" alt="Shout it" /></a></div>
</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Chronos: Cambiando de estilo]]></title>
<link>http://carlosga.wordpress.com/2009/08/06/chronos-cambiando-de-estilo/</link>
<pubDate>Thu, 06 Aug 2009 20:50:57 +0000</pubDate>
<dc:creator>Carlos</dc:creator>
<guid>http://carlosga.wordpress.com/2009/08/06/chronos-cambiando-de-estilo/</guid>
<description><![CDATA[Llevo un par de dias buscando por internet iconos y fondos vectoriales para cambiar un el estilo de ]]></description>
<content:encoded><![CDATA[Llevo un par de dias buscando por internet iconos y fondos vectoriales para cambiar un el estilo de ]]></content:encoded>
</item>
<item>
<title><![CDATA[Database Project - World Mart using C# - WPF - Crystal Report - Skin Crafter - Oracle XE]]></title>
<link>http://tutorialpemrograman.wordpress.com/2009/07/30/database-project-world-mart-using-c-wpf-crystal-report-skin-crafter-oracle-xe/</link>
<pubDate>Thu, 30 Jul 2009 05:06:58 +0000</pubDate>
<dc:creator>Jeffrey Hermanto</dc:creator>
<guid>http://tutorialpemrograman.wordpress.com/2009/07/30/database-project-world-mart-using-c-wpf-crystal-report-skin-crafter-oracle-xe/</guid>
<description><![CDATA[Final Project Praktikum Basis Data 2009 Kel 29 World Mart – Sistem Informasi Hypermart IDE : C# with]]></description>
<content:encoded><![CDATA[Final Project Praktikum Basis Data 2009 Kel 29 World Mart – Sistem Informasi Hypermart IDE : C# with]]></content:encoded>
</item>
<item>
<title><![CDATA[Introduction to Windows Presentation Foundation]]></title>
<link>http://viralsarvaiya.wordpress.com/2009/07/27/introduction-to-windows-presentation-foundation/</link>
<pubDate>Mon, 27 Jul 2009 07:55:55 +0000</pubDate>
<dc:creator>viralsarvaiya</dc:creator>
<guid>http://viralsarvaiya.wordpress.com/2009/07/27/introduction-to-windows-presentation-foundation/</guid>
<description><![CDATA[Overview The Windows Presentation Foundation is Microsofts next generation UI framework to create ap]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h2>Overview</h2>
<p>The Windows Presentation Foundation is Microsofts next generation UI framework to create applications with a rich user experience. It is part of the .NET framework 3.0 and higher.</p>
<p>WPF combines application UIs, 2D graphics, 3D graphics, documents and multimedia into one single framework. Its vector based rendering engine uses hardware acceleration of modern graphic cards. This makes the UI faster, scalable and resolution independent.</p>
<p>The following illustration gives you an overview of the main new features of WPF</p>
<p><img style="padding:10px 10px 10px 120px;" src="http://www.wpftutorial.net/images/wpfMainFeatures.png" alt="" /></p>
<h2>Separation of Appearance and Behavior</h2>
<p>WPF separates the appearance of an user interface from its behavior. The appearance is generally specified in the <a href="http://www.wpftutorial.net/XAML.html">Extensible Application Markup Language</a> (XAML), the behavior is implemented in a managed programming language like C# or Visual Basic. The two parts are tied together by databinding, events and commands. The separation of appearance and behavior brings the following benefits:</p>
<ul>
<li>Appearance and behaviour are loosely coupled</li>
<li>Designers and developers can work on separate models.</li>
<li>Graphical design tools can work on simple XML documents instead of parsing code.</li>
</ul>
<h2>Rich composition</h2>
<p>Controls in WPF are extremely composable. You can define almost any type of controls as content of another. Although these flexibility sounds horrible to designers, its a very powerful feature if you use it appropriate. Put an image into a button to create an image button, or put a list of videos into a combobox to choose a video file.</p>
<p><img style="padding-left:150px;" src="http://www.wpftutorial.net/images/playsound_button.png" alt="" /></p>
<div>
<pre style="font-family:courier new,courier,monospace;"> 
<span style="color:#800000;"><span style="color:#800000;">&#60;Button<span style="color:#800000;">&#62;</span></span></span>
    <span style="color:#800000;"><span style="color:#800000;">&#60;StackPanel</span> <span style="color:#ff0000;">Orientation</span>=<span style="color:#0000ff;">"Horizontal"</span><span style="color:#800000;">&#62;</span></span>
        <span style="color:#800000;"><span style="color:#800000;">&#60;Image</span> <span style="color:#ff0000;">Source</span>=<span style="color:#0000ff;">"speaker.png"</span> <span style="color:#ff0000;">Stretch</span>=<span style="color:#0000ff;">"Uniform"</span><span style="color:#800000;">/&#62;</span></span>
        <span style="color:#800000;"><span style="color:#800000;">&#60;TextBlock</span> <span style="color:#ff0000;">Text</span>=<span style="color:#0000ff;">"Play Sound"</span> <span style="color:#800000;">/&#62;</span></span>
    <span style="color:#800000;"><span style="color:#800000;">&#60;/StackPanel<span style="color:#800000;">&#62;</span></span></span>
<span style="color:#800000;"><span style="color:#800000;">&#60;/Button<span style="color:#800000;">&#62;</span></span></span></pre>
</div>
<h2>Highly customizable</h2>
<p>Because of the strict separation of appearance and behavior you can easily change the look of a control. The concept of <a href="http://www.wpftutorial.net/Styles.html">styles</a> let you skin controls almost like CSS in HTML. <a href="http://www.wpftutorial.net/Templates.html">Templates</a> let you replace the entire appearance of a control.</p>
<p>The following example shows an default WPF button and a customized button.</p>
<p><img style="padding-left:100px;" src="http://www.wpftutorial.net/images/introduction_buttons.png" alt="" /></p>
<h2>Resolution independence</h2>
<p>All measures in WPF are logical units &#8211; not pixels. A logical unit is a 1/96 of an inch. If you increase the resolution of your screen, the user interface stays the same size &#8211; if just gets crispier. Since WPF builds on a vector based rendering engine its incredibly easy to build scaleable user interfaces.</p>
<p><img style="padding-left:120px;" src="http://www.wpftutorial.net/images/wpf_scaling.png" alt="" /></p>
<h1>How to create a simple WPF application</h1>
<h2>In Visual Studio 2008</h2>
<p>Open Visual Studio 2008 and choose &#8220;File&#8221;, &#8220;New&#8221;, &#8220;Project&#8230;&#8221; in the main menu. Choose &#8220;WPF Application&#8221; as project type.</p>
<p>Choose a folder for your project and give it a name. Then press &#8220;OK&#8221;</p>
<p><img style="padding:20px;" src="http://www.wpftutorial.net/images/hellowpf1.jpg" alt="" /></p>
<p>Visual Studio creates the project and automatically adds some files to the solution. A Window1.xaml and an App.xaml. The structure looks quite similar to WinForms, except that the <code>Window1.designer.cs</code> file is no longer code but it&#8217;s now declared in XAML as <code>Window1.xaml</code></p>
<p><img style="padding:20px 20px 20px 100px;" src="http://www.wpftutorial.net/images/hellowpf2.jpg" alt="" /></p>
<p>Open the <code>Window1.xaml</code> file in the WPF designer and drag a Button and a TextBox from the toolbox to the Window</p>
<p><img style="padding:20px;" src="http://www.wpftutorial.net/images/hellowpf3.jpg" alt="" /></p>
<p>Select the Button and switch to the event view in the properties window (click on the little yellow lightning icon). Doubleclick on the &#8220;Click&#8221; event to create a method in the codebehind that is called, when the user clicks on the button.</p>
<p><strong>Note: If you do not find a yellow lightning icon, you need to install the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&#38;displaylang=de">Service Pack 1 for VisualStudio</a> on your machine. Alternatively you can doubleclick on the button in the designer to achieve the same result.</strong></p>
<p><img style="padding:20px 20px 20px 100px;" src="http://www.wpftutorial.net/images/hellowpf4.jpg" alt="" /></p>
<p>Visual Studio automatically creates a method in the code-behind file that gets called when the button is clicked.</p>
<div>
<pre style="font-family:courier new,courier,monospace;"> 
<span style="color:#0600ff;font-weight:bold;">private</span> <span style="color:#0600ff;font-weight:bold;">void</span> button1_Click<span style="color:#000000;">(</span><span style="color:#2b91af;font-weight:bold;">object</span> sender, RoutedEventArgs e<span style="color:#000000;">)</span>
<span style="color:#000000;">{</span>
    textBox1.<span style="color:#0000ff;">Text</span> <span style="color:#008000;">=</span> <span style="color:#666666;">"Hello WPF!"</span>;
<span style="color:#000000;">}</span></pre>
</div>
<p>The textbox has automatically become assigned the name <code>textBox1</code> by the WPF designer. Set text Text to &#8220;Hello WPF!&#8221; when the button gets clicked and we are done!. Start the application by hit [F5] on your keyboard.</p>
<p><img style="padding:20px;" src="http://www.wpftutorial.net/images/hellowpf5.jpg" alt="" /></p>
<p>Isn&#8217;t this cool!</p>
<p>Learn PWF click <a href="http://www.wpftutorial.net/LearnWPFin14Days.html" target="_blank">here</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Understanding Dependency Property]]></title>
<link>http://nnish.com/2009/07/23/understanding-dependency-property/</link>
<pubDate>Thu, 23 Jul 2009 16:55:41 +0000</pubDate>
<dc:creator>nnish</dc:creator>
<guid>http://nnish.com/2009/07/23/understanding-dependency-property/</guid>
<description><![CDATA[Everyone who get introduced to Windows Presentation Foundation(WPF) are familiar with this term. But]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Everyone who get introduced to Windows Presentation Foundation(WPF) are familiar with this term. But lot many get confused on it or never get what it is. I will try and make this post very simple so that it is easier to understand. My intentions are not to provide the complete technical stuff behind the Dependency property, but to keep things simple to understand and to get started. You should probably work on this lot many times to understand it better.</p>
<p>If you are not new to .net or any other OOP language, you are not new to Property. Dependency property was introduced in .net 3.0 and it is all together new implementation of normal properties. Dependency property differ in terms of its storage mechanism, it uses Sparse Storage and its implementation saves per-instance memory compared to a typical .NET property. However benefits of dependency property is more than just storage. One of the significances of Dependency property is its support for notification change – that means any change in the value of the property is notified down the element tree in WPF. This point particularly becomes very important to understand this.</p>
<p>Before I completely get on with Dependency property, let me give a gist of what attached property is. Let me explain this in a way a lay man understands: Consider a <em><strong>“&#60;Canvas&#62;&#60;/Canvas&#62;”</strong></em> element in your XAML. Now if you want to add a child element <em><strong>“&#60;TextBlock&#62;”</strong></em> to it, how do you place them in the canvas? – Here it is:</p>
<p><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Canvas</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#62;<br />
</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">       &#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">TextBlock</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Canvas.Top</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;100&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Canvas.Left</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;100&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Text</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;Hello World&#8221;/&#62;<br />
</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;/</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Canvas</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#62;</span></span></p>
<p>OR an example with a Grid</p>
<p><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Grid</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#62;<br />
</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">   &#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Grid.ColumnDefinitions</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#62;<br />
</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">      &#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">ColumnDefinition</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">/&#62;<br />
</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">      &#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">ColumnDefinition</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">/&#62;<br />
</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">   &#60;/</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Grid.ColumnDefinitions</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#62;<br />
</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">   &#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Grid.RowDefinitions</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#62;<br />
      </span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">RowDefinition</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">/&#62;<br />
       </span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">RowDefinition</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">/&#62;<br />
</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">   &#60;/</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Grid.RowDefinitions</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#62;<br />
   </span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">TextBlock</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Grid.Column</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;0&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Grid.Row</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;0&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Text</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;Hello World  1&#8243;/&#62;<br />
   </span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">TextBlock</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Grid.Column</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;1&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Grid.Row</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;0&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Text</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;Hello World 2&#8243;/&#62;<br />
   </span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">TextBlock</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Grid.Column</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;0&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Grid.Row</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;1&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Text</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;Hello World 3&#8243;/&#62;<br />
   </span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">TextBlock</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Grid.Column</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;1&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Grid.Row</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;1&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Text</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;Hello World 4&#8243;/&#62;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;"> <br />
 </span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;/</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Grid</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#62;</span></span></p>
<p>So what we do is we set the Canvas’s Top and Left property in the TextBlock child element or even the Grid’s Column and Row property in the child elements. This is achieved using attached property.</p>
<blockquote><p>So here is the MSDN explanation: <em>“An attached property is intended to be used as a type of global property that is settable on any object. One purpose of an attached property is to allow different child elements to specify unique values for a property that is actually defined in a parent element.” </em></p></blockquote>
<p>In the above example, we see the property element of a parent is changed by the child, and the same gets reflected throughout the child elements. I have explained this so that you don’t confuse attached property with dependency property.</p>
<p>Let us extend couple of lines of code more and now understand dependency property.</p>
<p>And here it is:</p>
<p><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Canvas</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#62;<br />
</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Slider</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Canvas.Top</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;10&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Canvas.Left</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;10&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Name</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;MySlider&#8221;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Minimum</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;10&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Maximum</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;1000&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Ticks</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;100&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Width</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;300&#8243;/&#62;<br />
</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;"> </span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Ellipse</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Canvas.Top</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;130&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Canvas.Left</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;150&#8243;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Width</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;{</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Binding</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> ElementName</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=MySlider,</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Path</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=Value}&#8221;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Height</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;{</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Binding</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> ElementName</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=MySlider,</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Path</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=Value}&#8221;</span></span><span style="font-size:x-small;color:#ff0000;"><span style="font-size:x-small;color:#ff0000;"> Fill</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">=&#8221;Red&#8221;/&#62;<br />
</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;"> </span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#60;/</span></span><span style="font-size:x-small;color:#a31515;"><span style="font-size:x-small;color:#a31515;">Canvas</span></span><span style="font-size:x-small;color:#0000ff;"><span style="font-size:x-small;color:#0000ff;">&#62;</span></span></p>
<p>The output of the above example is: When the slider is moved, automatically the ellipse gets larger or smaller based on the value of the slider. So what we understand from this is without writing event handlers or any code behind to handle the slider movement and the ellipse height and width setters &#8211; we achieve this. This is because the property “Value” of the slider is a dependency property and it notifies the change to all the elements in the XAML, and since the Ellipse’s width and height are bound to the “Slider.Value” it automatically reflects the change.</p>
<p>This was just an introduction, there are couple of more things I want to cover like &#8211; creating your own dependency properties for the custom controls etc, which will be updated in the next post.</p>
<p>Cheers!</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
