<?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>Tweened &#187; Tweened</title>
	<atom:link href="http://www.tweened.org/fr/category/tweened/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tweened.org</link>
	<description>powered by Silverlight</description>
	<lastBuildDate>Wed, 14 Dec 2011 16:38:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Grid extension [Extension]</title>
		<link>http://www.tweened.org/fr/2011/04/04/grid-extension-extension/</link>
		<comments>http://www.tweened.org/fr/2011/04/04/grid-extension-extension/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 05:00:58 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Composants]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tweened]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[Extension]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/?p=1047</guid>
		<description><![CDATA[

Il est très souvent utile d'agrandir un panneau spécifique au sein d'une application. J'ai réalisé une extension à base de propriétés attachées qui permet très simplement de maximiser des éléments au sein d'un conteneur de type Grid. Voici un exemple d'éléments contenus au sein d'une grille.

Pour cela, il suffit tout d'abord de spécifier que la [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p><a href="http://www.tweened.org/wp-content/files/captureGridEx.jpg" title="captureGridEx" rel="lightbox[1047]"><img class="aligncenter size-full wp-image-1070" title="captureGridEx" src="http://www.tweened.org/wp-content/files/captureGridEx.jpg" alt="" width="630" height="200" /></a></p>
<p>Il est très souvent utile d'agrandir un panneau spécifique au sein d'une application. J'ai réalisé une extension à base de propriétés attachées qui permet très simplement de maximiser des éléments au sein d'un conteneur de type Grid. Voici un exemple d'éléments contenus au sein d'une grille.</p>
<p><a href="http://www.tweened.org/wp-content/files/CaptureGridExtension.jpg" title="CaptureGridExtension" rel="lightbox[1047]"><img class="aligncenter size-full wp-image-1069" title="CaptureGridExtension" src="http://www.tweened.org/wp-content/files/CaptureGridExtension.jpg" alt="" width="456" height="374" /></a></p>
<p>Pour cela, il suffit tout d'abord de spécifier que la grille peut maximiser ces enfants. Ensuite chaque enfant peut être maximiser via l'utilisation d'un bouton sur lequel vous définissez la cible de l'agrandissement. La transition est un fondu entre le visuel de départ et celui d'arrivée. La durée de la transition, exprimée sous forme de millisecondes, peut être configurée. Durant celle-ci et jusqu'à sa fin, le contenu de la grille n'est plus interactif. La capture ci-dessous illustre les différentes méthodologies et possibilités en terme de code XAML.</p>
<p><a href="http://www.tweened.org/wp-content/files/captureGridCode.jpg" title="captureGridCode" rel="lightbox[1047]"><img class="aligncenter size-full wp-image-1068" title="captureGridCode" src="http://www.tweened.org/wp-content/files/captureGridCode.jpg" alt="" width="630" height="589" /></a></p>
<p>Voici l'exemple ci-dessous en fonctionnement.<br />
<div id="silverlightControlHost"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="630" height="400"><param name="source" value="http://www.tweened.org/wp-content/files/xapFiles/TestGridExtensions.xap"/><param name="windowless" value="true"/><param name="background" value="#00FFFFFF" /><param name="minRuntimeVersion" value="3.0.40818.0" /><param name="autoupgrade" value="true" /><param name="enableHtmlAccess" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156" style="text-decoration: none;"><img src="http://storage.timheuer.com/sl4wp-ph.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/></a></object><iframe style="visibility:hidden;height:0;width:0;border:0px" id="_sl_historyFrame"></iframe></div><br /></p>
<p>je mets cette extension en téléchargement <a href="http://www.tweened.org/wp-content/files/xapFiles/GridMaximizeExtension.cs">ici</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2011/04/04/grid-extension-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClipToBound Behavior [Extension]</title>
		<link>http://www.tweened.org/fr/2011/03/30/cliptobound-behavior-extension/</link>
		<comments>http://www.tweened.org/fr/2011/03/30/cliptobound-behavior-extension/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 05:08:26 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Composants]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tweened]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[Extension]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/?p=1049</guid>
		<description><![CDATA[
Comme beaucoup d'autres petits détails, vous aurez sans aucun doute remarqué qu'il n'est pas possible de définir la propriété ClipToBounds dans Silverlight contrairement à WPF. Autrement dit, vous ne pouvez pas faire en sorte qu'un objet contenu dans un autre ne dépasse pas des limites de son parent sauf si cela est prévu nativement. Comme [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p><a href="http://www.tweened.org/wp-content/files/captureClippingIllust.jpg" title="captureClippingIllust" rel="lightbox[1049]"><img class="aligncenter size-full wp-image-1073" title="captureClippingIllust" src="http://www.tweened.org/wp-content/files/captureClippingIllust.jpg" alt="" width="630" height="200" /></a>Comme beaucoup d'autres petits détails, vous aurez sans aucun doute remarqué qu'il n'est pas possible de définir la propriété ClipToBounds dans Silverlight contrairement à WPF. Autrement dit, vous ne pouvez pas faire en sorte qu'un objet contenu dans un autre ne dépasse pas des limites de son parent sauf si cela est prévu nativement. Comme d'habitude, la solution consiste à créer une extension ou un comportement. J'ai fais une propriété attachée ainsi qu'un comportement qui facilitent cette mise en oeuvre.</p>
<p><a href="http://www.tweened.org/wp-content/files/captureCodeClipToBounds.jpg" title="captureCodeClipToBounds" rel="lightbox[1049]"><img class="aligncenter size-full wp-image-1074" title="captureCodeClipToBounds" src="http://www.tweened.org/wp-content/files/captureCodeClipToBounds.jpg" alt="" width="580" height="242" /></a>Voici une copie d'écran réalisée sous Blend.</p>
<p><a href="http://www.tweened.org/wp-content/files/CaptureClipToBounds.jpg" title="CaptureClipToBounds" rel="lightbox[1049]"><img class="aligncenter size-full wp-image-1075" title="CaptureClipToBounds" src="http://www.tweened.org/wp-content/files/CaptureClipToBounds.jpg" alt="" width="445" height="338" /></a></p>
<p>Et voici le code très simpliste qui permet de créer cet effet via une AttachedProperty :</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">class</span> ClippingExtension
    <span style="color: #000000;">&#123;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">bool</span> GetClipToBounds<span style="color: #000000;">&#40;</span>DependencyObject obj<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">bool</span><span style="color: #000000;">&#41;</span>obj.<span style="color: #0000FF;">GetValue</span><span style="color: #000000;">&#40;</span>ClipToBoundsProperty<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> SetClipToBounds<span style="color: #000000;">&#40;</span>DependencyObject obj, <span style="color: #FF0000;">bool</span> value<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            obj.<span style="color: #0000FF;">SetValue</span><span style="color: #000000;">&#40;</span>ClipToBoundsProperty, value<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// Using a DependencyProperty as the backing store for ClipToBounds.  This enables animation, styling, binding, etc...</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">readonly</span> DependencyProperty ClipToBoundsProperty <span style="color: #008000;">=</span>
            DependencyProperty.<span style="color: #0000FF;">RegisterAttached</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;ClipToBounds&quot;</span>, <span style="color: #008000;">typeof</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">bool</span><span style="color: #000000;">&#41;</span>, <span style="color: #008000;">typeof</span><span style="color: #000000;">&#40;</span>FrameworkElement<span style="color: #000000;">&#41;</span>, <span style="color: #008000;">new</span> PropertyMetadata<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">false</span>,OnClipToBoundsChanged<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
&nbsp;
        <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> OnClipToBoundsChanged <span style="color: #000000;">&#40;</span>DependencyObject d, DependencyPropertyChangedEventArgs e<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            FrameworkElement f <span style="color: #008000;">=</span> d <span style="color: #0600FF;">as</span> FrameworkElement<span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>f <span style="color: #008000;">==</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                return<span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">System</span>.<span style="color: #0000FF;">Convert</span>.<span style="color: #0000FF;">ToBoolean</span><span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">NewValue</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                f.<span style="color: #0000FF;">SizeChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> SizeChangedEventHandler<span style="color: #000000;">&#40;</span>f_SizeChanged<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                RectangleGeometry rg <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> RectangleGeometry<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                rg.<span style="color: #0000FF;">Rect</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Rect<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> Width <span style="color: #008000;">=</span> f.<span style="color: #0000FF;">ActualWidth</span>, Height <span style="color: #008000;">=</span> f.<span style="color: #0000FF;">ActualHeight</span> <span style="color: #000000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
                f.<span style="color: #0000FF;">Clip</span> <span style="color: #008000;">=</span> rg<span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
            <span style="color: #0600FF;">else</span>
            <span style="color: #000000;">&#123;</span>
                f.<span style="color: #0000FF;">SizeChanged</span> <span style="color: #008000;">-=</span> <span style="color: #008000;">new</span> SizeChangedEventHandler<span style="color: #000000;">&#40;</span>f_SizeChanged<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                f.<span style="color: #0000FF;">Clip</span> <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> f_SizeChanged<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, SizeChangedEventArgs e<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            FrameworkElement f <span style="color: #008000;">=</span> sender <span style="color: #0600FF;">as</span> FrameworkElement<span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>f <span style="color: #008000;">==</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                return<span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            RectangleGeometry rg <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> RectangleGeometry<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            rg.<span style="color: #0000FF;">Rect</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Rect<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> Width<span style="color: #008000;">=</span>f.<span style="color: #0000FF;">RenderSize</span>.<span style="color: #0000FF;">Width</span>, Height<span style="color: #008000;">=</span>f.<span style="color: #0000FF;">RenderSize</span>.<span style="color: #0000FF;">Height</span> <span style="color: #000000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
            f.<span style="color: #0000FF;">Clip</span> <span style="color: #008000;">=</span> rg<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2011/03/30/cliptobound-behavior-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RangedSlider [Custom Control]</title>
		<link>http://www.tweened.org/fr/2011/03/29/rangedslider-custom-control/</link>
		<comments>http://www.tweened.org/fr/2011/03/29/rangedslider-custom-control/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 04:03:28 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Composants]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tweened]]></category>
		<category><![CDATA[custom control]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/?p=1003</guid>
		<description><![CDATA[

J'ai récemment eu besoin d'utiliser un Slider avec deux thumbs, certaines librairies le proposent, mais de manière générale, je ne les trouve pas simple à "templatiser". N'en ayant pas trouver d'adéquat à télécharger, je l'ai codé et je le fournirai en version finale avec la prochaine version de la librairie Tweened. Le look du contrôle [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p><a href="http://www.tweened.org/wp-content/files/capture22.jpg" title="capture2" rel="lightbox[1003]"><img class="aligncenter size-full wp-image-995" title="capture2" src="http://www.tweened.org/wp-content/files/capture22.jpg" alt="" width="630" height="260" /></a><br />
J'ai récemment eu besoin d'utiliser un Slider avec deux thumbs, certaines librairies le proposent, mais de manière générale, je ne les trouve pas simple à "templatiser". N'en ayant pas trouver d'adéquat à télécharger, je l'ai codé et je le fournirai en version finale avec la prochaine version de la librairie Tweened. Le look du contrôle n'est pas terminé. Un RangeSlider permet de filtrer ou de définir une plage de valeur. Cela peut être du double, des DateTime (ou tout autre type à l'aide d'un converter).<br />
Le contrôle fourni ne propose pour l'instant que le mode horizontal mais je prévois la version avec affichage verticale. Il est possible de définir le mode d'update de la propriété Value durant le drag ou lors du relâché. Cela est très utile lorsque vous souhaitez éviter un rafraichissement trop fréquent coté Vue-Modèle par exemple. Coté intégration graphique, c'est exactement la même procédure que pour le slider classique et donc assez facile à personnaliser.</p>
<p><div class="silverlightControlHost"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="640" height="260" style='outline:none'>
<param name="source" value="http://www.tweened.org/wp-content/plugins/silverlight-gallery/ClientBin/pluginSL.xap"/>
<param name="background" value="transparent" />
<param name="windowless" value="1" />
<param name="minRuntimeVersion" value="3.0.40723.0" />
<param name="initParams" value="GalleryUrl=http://www.tweened.org/wp-content/plugins/silverlight-gallery/image_xml.php?id=1003,
	 leftArrow=true, 
	rightArrow=true, 
	pageNumbers=true, 
	thumbnails=true, 
	fill=uniform" />
<param name="autoupgrade" value="true" />
<param name="enableHtmlAccess" value="true" /><param name="splashscreensource" value="http://www.tweened.org/wp-content/plugins/silverlight-gallery/ClientBin/preloadSL.xaml" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=3.0.40624.0" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object></div></p>
<p>Voici une exemple.<br />
<div id="silverlightControlHost"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="630" height="200"><param name="source" value="http://www.tweened.org/wp-content/files/xapFiles/TestRangedSlider.xap"/><param name="windowless" value="true"/><param name="background" value="#00FFFFFF" /><param name="minRuntimeVersion" value="3.0.40818.0" /><param name="autoupgrade" value="true" /><param name="enableHtmlAccess" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156" style="text-decoration: none;"><img src="http://storage.timheuer.com/sl4wp-ph.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/></a></object><iframe style="visibility:hidden;height:0;width:0;border:0px" id="_sl_historyFrame"></iframe></div><br /><br />
Vous pouvez télécharger le projet <a href="http://www.tweened.org/wp-content/files/xapFiles/TestRangedSlider.zip">ici</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2011/03/29/rangedslider-custom-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yet Another FlipControl [Custom Control]</title>
		<link>http://www.tweened.org/fr/2011/03/18/yet-another-flipcontrol/</link>
		<comments>http://www.tweened.org/fr/2011/03/18/yet-another-flipcontrol/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 06:03:00 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Composants]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tweened]]></category>
		<category><![CDATA[custom control]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/?p=935</guid>
		<description><![CDATA[

Lorsque vous développez une application Silverlight ou Wpf, certaines questions se posent avec plus de force. C'est notamment le cas concernant l'ergonomie. Définir un zoning simple et sans heurts est indispensable pour une utilisation intuitive de votre application.  Vous remarquerez souvent que certains usages ou même certaines entités métier présentent plusieurs facettes.
Prenons l'exemple de [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p><a href="http://www.tweened.org/wp-content/files/capture22.jpg" title="capture2" rel="lightbox[935]"><img src="http://www.tweened.org/wp-content/files/capture22.jpg" alt="" title="capture2" width="630" height="200" class="aligncenter size-full wp-image-995" /></a><br />
Lorsque vous développez une application Silverlight ou Wpf, certaines questions se posent avec plus de force. C'est notamment le cas concernant l'ergonomie. Définir un zoning simple et sans heurts est indispensable pour une utilisation intuitive de votre application.  Vous remarquerez souvent que certains usages ou même certaines entités métier présentent plusieurs facettes.<br />
Prenons l'exemple de plusieurs classes héritant d'une classe ou implémentant une interface.  Nous pourrions partir du principe que chaque sous-classe présente des membres communs a la classe mère ainsi qu'un jeu de propriétés ou de méthodes qui lui est spécifique. Lorsqu'une vue de l'application représente ce type d'instance, nous pouvons répartir l'affichage de cette dernière en deux zones distinctes que l'utilisateur n'aura pas forcément besoin de voir en même temps. La rotation 3D de la surface est un bon moyen d'y parvenir. Je mets à disposition un nouveau contrôle utilisateur : le FlipControl. Il est constitué de deux faces qui exposent chacune, un visuel distinct. On affiche successivement les deux faces par une rotation 3D sur l'axe horizontal ou vertical.<br />
Je mets donc à disposition un contrôle de ce type directement utilisable dans Blend. C'est un ContentControl qui possède les propriétés Header, FrontContent, BackContent et FrontTemplate et BackTemplate représentant le DataContext de chaque face.<br />
<a href="http://www.tweened.org/wp-content/files/captureFlip1.jpg" title="captureFlip" rel="lightbox[935]"><img src="http://www.tweened.org/wp-content/files/captureFlip1.jpg" alt="" title="captureFlip" width="630" height="336" class="aligncenter size-full wp-image-999" /></a><br />
Il possède également une propriété IsFlipped sur laquelle vous pourrez créer une liaison de donnée afin de déclencher une rotation 3D du contrôle. L'avantage principal de ce FlipControl est de faciliter la configuration du contenu de chaque face directement dans Blend.</p>
<p><div id="silverlightControlHost"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="630" height="236"><param name="source" value="http://www.tweened.org/wp-content/files/xapFiles/TestFlipControl.xap"/><param name="windowless" value="true"/><param name="background" value="#00FFFFFF" /><param name="minRuntimeVersion" value="3.0.40818.0" /><param name="autoupgrade" value="true" /><param name="enableHtmlAccess" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156" style="text-decoration: none;"><img src="http://storage.timheuer.com/sl4wp-ph.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/></a></object><iframe style="visibility:hidden;height:0;width:0;border:0px" id="_sl_historyFrame"></iframe></div><br /></p>
<p>Les sources de base ainsi que le projet de test sont téléchargeables <a href="http://www.tweened.org/wp-content/files/xapFiles/TestFlipControl.zip"> à cette adresse</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2011/03/18/yet-another-flipcontrol/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>InertialSlider [Custom Control]</title>
		<link>http://www.tweened.org/fr/2011/02/28/inertialslider-custom-control/</link>
		<comments>http://www.tweened.org/fr/2011/02/28/inertialslider-custom-control/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 21:51:05 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Composants]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tweened]]></category>
		<category><![CDATA[custom control]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/?p=982</guid>
		<description><![CDATA[

Dans le cadre d'un projet Silverlight sur tablette tactile, j'ai récemment eu besoin d'un Slider sans limite de valeur. Autrement dit, la valeur Maximum est indéfinie ou alors très éloignée. L'idée est d'augmenter la vitesse d'incrémentation au fur et à mesure du drag du contrôle Thumb. Vous pouvez tester le contrôle ci dessous. Il est [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p><a href="http://www.tweened.org/wp-content/files/inertialSlider.jpg" title="inertialSlider" rel="lightbox[982]"><img src="http://www.tweened.org/wp-content/files/inertialSlider.jpg" alt="" title="inertialSlider" width="630" height="200" class="aligncenter size-full wp-image-983" /></a><br />
Dans le cadre d'un projet Silverlight sur tablette tactile, j'ai récemment eu besoin d'un Slider sans limite de valeur. Autrement dit, la valeur Maximum est indéfinie ou alors très éloignée. L'idée est d'augmenter la vitesse d'incrémentation au fur et à mesure du drag du contrôle Thumb. Vous pouvez tester le contrôle ci dessous. Il est possible de définir le pas du changement de valeur ainsi que la finesse d'accélération.<br />
<div id="silverlightControlHost"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="610" height="350"><param name="source" value="http://www.tweened.org/wp-content/files/xapFiles/TestControlsSlider.xap"/><param name="windowless" value="true"/><param name="background" value="#00FFFFFF" /><param name="minRuntimeVersion" value="3.0.40818.0" /><param name="autoupgrade" value="true" /><param name="enableHtmlAccess" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156" style="text-decoration: none;"><img src="http://storage.timheuer.com/sl4wp-ph.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/></a></object><iframe style="visibility:hidden;height:0;width:0;border:0px" id="_sl_historyFrame"></iframe></div><br /><br />
Les sources de base ainsi que le projet de test sont téléchargeables <a href="http://www.tweened.org/wp-content/files/xapFiles/TestControls.zip"> à cette adresse</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2011/02/28/inertialslider-custom-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FrameReported &amp; ContactButton [Custom Control]</title>
		<link>http://www.tweened.org/fr/2011/01/23/framereported-contactbutton/</link>
		<comments>http://www.tweened.org/fr/2011/01/23/framereported-contactbutton/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 07:02:14 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Composants]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tweened]]></category>
		<category><![CDATA[windows phone 7]]></category>
		<category><![CDATA[custom control]]></category>
		<category><![CDATA[MultiTouch]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/?p=934</guid>
		<description><![CDATA[
Si vous avez déjà développé pour Windows Phone 7, vous avez déjà du remarquer certaines interactions problématiques. C'est notamment le cas lorsque vous utilisez les contrôles de base. Par exemple, lorsque vous  cliquez sur  un bouton par inadvertance (très souvent le cas pour les enfants), cela bloque toute autre tentative d'écoute sur un [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p><a href="http://www.tweened.org/wp-content/files/captureContact.jpg" title="captureContact" rel="lightbox[934]"><img class="aligncenter size-full wp-image-968" style="border: 0pt none; margin: 4px;" title="captureContact" src="http://www.tweened.org/wp-content/files/captureContact.jpg" alt="" width="630" height="200" /></a>Si vous avez déjà développé pour Windows Phone 7, vous avez déjà du remarquer certaines interactions problématiques. C'est notamment le cas lorsque vous utilisez les contrôles de base. Par exemple, lorsque vous  cliquez sur  un bouton par inadvertance (très souvent le cas pour les enfants), cela bloque toute autre tentative d'écoute sur un autre contrôle. Pour le vérifier posez deux boutons dans une grille windows phone 7 et compilez le projet sur le device. Lorsque vous cliquez sur le premier bouton, la diffusion de tout autre événement souris ou contact (tels que MouseLeftButtonDown par exemple) est impossible. Vous vous trouvez dans un cas classique d'interaction Multi-Touch sans l'avoir prévu. Afin de réaliser des applications réellement multitouch qui prennent ce genre de problématiques en compte, il existe différentes solutions plus ou moins efficaces .</p>
<p>Utiliser des événements plus adaptés : ManipulationStarted, ManipulationDelta et ManipulationCompleted. Ceux-ci sont directement implémentés dans le framework au niveau de la classe UIElement. Ces événements fournissent plus de détail concernant l'interaction utilisateur en cours. C'est cette solution qui est privilégiée dans 90% des cas. Toutefois cela ne répond pas à notre problématique principale.</p>
<p style="text-align: center;"><a href="http://www.tweened.org/wp-content/files/CapManipulation.jpg" title="CapManipulation" rel="lightbox[934]"><img class="aligncenter size-full wp-image-963" style="border: 0pt none; margin: 4px;" title="CapManipulation" src="http://www.tweened.org/wp-content/files/CapManipulation.jpg" alt="" width="630" height="350" /></a></p>
<p>Implémenter l'API de Gesture proposée par le <a href="http://silverlight.codeplex.com/releases" target="_blank">Toolkit Windows Phone 7.</a> Cette API facilite la vie lorsqu'il est nécessaire de connaitre l'écartement entre deux contacts, la rotation du segment entre des contacts et tout autre type d'opérations de ce genre. Le problème est qu'encore une fois, cela n'est pas une bonne solution car les événements proposés ne concernent qu'une seule surface (contrôle) à la fois. De plus l'implémentation de cette API n'est pas très pratique à mettre en oeuvre et ajoute une surcouche à l'API native et engendre de faibles performances (voir figure ci-dessous).</p>
<p style="text-align: center;"><a href="http://www.tweened.org/wp-content/files/CapGesture.jpg" title="CapGesture" rel="lightbox[934]"><img class="aligncenter size-full wp-image-962" style="border: 0pt none; margin: 4px;" title="CapGesture" src="http://www.tweened.org/wp-content/files/CapGesture.jpg" alt="" width="630" height="294" /></a></p>
<p>La seule bonne solution, et la plus exhaustive en matière de possibilités, consiste à Utiliser <a href="http://msdn.microsoft.com/fr-fr/library/system.windows.input.touch%28VS.95%29.aspx" target="_blank">la classe static Touch</a>. Celle-ci représente le plus bas niveau de traitement MultiTouch. Elle vous permet d'écouter un unique évènement nommé <a href="http://msdn.microsoft.com/en-us/library/system.windows.input.touch.framereported%28v=vs.95%29.aspx" target="_blank">FrameReported</a>. L'objet événementiel récupéré par l'écouteur possède plusieurs informations qui permettent de développer votre propre classe Wrapper MultiTouch ou encore des contrôles particuliers. Ces informations sont contenus dans l'objet événementiel de type <a href="http://msdn.microsoft.com/en-us/library/system.windows.input.touchframeeventargs%28v=vs.95%29.aspx" target="_blank">TouchFrameEventArgs</a>. L'objet événementiel permet de récupérer le premier contact, de supprimer la diffusion d'événements souris via la méthode  SuspendMousePromotionUntilTouchUp. <a href="http://msdn.microsoft.com/en-us/library/system.windows.input.touchframeeventargs%28v=vs.95%29.aspx" target="_blank">TouchFrameEventArgs</a> donne également accès à la liste des contacts en cours sur une surface via la méthode <a href="http://msdn.microsoft.com/en-us/library/system.windows.input.touchframeeventargs.gettouchpoints%28v=vs.95%29.aspx" target="_blank">GetTouchPoints</a>. Cette liste est relative au contexte conteneur passé lors de l'appel de la méthode. De la même manière que <em>GetPosition()</em> de la classe <em>MouseButtonEventArgs</em>, passer <em>null </em>renvoie la liste relative au VisualRoot, donc à l'application elle-même.  Chaque contact sur la surface est de type <a href="http://msdn.microsoft.com/en-us/library/system.windows.input.touchpoint%28v=vs.95%29.aspx" target="_blank">TouchPoint</a>. A ce stade, l'API commence à être réellement utile puisqu'il est possible, pour chaque contact, de récupérer des informations utiles comme sa dimension , son action(relaché, déplacé, appuyé) et sa position relative au conteneur. Voici un exemple :</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> MainPage<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    InitializeComponent<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    Touch.<span style="color: #0000FF;">FrameReported</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> TouchFrameEventHandler<span style="color: #000000;">&#40;</span>Touch_FrameReported<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">void</span> Touch_FrameReported<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, TouchFrameEventArgs e<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
     var tp <span style="color: #008000;">=</span> e.<span style="color: #0000FF;">GetPrimaryTouchPoint</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
     <span style="color: #0600FF;">switch</span><span style="color: #000000;">&#40;</span>tp.<span style="color: #0000FF;">Action</span><span style="color: #000000;">&#41;</span>
     <span style="color: #000000;">&#123;</span>
           <span style="color: #0600FF;">case</span> TouchAction.<span style="color: #0000FF;">Down</span><span style="color: #008000;">:</span>
           break<span style="color: #008000;">;</span>
&nbsp;
           <span style="color: #0600FF;">case</span> TouchAction.<span style="color: #0000FF;">Move</span><span style="color: #008000;">:</span>
           break<span style="color: #008000;">;</span>
&nbsp;
           <span style="color: #0600FF;">case</span> TouchAction.<span style="color: #0000FF;">Up</span><span style="color: #008000;">:</span>
           break<span style="color: #008000;">;</span>
&nbsp;
           <span style="color: #0600FF;">default</span><span style="color: #008000;">:</span>
           break<span style="color: #008000;">;</span>
     <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Sur un projet en cours, j'ai du développé un contrôle ContactButton permettant de résoudre cette problématique. L'objectif d'un point de vue utilisateur était d'activer certains menus lorsque deux boutons à la fois étaient cliqués. Ce contrôle est basé sur l'API native multiTouch de Silverlight et sur les classes d'AutomationPeer. L'idée est de diffuser un événement lorsque plusieurs boutons d'un même groupe sont cliqués en même temps. Il est possible d'écouter un événement static de la classe ContactButton afin de récupérer le groupe de bouton cliqué. Au moins deux boutons d'un même groupe doivent être appuyés en même temps pour que la classe diffuse l'événement. Il est également possible d'écouter un groupe spécifique. Voici comme utiliser ces événements :</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> TestTwinBehavior<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    InitializeComponent<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    tcb1.<span style="color: #0000FF;">ContactSelectionChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> EventHandler<span style="color: #000000;">&#40;</span>tcb1_ContactSelectionChanged<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    ContactButton.<span style="color: #0000FF;">ContactGroupChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> EventHandler<span style="color: #000000;">&#40;</span>ContactButton_ContactGroupChanged<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">void</span> ContactButton_ContactGroupChanged<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, ContactButtonGroupEventArgs e<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    Debug.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">ContactButtonGroupName</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">void</span> tcb1_ContactSelectionChanged<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, Tweened.<span style="color: #0000FF;">WP7</span>.<span style="color: #0000FF;">Controls</span>.<span style="color: #0000FF;">ContactButtonGroupEventArgs</span> e<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>ButtonBase item <span style="color: #0600FF;">in</span> e.<span style="color: #0000FF;">ContactedButtons</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        Debug.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>item.<span style="color: #0000FF;">Name</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Je mets à disposition <a href="http://www.tweened.org/wp-content/files/TestWP7Controls.zip">un projet et la dll</a> qui l'accompagne. En outre, le contrôle <a href="http://www.tweened.org/fr/2010/12/18/layoutgridselector-for-windows-phone-7/" target="_blank">LayoutGridSelector</a> est fourni avec des améliorations concernant le support des thèmes visuels Windows Phone 7.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2011/01/23/framereported-contactbutton/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protéger une application Windows Phone 7 sur la MarketPlace</title>
		<link>http://www.tweened.org/fr/2011/01/14/proteger-une-application-windows-phone-7-sur-la-marketplace/</link>
		<comments>http://www.tweened.org/fr/2011/01/14/proteger-une-application-windows-phone-7-sur-la-marketplace/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 16:09:53 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Actus]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tweened]]></category>
		<category><![CDATA[windows phone 7]]></category>
		<category><![CDATA[MarketPlace]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/?p=947</guid>
		<description><![CDATA[
us version


Vous l'avez sans doute remarqué si vous avez un Windows Phone 7, la Market place windows Phone c'est juste la jungle. Vous trouverez souvent ce que vous recherchez et sans doute beaucoup plus. C'est ce dernier point qui me pose le plus de problème : vous trouverez très souvent plusieurs applications avec le même [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper">
<li class="#dtreecatwrapper"><a href="http://www.tweened.org/en/2011/01/14/proteger-une-application-windows-phone-7-sur-la-marketplace/">us version</a></li>
</ul>
<p><a href="http://www.tweened.org/wp-content/files/guitar.jpg" title="guitar" rel="lightbox[947]"><img class="aligncenter size-full wp-image-948" title="guitar" src="http://www.tweened.org/wp-content/files/guitar.jpg" alt="" width="630" height="200" /></a></p>
<p>Vous l'avez sans doute remarqué si vous avez un Windows Phone 7, la Market place windows Phone c'est juste la jungle. Vous trouverez souvent ce que vous recherchez et sans doute beaucoup plus. C'est ce dernier point qui me pose le plus de problème : vous trouverez très souvent plusieurs applications avec le même nom (sans parler des musiques), des logos très légèrement modifiés et des fonctionnalités similaires. Sans même parler de piratage car cela n'est pas possible, n'importe quel développeur ou entreprise peut à loisir créer une application avec des fonctionnalités identiques lorsque celles-ci ne sont pas complexes à développer.  Vous trouverez donc souvent 3 / 4 (et quelques fois plus) applications portant le même nom.</p>
<p>Ce problème est, il me semble, complètement propre à Windows phone 7 car en tant qu'utilisateur, je n’ai pas remarqué ce phénomène sur l'AppStore.</p>
<p>Pour résumer même si l’application est sortie un mois , deux mois ou 1 an avant et fut la première portant ce nom, rien n’empêche un développeur ou une entreprise de déposer la même application par la suite avec un logo similaire et un nom exactement identique. La réponse de Microsoft est : il est nécessaire de porter plainte en justice pour protéger le nom de l'application et l'idée de logo. Imaginez donc que vous deviez porter dix plaintes pour 10 applications différentes. Dès lors en tant que développeur Windows Phone 7 et Silverlight, je me pose les questions suivantes :</p>
<p>1 - Je trouve une bonne idée avec un nom idéal et je suis une petite structure, comment faire pour protéger mon application ?</p>
<p>2 - Comment faire pour que mon application soit rapidement trouvée sur la market place ?</p>
<p>3 - Qu’est-ce qui différencie mon application des autres et qu'est-ce qui la protège ?</p>
<p>A titre personnel, je pense qu'une petite structure a très peu de moyens pour se défendre mis à part une action légale. Sur la Market place votre application et son nom surtout pourrait être déposées avec les mêmes fonctionnalités, seul recours la loi. Mais quelle loi, il me semble que cet aspect là est très délicat car il faudra sans doute déposer un brevet internationale et/ou passer par tous les outils possibles à votre disposition.</p>
<p>Pour que votre applications soit rapidement trouvée, pas de mystère, il faut quelle soit utilisée et bien notée par les WindowsPhonaute (ou Marketplacenaute), ou que vous possédiez d'autres moyens marketing comme un site, une campagne de pub, ou une application hors windows phone qui y soit reliée. Cette question renvoie à la question trois.</p>
<p>Ce qui va différencier votre applications des autres ayant le même nom :</p>
<ul>
<li>Les ScreenShots avec des contenus graphiques uniques. Ce contenu est beaucoup plus difficile à copier contrairement au nom. Une banque d'image unique de par son contenu par exemple.</li>
<li>Les fonctionnalités complexes, qui ne sont pas à la portée de tous.</li>
<li>Une expérience utilisateur sans aucune faille.</li>
</ul>
<p>Tous ces éléments seront autant de protection contre la recopie de votre application. Mais alors qu'est-ce qu'il y a de changer avec l'AppStore ? Je dirai un aspect romantique, l'aspect Christophe Colomb <img src='http://www.tweened.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . On a tous eu l'idée de créer un jour l'application avec THE IDEE(IDEA <img src='http://www.tweened.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Sauf qu'aujourd'hui, le développeur qui dans son coin souhaite créer cette application même avec l'idée du siècle, ne pourra pas assurer la protection de son application faute de moyens financiers. Car le nom qu'il dépose peut, du jour au lendemain être complètement piraté. De longs mois de procédures juridique sont à la clef de tous recours. Cela peut couter très cher...</p>
<p>Aucune réponse technique à ce problème n'est la bonne, aucune réponse légale n'est bonne non plus à moins que vous fassiez partie d'une moyenne / grande entreprise et que vous disposiez de beaucoup, beaucoup de temps devant vous. La bonne réponse est multiple c'est la réponse artistique, la réponse de l'unique, la réponse du contenu et d'un développement parfait, d'une ergonomie parfaite. Cela sera beaucoup plus dur à copier. Donc à ceux qui postent des applications juste pour en poster alors que d'autres du même type existent, s'il vous plait arrêtez, vous ne gagnerez pas d'argent de cette manière. Cela nuit à la MarketPlace et au fantastique outil qu'est Windows Phone 7.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2011/01/14/proteger-une-application-windows-phone-7-sur-la-marketplace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RadioButton Extension [Custom Control] [API]</title>
		<link>http://www.tweened.org/fr/2010/09/24/radiobutton-extension-et-radiobuttongroup-micro-api/</link>
		<comments>http://www.tweened.org/fr/2010/09/24/radiobutton-extension-et-radiobuttongroup-micro-api/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 07:06:23 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Composants]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tweened]]></category>
		<category><![CDATA[AttachedProperty]]></category>
		<category><![CDATA[behaviors]]></category>
		<category><![CDATA[Extension]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/?p=864</guid>
		<description><![CDATA[

Pour les nécessités d'un projet, j'ai récemment eu besoin de conserver l'historique des sélections effectuées au sein d'un groupe de RadioButton. Cette classe existe sur des environnements comme Flex de manière native mais pas sur Silverlight, du coup, il est nécessaire de concevoir un mini framework pour avoir le même type de fonctionnalités. Généralement la [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p><a href="http://www.tweened.org/wp-content/files/capture14.jpg" title="capture1" rel="lightbox[864]"><img class="aligncenter size-full wp-image-868" title="capture1" src="http://www.tweened.org/wp-content/files/capture14.jpg" alt="" width="630" height="200" /></a><br />
Pour les nécessités d'un projet, j'ai récemment eu besoin de conserver l'historique des sélections effectuées au sein d'un groupe de RadioButton. Cette classe existe sur des environnements comme Flex de manière native mais pas sur Silverlight, du coup, il est nécessaire de concevoir un mini framework pour avoir le même type de fonctionnalités. Généralement la classe RadioButtonGroup possède un événement Selected diffusé lorsqu'un des RadioButton est sélectionné au sein du groupe. Toutefois pour les besoins de la production, nous avions besoin d'historier les sélections successives car ceux-ci était utilisés comme menu. Du coup, j'ai développé une mini API permettant de faire cela et un peu plus.</p>
<p>Cette API est composée de différents éléments :<br />
- La classe RadioButtonGroup<br />
- Des propriétés attachées pour activer / désactiver / stocker un groupe de radio boutton associé.<br />
- Une méthode d'extension<br />
- Un comportement facilitant l'activation de RadioButtonGroup (à glisser dans Blend sur un RadioButton)</p>
<p>Il est intéressant de constater qu'utiliser un comportement peut s'avérer bien plus souple qu'utiliser une Attached Property. Bien qu'une Attached Property puisse être définit dans un style, celle-ci le constructeur d'une MainPage ne pourra pas accéder à une instance de RadioButtonGroup directement. Vous pourrez le faire uniquement sur le Loaded. Dans le cas du comportement cela n'est pas vrai car le RadioButtonGroup est instancié via la méthode OnAttached qui est appelée dès que le comportement est affecté à un RadioButton, c'est à dire bien avant son affichage effectif. Je mets un projet de test au <a href="http://www.tweened.org/wp-content/files/TestExtensions.zip">téléchargement ici</a>.</p>
<p>Pour chacun d'eux, je mets le code en clair dans les sections ci-dessous :</p>
<h2>La classe RadioButtonGroup</h2>
<p>Celle-ci possède plusieurs membres très utiles :</p>
<ul>
<li>SelectionChanged</li>
</ul>
<p style="padding-left: 60px;">Cet événement est diffusé lorsqu'un RadioButton du groupe est sélectionné.</p>
<ul>
<li>Children</li>
</ul>
<p style="padding-left: 60px;">CollectionObservable contenant tous les RadioButton du groupe</p>
<ul>
<li>Historic</li>
</ul>
<p style="padding-left: 60px;">CollectionObservable contenant l'historique de sélection</p>
<ul>
<li>Current</li>
</ul>
<p style="padding-left: 60px;">Propriété renvoyant le RadioButton actuellement sélectionné</p>
<ul>
<li>Last</li>
</ul>
<p style="padding-left: 60px;">Propriété renvoyant le RadioButton précédemment sélectionné</p>
<ul>
<li>Add</li>
</ul>
<p style="padding-left: 60px;">Méthode permettant d'ajouter un RadioButton au groupe</p>
<ul>
<li>Remove</li>
</ul>
<p style="padding-left: 60px;">Méthode permettant de supprimer un RadioButton du groupe</p>
<ul>
<li>CancelLastSelection</li>
</ul>
<p style="padding-left: 60px;">Annule la dernière sélection. Très pratique pour certaines fonctionnalités spécifiques aux menus</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> RadioButtonGroup <span style="color: #008000;">:</span> INotifyPropertyChanged
<span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">/// This event is fired when the selected RadioButton has been modified.</span>
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">event</span> EventHandler
 SelectionChanged<span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF;">private</span> <span style="color: #FF0000;">bool</span> _IsCanceledByGroup<span style="color: #008000;">;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> IsCanceledByGroup
    <span style="color: #000000;">&#123;</span>
        get
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> _IsCanceledByGroup<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        set
        <span style="color: #000000;">&#123;</span>
            _IsCanceledByGroup <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">/// ObservableCollection wich contains an historic of selected RadioButton</span>
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #0600FF;">private</span> ObservableCollection _Historic <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ObservableCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF;">public</span> ObservableCollection Historic
    <span style="color: #000000;">&#123;</span>
        get
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> _Historic<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        set
        <span style="color: #000000;">&#123;</span>
            _Historic <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">/// ObservableCollection of RadioButton contained by the RadioButtonGroup</span>
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #0600FF;">private</span> ObservableCollection _Children <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ObservableCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF;">public</span> ObservableCollection Children
    <span style="color: #000000;">&#123;</span>
        get
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> _Children<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        set
        <span style="color: #000000;">&#123;</span>
            _Children <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">/// Returns Current Selected RadioButton in the group</span>
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #0600FF;">private</span> RadioButton _Current<span style="color: #008000;">;</span>
    <span style="color: #0600FF;">public</span> RadioButton Current
    <span style="color: #000000;">&#123;</span>
        get
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> _Current<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        set
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span><span style="color: #FF0000;">Object</span>.<span style="color: #0000FF;">ReferenceEquals</span><span style="color: #000000;">&#40;</span>_Current, value<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                _Current <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
&nbsp;
                NotifyPropertyChanged<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Current&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>SelectionChanged <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    SelectionChanged<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>, <span style="color: #008000;">new</span> SelectedChangedEventArgs<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> Last<span style="color: #008000;">=</span>_Last,Current<span style="color: #008000;">=</span>_Current, CurrentGroup<span style="color: #008000;">=</span><span style="color: #0600FF;">this</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #000000;">&#125;</span>
&nbsp;
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">/// Returns last selected RadioButton in the group</span>
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #0600FF;">private</span> RadioButton _Last<span style="color: #008000;">;</span>
    <span style="color: #0600FF;">public</span> RadioButton Last
    <span style="color: #000000;">&#123;</span>
        get
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> _Last<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        set
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span><span style="color: #FF0000;">Object</span>.<span style="color: #0000FF;">ReferenceEquals</span><span style="color: #000000;">&#40;</span>_Current, value<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                _Last <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
&nbsp;
                NotifyPropertyChanged<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Last&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">/// Add a RadioButton to the RadioButtonGroup</span>
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">///</span>
&nbsp;
    <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> Add<span style="color: #000000;">&#40;</span>RadioButton rb<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        _Children.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>rb<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        rb.<span style="color: #008000;">Checked</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> RoutedEventHandler<span style="color: #000000;">&#40;</span>rb_Checked<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">/// Remove a RadioButton contained by the RadioButtonGroup</span>
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">///</span>
&nbsp;
    <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> Remove<span style="color: #000000;">&#40;</span>RadioButton rb<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        _Children.<span style="color: #0000FF;">Remove</span><span style="color: #000000;">&#40;</span>rb<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        rb.<span style="color: #008000;">Checked</span> <span style="color: #008000;">-=</span> <span style="color: #008000;">new</span> RoutedEventHandler<span style="color: #000000;">&#40;</span>rb_Checked<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">/// Cancel last selection in the group and select the one before</span>
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">/// Return Current Selection after CancelLastSelection method has been called.</span>
    <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> CancelLastSelection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
&nbsp;
        <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>Historic.<span style="color: #0000FF;">Count</span> <span style="color: #008000;">&amp;</span>gt<span style="color: #008000;">;</span> <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            Historic.<span style="color: #0000FF;">RemoveAt</span><span style="color: #000000;">&#40;</span>Historic.<span style="color: #0000FF;">Count</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        Historic<span style="color: #000000;">&#91;</span>Historic.<span style="color: #0000FF;">Count</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">IsChecked</span> <span style="color: #008000;">=</span> true<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> rb_Checked<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, RoutedEventArgs e<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        Current <span style="color: #008000;">=</span> sender <span style="color: #0600FF;">as</span> RadioButton<span style="color: #008000;">;</span>
&nbsp;
        Historic.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>Current<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        Last <span style="color: #008000;">=</span> Historic<span style="color: #000000;">&#91;</span>Historic.<span style="color: #0000FF;">Count</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080;">#region NPC members</span>
&nbsp;
    <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">event</span> PropertyChangedEventHandler PropertyChanged<span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> NotifyPropertyChanged<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> prop<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>PropertyChanged <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            PropertyChangedEventArgs e <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> PropertyChangedEventArgs<span style="color: #000000;">&#40;</span>prop<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            PropertyChanged<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>, e<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080;">#endregion</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<h2>Des propriétés de dépendance attachées (aux RadioButton) facilitant l'activation et l'instanciation d'un objet RadioButtonGroup.</h2>
<p>ActivateRadioButtonGroup permet d'activer la gestion via RadioButtonGroup.<br />
CommitProperty permet de sélectionné un RadioButton lorsqu'une propriété de votre choix est modifiée.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">namespace</span> Tweened.<span style="color: #0000FF;">Extensions</span>.<span style="color: #0000FF;">RadioButtonEx</span>
<span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">partial</span> <span style="color: #FF0000;">class</span> RadioButtonExtension
    <span style="color: #000000;">&#123;</span>
        <span style="color: #008080;">#region static Dictionnary string / RadioButtonGroup named RadioButtonGroups</span>
        <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> Dictionary _RadioButtonGroups <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Dictionary<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #008080; font-style: italic;">/// Contains RadioButtonGroups in the application</span>
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> Dictionary RadioButtonGroups
        <span style="color: #000000;">&#123;</span>
            get
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">return</span> _RadioButtonGroups<span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
            set
            <span style="color: #000000;">&#123;</span>
                _RadioButtonGroups <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
        <span style="color: #008080;">#endregion</span>
&nbsp;
        <span style="color: #008080;">#region Commit DependencyProperty enables the radiobutton to autoselect if some property has changed</span>
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #008080; font-style: italic;">/// Enable the radiobutton to autoselect if some property has changed</span>
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">object</span> GetCommitProperty<span style="color: #000000;">&#40;</span>DependencyObject obj<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span><span style="color: #000000;">&#41;</span>obj.<span style="color: #0000FF;">GetValue</span><span style="color: #000000;">&#40;</span>CommitPropertyProperty<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> SetCommitProperty<span style="color: #000000;">&#40;</span>DependencyObject obj, <span style="color: #FF0000;">object</span> value<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            obj.<span style="color: #0000FF;">SetValue</span><span style="color: #000000;">&#40;</span>CommitPropertyProperty, value<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// Using a DependencyProperty as the backing store for CommitProperty.  This enables animation, styling, binding, etc...</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">readonly</span> DependencyProperty CommitPropertyProperty <span style="color: #008000;">=</span>
            DependencyProperty.<span style="color: #0000FF;">RegisterAttached</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;CommitProperty&quot;</span>, <span style="color: #008000;">typeof</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span><span style="color: #000000;">&#41;</span>, <span style="color: #008000;">typeof</span><span style="color: #000000;">&#40;</span>RadioButton<span style="color: #000000;">&#41;</span>, <span style="color: #008000;">new</span> PropertyMetadata<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">null</span>,
                                                                                                        <span style="color: #008000;">new</span> PropertyChangedCallback<span style="color: #000000;">&#40;</span>OnCommitProperty<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> OnCommitProperty<span style="color: #000000;">&#40;</span>DependencyObject d, DependencyPropertyChangedEventArgs e<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            RadioButton rb <span style="color: #008000;">=</span> d <span style="color: #0600FF;">as</span> RadioButton<span style="color: #008000;">;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>rb <span style="color: #008000;">==</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                return<span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">NewValue</span> <span style="color: #008000;">!=</span> e.<span style="color: #0000FF;">OldValue</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
&nbsp;
                rb.<span style="color: #0000FF;">IsChecked</span> <span style="color: #008000;">=</span> e.<span style="color: #0000FF;">NewValue</span> <span style="color: #008000;">!=</span> null<span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
        <span style="color: #008080;">#endregion</span>
&nbsp;
        <span style="color: #008080;">#region ActivateRadioButtonGroup DependencyProperty enables RadioButtonGroup management for a given RadioButton</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #008080; font-style: italic;">/// Retrieves the RadioButtonGroup wich hold the RadioButton.</span>
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #008080; font-style: italic;">///</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> RadioButtonGroup GetRadioButtonGroup<span style="color: #000000;">&#40;</span>DependencyObject obj<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> <span style="color: #000000;">&#40;</span>RadioButtonGroup<span style="color: #000000;">&#41;</span>obj.<span style="color: #0000FF;">GetValue</span><span style="color: #000000;">&#40;</span>RadioButtonGroupProperty<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> SetRadioButtonGroup<span style="color: #000000;">&#40;</span>DependencyObject obj, RadioButtonGroup value<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            obj.<span style="color: #0000FF;">SetValue</span><span style="color: #000000;">&#40;</span>RadioButtonGroupProperty, value<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// Using a DependencyProperty as the backing store for RadioButtonGroup.  This enables animation, styling, binding, etc...</span>
        <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">readonly</span> DependencyProperty RadioButtonGroupProperty <span style="color: #008000;">=</span>
            DependencyProperty.<span style="color: #0000FF;">RegisterAttached</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;RadioButtonGroup&quot;</span>, <span style="color: #008000;">typeof</span><span style="color: #000000;">&#40;</span>RadioButtonGroup<span style="color: #000000;">&#41;</span>, <span style="color: #008000;">typeof</span><span style="color: #000000;">&#40;</span>RadioButton<span style="color: #000000;">&#41;</span>, <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #008080; font-style: italic;">/// Activate RadioButton Group managment</span>
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #008080; font-style: italic;">///</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">///</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">bool</span> GetActivateRadioButtonGroup<span style="color: #000000;">&#40;</span>DependencyObject obj<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">bool</span><span style="color: #000000;">&#41;</span>obj.<span style="color: #0000FF;">GetValue</span><span style="color: #000000;">&#40;</span>ActivateRadioButtonGroupProperty<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> SetActivateRadioButtonGroup<span style="color: #000000;">&#40;</span>DependencyObject obj, <span style="color: #FF0000;">bool</span> value<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            obj.<span style="color: #0000FF;">SetValue</span><span style="color: #000000;">&#40;</span>ActivateRadioButtonGroupProperty, value<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// Using a DependencyProperty as the backing store for ActivateRadioButtonGroup.  This enables animation, styling, binding, etc...</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">readonly</span> DependencyProperty ActivateRadioButtonGroupProperty <span style="color: #008000;">=</span>
            DependencyProperty.<span style="color: #0000FF;">RegisterAttached</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;ActivateRadioButtonGroup&quot;</span>, <span style="color: #008000;">typeof</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">bool</span><span style="color: #000000;">&#41;</span>, <span style="color: #008000;">typeof</span><span style="color: #000000;">&#40;</span>RadioButton<span style="color: #000000;">&#41;</span>, <span style="color: #008000;">new</span> PropertyMetadata<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">false</span>, <span style="color: #008000;">new</span> PropertyChangedCallback<span style="color: #000000;">&#40;</span>OnActivateRadioButtonGroupChanged<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> OnActivateRadioButtonGroupChanged<span style="color: #000000;">&#40;</span>DependencyObject d, DependencyPropertyChangedEventArgs e<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            RadioButton rb <span style="color: #008000;">=</span> d <span style="color: #0600FF;">as</span> RadioButton<span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>rb <span style="color: #008000;">==</span> <span style="color: #0600FF;">null</span> <span style="color: #008000;">||</span> <span style="color: #FF0000;">String</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>rb.<span style="color: #0000FF;">GroupName</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">throw</span> <span style="color: #008000;">new</span> Exception<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Object is not a RadioButton or GroupName is not defined.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            RadioButtonGroup rbg<span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">System</span>.<span style="color: #0000FF;">Convert</span>.<span style="color: #0000FF;">ToBoolean</span><span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">NewValue</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span>RadioButtonExtension.<span style="color: #0000FF;">RadioButtonGroups</span>.<span style="color: #0000FF;">ContainsKey</span><span style="color: #000000;">&#40;</span>rb.<span style="color: #0000FF;">GroupName</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    rbg <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> RadioButtonGroup<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    RadioButtonExtension.<span style="color: #0000FF;">RadioButtonGroups</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>rb.<span style="color: #0000FF;">GroupName</span>, rbg<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    Application.<span style="color: #0000FF;">Current</span>.<span style="color: #0000FF;">Resources</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>rb.<span style="color: #0000FF;">GroupName</span>, rbg<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    rbg.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>rb<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #000000;">&#125;</span>
                <span style="color: #0600FF;">else</span>
                <span style="color: #000000;">&#123;</span>
                    rbg <span style="color: #008000;">=</span> RadioButtonExtension.<span style="color: #0000FF;">RadioButtonGroups</span><span style="color: #000000;">&#91;</span>rb.<span style="color: #0000FF;">GroupName</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
                    rbg.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>rb<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #000000;">&#125;</span>
                RadioButtonExtension.<span style="color: #0000FF;">SetRadioButtonGroup</span><span style="color: #000000;">&#40;</span>rb, rbg<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
            <span style="color: #0600FF;">else</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>RadioButtonExtension.<span style="color: #0000FF;">RadioButtonGroups</span>.<span style="color: #0000FF;">ContainsKey</span><span style="color: #000000;">&#40;</span>rb.<span style="color: #0000FF;">GroupName</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    rbg <span style="color: #008000;">=</span> RadioButtonExtension.<span style="color: #0000FF;">RadioButtonGroups</span><span style="color: #000000;">&#91;</span>rb.<span style="color: #0000FF;">GroupName</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
                    rbg.<span style="color: #0000FF;">Remove</span><span style="color: #000000;">&#40;</span>rb<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    RadioButtonExtension.<span style="color: #0000FF;">SetRadioButtonGroup</span><span style="color: #000000;">&#40;</span>rb, <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #000000;">&#125;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080;">#endregion</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<h2>Des comportements que vous pourrez glisser directement sur des instances de RadioButton ou un conteneur en contenant.</h2>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> RadioButtonGroupBehavior <span style="color: #008000;">:</span> Behavior
<span style="color: #000000;">&#123;</span>
	<span style="color: #0600FF;">public</span> RadioButtonGroupBehavior<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> OnAttached<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">OnAttached</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        	<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>AssociatedObject <span style="color: #008000;">is</span> Panel<span style="color: #000000;">&#41;</span>
        	<span style="color: #000000;">&#123;</span>
            		AssociatedObject.<span style="color: #0000FF;">Loaded</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> RoutedEventHandler<span style="color: #000000;">&#40;</span>AssociatedObject_Loaded<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        	<span style="color: #000000;">&#125;</span>
       		<span style="color: #0600FF;">else</span> <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>AssociatedObject <span style="color: #008000;">is</span> RadioButton<span style="color: #000000;">&#41;</span>
        	<span style="color: #000000;">&#123;</span>
           		RadioButtonExtension.<span style="color: #0000FF;">SetActivateRadioButtonGroup</span><span style="color: #000000;">&#40;</span>AssociatedObject <span style="color: #0600FF;">as</span> RadioButton, <span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        	<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF;">void</span> AssociatedObject_Loaded<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, RoutedEventArgs e<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>UIElement b <span style="color: #0600FF;">in</span> <span style="color: #000000;">&#40;</span>sender <span style="color: #0600FF;">as</span> Panel<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Children</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>b <span style="color: #0600FF;">as</span> RadioButton <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
				RadioButtonExtension.<span style="color: #0000FF;">SetActivateRadioButtonGroup</span><span style="color: #000000;">&#40;</span>b <span style="color: #0600FF;">as</span> RadioButton, <span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> OnDetaching<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">OnDetaching</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        	<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>AssociatedObject <span style="color: #008000;">is</span> Panel<span style="color: #000000;">&#41;</span>
        	<span style="color: #000000;">&#123;</span>
            		AssociatedObject.<span style="color: #0000FF;">Loaded</span> <span style="color: #008000;">-=</span> AssociatedObject_Loaded<span style="color: #008000;">;</span> 
&nbsp;
            		<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>RadioButton b <span style="color: #0600FF;">in</span> <span style="color: #000000;">&#40;</span>AssociatedObject <span style="color: #0600FF;">as</span> Panel<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Children</span><span style="color: #000000;">&#41;</span>
            		<span style="color: #000000;">&#123;</span>
                		RadioButtonExtension.<span style="color: #0000FF;">SetActivateRadioButtonGroup</span><span style="color: #000000;">&#40;</span>b, <span style="color: #0600FF;">false</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            		<span style="color: #000000;">&#125;</span>
        	<span style="color: #000000;">&#125;</span>
        	<span style="color: #0600FF;">else</span> <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>AssociatedObject <span style="color: #008000;">is</span> RadioButton<span style="color: #000000;">&#41;</span>
        	<span style="color: #000000;">&#123;</span>
           		 RadioButtonExtension.<span style="color: #0000FF;">SetActivateRadioButtonGroup</span><span style="color: #000000;">&#40;</span>AssociatedObject <span style="color: #0600FF;">as</span> RadioButton, <span style="color: #0600FF;">false</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        	<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<h2>Une méthode d'extension pour les instances de RadioButton qui facilite la récupération du RadioButtonGroup associé.</h2>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">partial</span> <span style="color: #FF0000;">class</span> RadioButtonExtension
<span style="color: #000000;">&#123;</span>
    <span style="color: #008080;">#region Extension Method GetRadioButtonGroup</span>
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">/// Allow to get the RadioButtonGroup associated to a RadioButton</span>
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #008080; font-style: italic;">///</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">///</span>
    <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> RadioButtonGroup GetRadioButtonGroup<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span> RadioButton radioButton<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        RadioButtonGroup rbg <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>RadioButtonExtension.<span style="color: #0000FF;">RadioButtonGroups</span>.<span style="color: #0000FF;">ContainsKey</span><span style="color: #000000;">&#40;</span>radioButton.<span style="color: #0000FF;">GroupName</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            rbg <span style="color: #008000;">=</span> RadioButtonExtension.<span style="color: #0000FF;">RadioButtonGroups</span><span style="color: #000000;">&#91;</span>radioButton.<span style="color: #0000FF;">GroupName</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">return</span> rbg<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080;">#endregion</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2010/09/24/radiobutton-extension-et-radiobuttongroup-micro-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thème Fleur des Salines disponible</title>
		<link>http://www.tweened.org/fr/2010/04/22/theme-fleur-des-salines-disponible/</link>
		<comments>http://www.tweened.org/fr/2010/04/22/theme-fleur-des-salines-disponible/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 09:52:54 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Actus]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tweened]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/?p=673</guid>
		<description><![CDATA[
Regart.net diffuse le thème Fleur des salines sur FlashXpress.net en version anglaise ou française. Pour ceux qui aiment bien les beaux thèmes wordpress sobres et efficaces, je vous le recommande chaudement. Celui-ci embarque une Galerie photo en home page (made in Silverlight).
Cette galerie repose sur le plugin wordpress  du même nom, vous pouvez la [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p><a href="http://www.tweened.org/wp-content/files/fdsThemeCapture.jpg" title="fdsThemeCapture" rel="lightbox[673]"><img class="alignleft size-full wp-image-676" title="fdsThemeCapture" src="http://www.tweened.org/wp-content/files/fdsThemeCapture.jpg" alt="" width="630" height="200" /></a><a href="http://www.regart.net" target="_blank">Regart.net</a> diffuse le thème Fleur des salines sur <a href="http://www.flashxpress.net" target="_blank">FlashXpress.net</a> en version <a href="http://www.flashxpress.net/wp-content/uploads/themeFDS/Theme_FleurDesSalines_EN.zip">anglaise</a> ou <a href="http://www.flashxpress.net/wp-content/uploads/themeFDS/Theme_FleurDesSalines_FR.zip">française</a>. Pour ceux qui aiment bien les beaux thèmes wordpress sobres et efficaces, je vous le recommande chaudement. Celui-ci embarque une Galerie photo en home page (made in Silverlight).</p>
<p>Cette galerie repose sur le plugin wordpress  du même nom, vous pouvez la télécharger <a href="http://wordpress.org/extend/plugins/silverlight-gallery/" target="_blank">ici</a>. Son principale avantage et de récupérer les images uploader via l'admin wordpress dans votre post.En voici un exemple montrant des capture du thème en question.</p>
<p><div class="silverlightControlHost"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="630" height="400" style='outline:none'>
<param name="source" value="http://www.tweened.org/wp-content/plugins/silverlight-gallery/ClientBin/pluginSL.xap"/>
<param name="background" value="transparent" />
<param name="windowless" value="1" />
<param name="minRuntimeVersion" value="3.0.40723.0" />
<param name="initParams" value="GalleryUrl=http://www.tweened.org/wp-content/plugins/silverlight-gallery/image_xml.php?id=673,
	 leftArrow=true, 
	rightArrow=true, 
	pageNumbers=true, 
	thumbnails=true, 
	fill=uniformtofill" />
<param name="autoupgrade" value="true" />
<param name="enableHtmlAccess" value="true" /><param name="splashscreensource" value="http://www.tweened.org/wp-content/plugins/silverlight-gallery/ClientBin/preloadSL.xaml" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=3.0.40624.0" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object></div></p>
<p>Si vous souhaitez apprendre à configurer ce thème, j'ai réalisé une petite vidéo muette de 3-4 minutes très pratique que vous pouvez voir sur la WebTv de tweened.org <a href="http://www.tweened.org/fr/web-tv/" target="_blank">ici</a>.</p>
<p>Pour info, ce thème a été utilisé pour le site <a href="http://www.fleurdessalines.fr" target="_blank">www.fleurdessalines.fr</a> réalisé par Regart.net.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2010/04/22/theme-fleur-des-salines-disponible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PieProgressBar [Custom Control]</title>
		<link>http://www.tweened.org/fr/2009/12/16/a-new-pieprogressbar-custom-control/</link>
		<comments>http://www.tweened.org/fr/2009/12/16/a-new-pieprogressbar-custom-control/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 07:34:35 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Composants]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tweened]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/2009/12/16/a-new-pieprogressbar-custom-control/</guid>
		<description><![CDATA[
us version

Pour les besoins d'une production récente, j'ai du concevoir un contrôle de progression circulaire nommé PieProgressBar. Ce dernier hérite de la classe RangeBase et bénéficie à ce titre de toutes les capacités inhérentes à ce type de contrôle. Il se comporte au final comme n'importe quel contrôle de type ProgressBar avec quelques petites choses [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper">
<li class="#dtreecatwrapper"><a href="http://www.tweened.org/en/2009/12/16/a-new-pieprogressbar-custom-control/">us version</a></li>
</ul>
<p>Pour les besoins d'une production récente, j'ai du concevoir un contrôle de progression circulaire nommé <em>PieProgressBar</em>. Ce dernier hérite de la classe <em>RangeBase </em>et bénéficie à ce titre de toutes les capacités inhérentes à ce type de contrôle. Il se comporte au final comme n'importe quel contrôle de type <em>ProgressBar</em> avec quelques petites choses en plus. La petite difficulté fut de créer dynamiquement le camembert de progression via C#. Contrairement à WPF, Silverlight ne permet pas de surcharger de méthode permettant de créer de nouveaux genres de <em>Shape</em>. Autrement dit, même si <em>Shape</em> est une classe abstraite, il ne sert à rien d'en hériter car la méthode de conception du tracé ne peut être surchargée.<br />
L'autre technique consiste à utiliser le "Path mini language" qui permet de créer des figures géométriques en XAML. J'ai du utiliser 3 segments dont un <em>ArcSegment </em>afin de réaliser ce contrôle. comme je ne pouvais pas créer de primitive <em>Pie </em>pour le graphiste sous Blend, il a fallu ruser... La technique consiste a créer dynamiquement le camembert lors de l'assignation d'une partie de contrôle (<em>ControlPart</em>). En interne, les propriétés de remplissage du tracé généré, sont liées aux propriétés du contrôle via une simple liaison de données créées cote C#.<br />
Vous pouvez en voir des exemplaires ci-dessous et télécharger la librairie <a href="http://www.tweened.org/wp-content/files/tweenedcontrols.dll">tweenedcontrols ici</a>.</p>
<p><div id="silverlightControlHost"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="320" height="120"><param name="source" value="http://www.tweened.org/wp-content/uploads/applis/TestControls.xap"/><param name="windowless" value="true"/><param name="background" value="#00FFFFFF" /><param name="minRuntimeVersion" value="3.0.40818.0" /><param name="autoupgrade" value="true" /><param name="enableHtmlAccess" value="true" /><param name="initParams" value="3.0.40818.0" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156" style="text-decoration: none;"><img src="http://storage.timheuer.com/sl4wp-ph.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/></a></object><iframe style="visibility:hidden;height:0;width:0;border:0px" id="_sl_historyFrame"></iframe></div><br /></p>
<p>Une fois la dll référencée, vous pouvez instancier des contrôle <em>PieProgressBar </em>dans Blend via le panneau Assets comme montré ci-dessous :</p>
<p><a href="http://www.tweened.org/wp-content/files/accespieprogressbar.jpg" title="accespieprogressbar" rel="lightbox[403]"><img class="alignleft size-full wp-image-411" style="border: 0pt none; margin: 2px;" title="accespieprogressbar" src="http://www.tweened.org/wp-content/files/accespieprogressbar.jpg" alt="" width="500" height="281" /></a></p>
<p>Ce composant va être sans doute inclu comme d'autres dans le projet CodePlex SLExtensions que Thierry Bouquain met à jour en ce moment et que je salue au passage <img src='http://www.tweened.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2009/12/16/a-new-pieprogressbar-custom-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

