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

<channel>
	<title>{Dev Tricks} &#187; silverlight</title>
	<atom:link href="http://dev-tricks.net/category/code/silverlight/feed" rel="self" type="application/rss+xml" />
	<link>http://dev-tricks.net</link>
	<description>Blogging developper tips and tricks</description>
	<lastBuildDate>Sun, 11 Dec 2011 11:54:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Silverlight Tutorial &#8211; Flashlight Tutorial</title>
		<link>http://dev-tricks.net/silverlight-flashlight-tutorial</link>
		<comments>http://dev-tricks.net/silverlight-flashlight-tutorial#comments</comments>
		<pubDate>Mon, 19 Jan 2009 20:48:13 +0000</pubDate>
		<dc:creator>Antoine Angot</dc:creator>
				<category><![CDATA[Blend]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[blend]]></category>

		<guid isPermaLink="false">http://dev-tricks.net/?p=80</guid>
		<description><![CDATA[How to make a flashlight effect with silverlight ? &#160; &#160; &#160; &#160; What you need : &#160; be familiar with Blend be familiar with Visual Studio half an hour &#160; &#160; &#160; Introduction &#160; Many years ago, a friend &#8230; <a href="http://dev-tricks.net/silverlight-flashlight-tutorial">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>How to make a flashlight effect with silverlight ?<br />
&nbsp;<br />
&nbsp;<br />
<iframe frameborder="no" height="300" width="400" src="http://code.dev-tricks.net/flashlight/Default.html"></iframe><br />
&nbsp;<br />
&nbsp;<br />
<span id="more-80"></span></p>
<ul>
<strong>What you need :</strong><br />
&nbsp;</p>
<li> be familiar with Blend</li>
<li> be familiar with Visual Studio</li>
<li> half an hour</li>
</ul>
<ul>
&nbsp;<br />
&nbsp;<br />
&nbsp;</p>
<h3>Introduction</h3>
<p>&nbsp;<br />
Many years ago, a friend taught me <strong>how to make a flash light effect with flash</strong>.<br />
You probably saw it in many <a href="http://code.dev-tricks.net/flashlight/swf.swf">tutorials</a>.<br />
&nbsp;<br />
&nbsp;<br />
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="250"><param name="movie" value="http://code.dev-tricks.net/flashlight/swf.swf"><param name="quality" value="high"><embed src="http://www.newtutorials.com/flashlight/flashlight-6.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="250"></embed></object><br />
&nbsp;<br />
Today, we will try to do better with silverlight :)</p>
<p>&nbsp;<br />
&nbsp;<br />
&nbsp;</p>
<h3>The Blend Part</h3>
<p>&nbsp;</p>
<ol>
<h4>Create a new project</h4>
</ol>
<p>&nbsp;<br />
<img src="http://dev-tricks.net/wp-content/uploads/2009/01/1-300x181.jpg" alt="I’m doing it with Blend, but you can use Visual Studio if you want. " title="Create a silverlight project" width="400" class="size-medium wp-image-132" /></p>
<ol>
<em>I&#8217;m doing it with Blend, but you can use Visual Studio if you want. </em></ol>
<p>&nbsp;<br />
&nbsp;</p>
<ol>
<h4>Add an image</h4>
</ol>
<p>&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/a.JPG" width="200"></p>
<ol>
<em>Add it to the project.</em></ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/2.JPG"></p>
<ol>
<em>Resize the image to give it the same size that the LayoutRoot</em></ol>
<p>&nbsp;<br />
&nbsp;</p>
<ol>
<h4>Draw a rectangle</h4>
</ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/b.JPG" width="200"></p>
<ol>
<em>select the tool</em></ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/3.JPG" width="400"></p>
<ol>
<em>You should get this.</em></ol>
<p>&nbsp;<br />
&nbsp;</p>
<ol>
<h4>Gradient Brush and Radial Gradient</h4>
</ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/c.JPG"></p>
<ol>
<em>Set up the rectangle background as a gradientbrush</em></ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/d.JPG"></p>
<ol>
<em>And click on the radial gradient option</em></ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/4.JPG"></p>
<ol>
<em>You rectangle should look like this.</em></ol>
<p>&nbsp;<br />
&nbsp;</p>
<ol>
<h4>Transparency</h4>
</ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/e.JPG"></p>
<ol>
<em>Set the first gradiant to black</em></ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/f.JPG"></p>
<ol>
<em>For the other one, same color but set transparenrcy to half</em></ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/5.JPG"></p>
<ol>
<em>We begin to see the final result</em></ol>
<ol>
&nbsp;<br />
&nbsp;</p>
<h4>Draw your Flashlight</h4>
</ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/g.JPG"></p>
<ol>
<em>Play with gradiant and try to make something which looks like a light.</em></ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/6.JPG"></p>
<ol>
<em>Here is the artistical part :)</em></ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/h.JPG"></p>
<ol>
<em>Well, i think i&#8217;m fine.</em></ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/7.JPG"></p>
<ol>
<em>For me, it looks like this.</em></ol>
<p>&nbsp;<br />
&nbsp;</p>
<ol>
<h4>Transform the Brush</h4>
</ol>
<p>&nbsp;<br />
&nbsp;<br />
if you want to be able to move, you have to enlarge the brush.<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/i.JPG"></p>
<ol>
<em>Select the &#8220;Brush Transform&#8221; tool.</em></ol>
<p>&nbsp;<br />
&nbsp;<br />
<img src="http://code.dev-tricks.net/flashlight/8.JPG"></p>
<ol>
<em>Resize the brush to about one and half.</em></ol>
<p>&nbsp;<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;</p>
<h3>The Visual Studio part</h3>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Ok this part is ridiculous you have to add a method in FlashLight.xaml.cs to register mouse move.<br />
&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">namespace</span> FlashLight
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">partial</span> <span style="color: #6666cc; font-weight: bold;">class</span> Page <span style="color: #008000;">:</span> UserControl
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> Page<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">// Required to initialize variables</span>
            InitializeComponent<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            LayoutRoot<span style="color: #008000;">.</span><span style="color: #0000FF;">MouseMove</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> MouseEventHandler<span style="color: #008000;">&#40;</span>LayoutRoot_MouseMove<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #6666cc; font-weight: bold;">void</span> LayoutRoot_MouseMove<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, MouseEventArgs e<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            Point newPosition <span style="color: #008000;">=</span> e<span style="color: #008000;">.</span><span style="color: #0000FF;">GetPosition</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            RadialGradientBrush radialGradient <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span>RadialGradientBrush<span style="color: #008000;">&#41;</span>Light<span style="color: #008000;">.</span><span style="color: #0000FF;">Fill</span><span style="color: #008000;">;</span>
            radialGradient<span style="color: #008000;">.</span><span style="color: #0000FF;">GradientOrigin</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Point<span style="color: #008000;">&#40;</span>newPosition<span style="color: #008000;">.</span><span style="color: #0000FF;">X</span> <span style="color: #008000;">/</span> <span style="color: #FF0000;">640</span>, newPosition<span style="color: #008000;">.</span><span style="color: #0000FF;">Y</span> <span style="color: #008000;">/</span> <span style="color: #FF0000;">400</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            Light<span style="color: #008000;">.</span><span style="color: #0000FF;">Fill</span> <span style="color: #008000;">=</span> radialGradient<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>&nbsp;<br />
&nbsp;<br />
&nbsp;</p>
<h3>Conclusion</h3>
<p>&nbsp;<br />
&nbsp;<br />
Actually, i&#8217;m pretty sure that you can do the same with the last version of Flash but this tutorial is a good exercise to practice with Blend.<br />
Thanks for reading. You can download the <strong> source code </strong> <a href="http://code.dev-tricks.net/flashlight/FlashLight.zip">here</a>.<br />
&nbsp;<br />
&nbsp;
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.net/silverlight-flashlight-tutorial/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Silverlight Custom Control &#8211; I</title>
		<link>http://dev-tricks.net/silverlight-custom-control-i</link>
		<comments>http://dev-tricks.net/silverlight-custom-control-i#comments</comments>
		<pubDate>Wed, 14 Jan 2009 16:31:49 +0000</pubDate>
		<dc:creator>Julien Palard</dc:creator>
				<category><![CDATA[silverlight]]></category>
		<category><![CDATA[silverlight control]]></category>

		<guid isPermaLink="false">http://dev-tricks.net/?p=76</guid>
		<description><![CDATA[This article is my first about creating Custom Controls in Silverlight 2. So let&#8217;s build a simple one : You need : A .cs file, named with your new Custom Control name A directory named Themes A generic.xaml file in &#8230; <a href="http://dev-tricks.net/silverlight-custom-control-i">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This article is my first about creating Custom Controls in Silverlight 2.<br />
So let&#8217;s build a simple one :<br />
You need :</p>
<ul>
<li>A .cs file, named with your new Custom Control name</li>
<li>A directory named Themes</li>
<li>A generic.xaml file in it (just delete generic.xaml.cs if it was created)</li>
</ul>
<p><span id="more-76"></span></p>
<p><img src="http://code.dev-tricks.net/custom_control_1/EditableTextBlock.jpg" alt="Silverlight Custom Control Tree in Visual Studio" /></p>
<p>A basic custom control .cs file (the logic part):</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">&nbsp;
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Windows.Controls</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> Custom_Control_1
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> EditableTextBlock <span style="color: #008000;">:</span> Control
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> EditableTextBlock<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            DefaultStyleKey <span style="color: #008000;">=</span> <span style="color: #008000;">typeof</span><span style="color: #008000;">&#40;</span>EditableTextBlock<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>A basic custom control generic.xaml file (the graphic part):</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ResourceDictionary</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:x</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:controls</span>=<span style="color: #ff0000;">&quot;clr-namespace:Custom_Control_1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Style</span> <span style="color: #000066;">TargetType</span>=<span style="color: #ff0000;">&quot;controls:EditableTextBlock&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Template&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Setter.Value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ControlTemplate</span> <span style="color: #000066;">TargetType</span>=<span style="color: #ff0000;">&quot;controls:EditableTextBlock&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Grid</span> <span style="color: #000066;">Background</span>=<span style="color: #ff0000;">&quot;AliceBlue&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Grid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ControlTemplate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Setter.Value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Setter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ResourceDictionary<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now, to test, you need to add the xmlns of your namespace, and add the usercontrol :</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;UserControl</span> <span style="color: #000066;">x:Class</span>=<span style="color: #ff0000;">&quot;Custom_Control_1.Page&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns:x</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns:ctrl</span>=<span style="color: #ff0000;">&quot;clr-namespace:Custom_Control_1&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;400&quot;</span> <span style="color: #000066;">Height</span>=<span style="color: #ff0000;">&quot;300&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Grid</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;LayoutRoot&quot;</span> <span style="color: #000066;">Background</span>=<span style="color: #ff0000;">&quot;White&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ctrl:EditableTextBlock<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/ctrl:EditableTextBlock<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Grid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/UserControl<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>In the next article, we&#8217;ll see how to bind properties with TemplateBinding.<br />
Don&#8217;t forgot to read the MSDN !</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.net/silverlight-custom-control-i/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to make a fake 3D Storyboard with Expression Blend</title>
		<link>http://dev-tricks.net/fake-3d-with-blend</link>
		<comments>http://dev-tricks.net/fake-3d-with-blend#comments</comments>
		<pubDate>Sun, 24 Aug 2008 23:41:34 +0000</pubDate>
		<dc:creator>Antoine Angot</dc:creator>
				<category><![CDATA[Blend]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[blend]]></category>
		<category><![CDATA[how to]]></category>

		<guid isPermaLink="false">http://dev-tricks.net/?p=29</guid>
		<description><![CDATA[In this &#8220;how to&#8221; i will show you how to make a StoryBoard like this: This is not hard but you have to be famialiar with Blend. download this video]]></description>
			<content:encoded><![CDATA[<p>In this &#8220;how to&#8221; i will show you how to make a StoryBoard like this:</p>
<p><iframe frameborder="no" height="250" src="http://code.dev-tricks.net/TutoBlend1.html"></iframe></p>
<p>This is not hard but you have to be famialiar with Blend.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/y0xd_R141ys&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/y0xd_R141ys&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><a href="http://media.dev-tricks.net/TutoBlend1.zip">download this video</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.net/fake-3d-with-blend/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight &#8211; Password field no longer missing</title>
		<link>http://dev-tricks.net/silverlight-password-field-no-longer-missing</link>
		<comments>http://dev-tricks.net/silverlight-password-field-no-longer-missing#comments</comments>
		<pubDate>Thu, 14 Aug 2008 16:52:38 +0000</pubDate>
		<dc:creator>Julien Palard</dc:creator>
				<category><![CDATA[silverlight]]></category>
		<category><![CDATA[password]]></category>

		<guid isPermaLink="false">http://dev-tricks.net/?p=8</guid>
		<description><![CDATA[EDIT : There&#8217;s now a real PasswordField, our tricks is no longer needed, just read : http://silverlight.net/blogs/msnow/archive/2008/09/29/silverlight-tip-of-the-day-47-how-to-implement-a-password-box.aspx Everybody developping in Silverlight knows that there&#8217;s no password textbox, and some of us rewrite a UserControl to replace it&#8230; yeark !! There&#8217;s &#8230; <a href="http://dev-tricks.net/silverlight-password-field-no-longer-missing">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>EDIT : There&#8217;s now a real PasswordField, our tricks is no longer needed, just read :<br />
<a href="http://silverlight.net/blogs/msnow/archive/2008/09/29/silverlight-tip-of-the-day-47-how-to-implement-a-password-box.aspx">http://silverlight.net/blogs/msnow/archive/2008/09/29/silverlight-tip-of-the-day-47-how-to-implement-a-password-box.aspx</a></p>
<p>Everybody developping in Silverlight knows that there&#8217;s no password textbox, and some of us rewrite a UserControl to replace it&#8230; yeark !!<br />
There&#8217;s a so simple way to create a password textbox :<br />
Use a TextBox and change the font with a home made font in which all characters are &#8216;*&#8217; &#8230;<br />
0 lines of code, do it in XAML</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextBox</span> <span style="color: #000066;">FontFamily</span>=<span style="color: #ff0000;">&quot;password.ttf#Password&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>FontFamily can download a file and pick a font from this file, the syntaxe is given &#8220;file.ttf#fontname&#8221; in my password.ttf the font name is &#8220;Password&#8221;, with the .ttf have to be in your ClientBin (relatives or absolute URI can be used with nothing, the root directory is checked, so put it in your ClientBin)<br />
According to TimHeuer&#8217;s comment, after beta 2, embedding fonts will not work with this way, so watch his video <a href="http://silverlight.net/learn/learnvideo.aspx?video=69800">Using custom fonts in silverlight</a> to do it with the right way :)</p>
<p>Dont want to create a .ttf ? download mine. <a href="http://code.dev-tricks.net/password.ttf">password.ttf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.net/silverlight-password-field-no-longer-missing/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

