<?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; Silverlight</title>
	<atom:link href="http://www.tweened.org/fr/category/silverlight/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>SketchFlow for Windows Phone 7</title>
		<link>http://www.tweened.org/fr/2011/06/10/sketchflow-for-windows-phone-7/</link>
		<comments>http://www.tweened.org/fr/2011/06/10/sketchflow-for-windows-phone-7/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 18:43:04 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Actus]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[windows phone 7]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[SketchFlow]]></category>

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

C'est la bonne nouvelle de la journée, un nouveau projet sur CodePlex permet de prototyper des application Windows Phone 7 via SketchFlow. Il vous faudra toutefois acquérir la licence Expression Studio Ultimate ou Visual Studio 2010 ultimate. Cela peut paraître assez gadget mais bien au contraire gérer une navigation à la fois simple, efficace et [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p><a href="http://www.tweened.org/wp-content/files/SketchFlowWP7.jpg" title="SketchFlowWP7" rel="lightbox[1101]"><img title="SketchFlowWP7" class="aligncenter size-full wp-image-1103" src="http://www.tweened.org/wp-content/files/SketchFlowWP7.jpg" alt="" width="630" height="200" /></a><br />
C'est la bonne nouvelle de la journée, <a href="http://wp7sketchflow.codeplex.com/">un nouveau projet sur CodePlex </a>permet de prototyper des application Windows Phone 7 via SketchFlow. Il vous faudra toutefois acquérir la licence Expression Studio Ultimate ou Visual Studio 2010 ultimate. Cela peut paraître assez gadget mais bien au contraire gérer une navigation à la fois simple, efficace et directe peut se révéler un vrai défi sur mobile. L'ensemble des composants sont fournis, des behaviors vous permettent comme au sein de projets SketchFlow standards, de prototyper la navigation ou encore les fonctionnalités WP7 telles que ainsi que les notifications toast. Les boutons HardWare Back et Search, ainsi que l'écran de démarrage WP7, sont également fournis, cela vous permettra de simuler les comportements d'une vrai application. Mais alors, la question qui revient, à quoi sert-il de passer par un prototype ? la réponse est encore la même, la facilité d'utilisation de SketchFlow et la rapidité de construction des interfaces et de la navigation vous permettront de tester de nombreux scénarii utilisateur avant d'entrer dans une phase de production pure et dure. On gagnera forcément du temps...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2011/06/10/sketchflow-for-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ForceColumnBoundary AttachedProperty</title>
		<link>http://www.tweened.org/fr/2011/05/31/forcecolumnboundary-attachedproperty/</link>
		<comments>http://www.tweened.org/fr/2011/05/31/forcecolumnboundary-attachedproperty/#comments</comments>
		<pubDate>Tue, 31 May 2011 07:47:40 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Composants]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tutos Docs]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[AttachedProperty]]></category>

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

J'ai récemment eu besoin  d'un Datagrid avec lignes dépliables, c'est une demande classique de nos clients et des éditeurs comme Telerik propose cette fonctionnalité en standard. Toutefois les clients ne souhaite pas toujours dépenser 1000$  de licence. Du coup, je suis parti d'une ListBox que j'ai configuré pour qu'elle prenne la forme d'un [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p><a href="http://www.tweened.org/wp-content/files/corrigeGridForce.png" title="corrigeGridForce" rel="lightbox[1088]"><img src="http://www.tweened.org/wp-content/files/corrigeGridForce.png" alt="" title="corrigeGridForce" width="630" height="200" class="aligncenter size-full wp-image-1099" /></a><br />
J'ai récemment eu besoin  d'un Datagrid avec lignes dépliables, c'est une demande classique de nos clients et des éditeurs comme Telerik propose cette fonctionnalité en standard. Toutefois les clients ne souhaite pas toujours dépenser 1000$  de licence. Du coup, je suis parti d'une ListBox que j'ai configuré pour qu'elle prenne la forme d'un Datagrid, déplier une ligne se révèle assez simple dans ce cas. Pourtant je suis tombé sur un bug du Panel Grid auquel je ne m'attendais pas vraiment. Chaque colonne de ma grille au sein de mon ItemTemplate possède une valeur relative, chacune d'entre elles possède un FrameworkElement dans le cas présent un TextBlock.</p>
<p><a href="http://www.tweened.org/wp-content/files/ItemTemplate.png" title="ItemTemplate" rel="lightbox[1088]"><img class="aligncenter size-full wp-image-1090" title="ItemTemplate" src="http://www.tweened.org/wp-content/files/ItemTemplate.png" alt="" width="630" height="75" /></a></p>
<p>Toutefois lorsque le contenu d'un TextBlock (par exemple)  au sein d'une colonne est trop important, cela décale chaque colonne, du coup on perd l'effet Datagrid. Ce comportement du Layout est illogique si l'on considère qu'en mode Stretch horizontal, chaque TextBlock ne devrait pas dépasser la largeur de la colonne dans laquelle il se trouve. Le résultat est affiché ci-dessous.</p>
<p><a href="http://www.tweened.org/wp-content/files/nonCorrigeGrid.png" title="nonCorrigeGrid" rel="lightbox[1088]"><img class="aligncenter size-full wp-image-1091" title="nonCorrigeGrid" src="http://www.tweened.org/wp-content/files/nonCorrigeGrid.png" alt="" width="630" height="144" /></a>Pour remédier à cela, j'ai codé une propriété attachée qui force chaque élément au sein d'une colonne à respecter les limites de cette dernière. Le code est relativement simple :</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #FF0000;">class</span> FrameworkElementExtension
<span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> Dictionary<span style="color: #008000;">&lt;</span>frameworkelement , GridLength<span style="color: #008000;">&gt;</span> FrameworkElementToGridLength <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Dictionary<span style="color: #008000;">&lt;/</span>frameworkelement<span style="color: #008000;">&gt;&lt;</span>frameworkelement , GridLength<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">bool</span> GetForceColumnBoundary<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>ForceColumnBoundaryProperty<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> SetForceColumnBoundary<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>
&nbsp;
            obj.<span style="color: #0000FF;">SetValue</span><span style="color: #000000;">&#40;</span>ForceColumnBoundaryProperty, 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 EnsureColumnBoundary.  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 ForceColumnBoundaryProperty <span style="color: #008000;">=</span>
        DependencyProperty.<span style="color: #0000FF;">RegisterAttached</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;ForceColumnBoundary&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: #008000;">new</span> PropertyChangedCallback<span style="color: #000000;">&#40;</span>OnEnsureColumnBoundary<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> OnEnsureColumnBoundary<span style="color: #000000;">&#40;</span>DependencyObject d, DependencyPropertyChangedEventArgs e<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
&nbsp;
        <span style="color: #FF0000;">bool</span> b <span style="color: #008000;">=</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: #008000;">;</span>
&nbsp;
        FrameworkElement fe <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>fe <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;
        Grid g <span style="color: #008000;">=</span> fe.<span style="color: #0000FF;">Parent</span> <span style="color: #0600FF;">as</span> Grid<span style="color: #008000;">;</span>
&nbsp;
        ColumnDefinition cd <span style="color: #008000;">=</span> g.<span style="color: #0000FF;">ColumnDefinitions</span><span style="color: #000000;">&#91;</span>Grid.<span style="color: #0000FF;">GetColumn</span><span style="color: #000000;">&#40;</span>fe<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>g <span style="color: #008000;">==</span> <span style="color: #0600FF;">null</span> <span style="color: #008000;">||</span> cd <span style="color: #008000;">==</span> <span style="color: #0600FF;">null</span> <span style="color: #008000;">||</span> DesignerProperties.<span style="color: #0000FF;">GetIsInDesignMode</span><span style="color: #000000;">&#40;</span>fe<span style="color: #000000;">&#41;</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>b<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>FrameworkElementToGridLength.<span style="color: #0000FF;">ContainsKey</span><span style="color: #000000;">&#40;</span>fe<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                FrameworkElementToGridLength.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>fe, cd.<span style="color: #0000FF;">Width</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                g.<span style="color: #0000FF;">SizeChanged</span> <span style="color: #008000;">-=</span> <span style="color: #008000;">new</span> SizeChangedEventHandler<span style="color: #000000;">&#40;</span>g_SizeChanged<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                g.<span style="color: #0000FF;">SizeChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> SizeChangedEventHandler<span style="color: #000000;">&#40;</span>g_SizeChanged<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: #000000;">&#123;</span>
            FrameworkElementToGridLength.<span style="color: #0000FF;">Remove</span><span style="color: #000000;">&#40;</span>fe<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            g.<span style="color: #0000FF;">SizeChanged</span> <span style="color: #008000;">-=</span> <span style="color: #008000;">new</span> SizeChangedEventHandler<span style="color: #000000;">&#40;</span>g_SizeChanged<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;">static</span> <span style="color: #0600FF;">void</span> g_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>
        Grid g <span style="color: #008000;">=</span> sender <span style="color: #0600FF;">as</span> Grid<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>FrameworkElement fe <span style="color: #0600FF;">in</span> g.<span style="color: #0000FF;">Children</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #FF0000;">bool</span> b <span style="color: #008000;">=</span> GetForceColumnBoundary<span style="color: #000000;">&#40;</span>fe<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                GridLength gl <span style="color: #008000;">=</span> FrameworkElementToGridLength<span style="color: #000000;">&#91;</span>fe<span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
&nbsp;
                ColumnDefinition cd <span style="color: #008000;">=</span> g.<span style="color: #0000FF;">ColumnDefinitions</span><span style="color: #000000;">&#91;</span>Grid.<span style="color: #0000FF;">GetColumn</span><span style="color: #000000;">&#40;</span>fe<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
&nbsp;
                cd.<span style="color: #0000FF;">Width</span> <span style="color: #008000;">=</span> gl<span style="color: #008000;">;</span>
&nbsp;
                fe.<span style="color: #0000FF;">Width</span> <span style="color: #008000;">=</span> gl.<span style="color: #0000FF;">Value</span><span style="color: #008000;">*</span>g.<span style="color: #0000FF;">ActualWidth</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #008000;">&lt;/</span>frameworkelement<span style="color: #008000;">&gt;</span></pre></div></div>

<p>Le résultat est immédiat et fonctionne qu'elle soit le type de colonne dans votre DataGrid.<br />
<a href="http://www.tweened.org/wp-content/files/corrigeGrid1.png" title="corrigeGrid" rel="lightbox[1088]"><img src="http://www.tweened.org/wp-content/files/corrigeGrid1.png" alt="" title="corrigeGrid" width="630" height="239" class="aligncenter size-full wp-image-1095" /></a><br />
Il suffit d'appliquer la propriété attachée à l'objet que vous souhaitez contraindre dans votre grille de cette manière :</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">Text=&quot;{Binding Client}&quot; TextWrapping=&quot;Wrap&quot; Grid.Column=&quot;1&quot;  
		local:FrameworkElementExtension.ForceColumnBoundary=&quot;True&quot;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2011/05/31/forcecolumnboundary-attachedproperty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Team Blog Post preparing MIX</title>
		<link>http://www.tweened.org/fr/2011/04/09/team-blog-post-preparing-mix/</link>
		<comments>http://www.tweened.org/fr/2011/04/09/team-blog-post-preparing-mix/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 23:05:21 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Actus]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[annonce]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mix]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/?p=1080</guid>
		<description><![CDATA[
L'avenir est en marche, ce post est important si vous suivez l'actualité Silverlight. Concrètement ce n'est pas un effet Bob Muglia que l'on a mais plutôt une réflexion arrivée à maturation qui nous est délivrée par Scott Guthrie et ses collègues. Ils débattent de la place actuelle et future des plugins comme Flash et Silverlight [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p><a href="http://www.tweened.org/wp-content/files/TeamBlogPostCapture.jpg" title="TeamBlogPostCapture" rel="lightbox[1080]"><img class="aligncenter size-full wp-image-1081" title="TeamBlogPostCapture" src="http://www.tweened.org/wp-content/files/TeamBlogPostCapture.jpg" alt="" width="630" height="200" /></a>L'avenir est en marche, <a href="http://team.silverlight.net/announcement/standards-based-web-plug-ins-and-silverlight/" target="_blank">ce post est important</a> si vous suivez l'actualité Silverlight. Concrètement ce n'est pas un effet Bob Muglia que l'on a mais plutôt une réflexion arrivée à maturation qui nous est délivrée par Scott Guthrie et ses collègues. Ils débattent de la place actuelle et future des plugins comme Flash et Silverlight dans un monde HTML5. Silverlight a de beaux jours devant lui, si certains développeurs rêvaient du "tout Silverlight", ils seront déçus. Le HTML5 arrive et prendra une part significative des futurs développements webs. Toutefois, tous les scénarii avancés resteront dans le giron Silverlight. Le livecycle est plus court, plus réactif et les fonctionnalités sont beaucoup plus riches que celles proposées par le HTML5. En attendant, la future problématique concerne le tooling. Microsoft ne peut simplement pas ignorer la nouvelle version du langage HTML et proposera sans doute des outils pour répondre au besoin d'outil de conception dédié au web pur et dur... c'est ce que l'article évoque en partie, bonne lecture...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tweened.org/fr/2011/04/09/team-blog-post-preparing-mix/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<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>Fournir ItemsSource à partir de champs/propriétés statiques</title>
		<link>http://www.tweened.org/fr/2011/02/16/fournir-itemssource-a-partir-de-champsproprietes-statiques/</link>
		<comments>http://www.tweened.org/fr/2011/02/16/fournir-itemssource-a-partir-de-champsproprietes-statiques/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 01:53:20 +0000</pubDate>
		<dc:creator>Eric Ambrosi</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tutos Docs]]></category>

		<guid isPermaLink="false">http://www.tweened.org/fr/?p=975</guid>
		<description><![CDATA[
Lorsque l'on crée un Objet valeur sans logique, il est souvent nécessaire de récupérer la liste de ses propriétés ou de ses champs statiques. De cette manière vous pouvez l'affecter à une propriété ItemsSource de ComboBox ou d'AutoCompleteBox et ainsi, filtrer une listBox de ValueObject. Sous Silverlight, rien n'est réellement prévu à cet effet. Il [...]]]></description>
			<content:encoded><![CDATA[<ul class="#dtreecatwrapper"></ul>
<p style="text-align: left;"><a href="http://www.tweened.org/wp-content/files/wp7s.jpg" title="wp7s" rel="lightbox[975]"><img class="aligncenter size-full wp-image-976" style="border: 0pt none; margin: 4px 0px;" title="wp7s" src="http://www.tweened.org/wp-content/files/wp7s.jpg" alt="" width="630" height="200" /></a>Lorsque l'on crée un Objet valeur sans logique, il est souvent nécessaire de récupérer la liste de ses propriétés ou de ses champs statiques. De cette manière vous pouvez l'affecter à une propriété ItemsSource de ComboBox ou d'AutoCompleteBox et ainsi, filtrer une listBox de ValueObject. Sous Silverlight, rien n'est réellement prévu à cet effet. Il serait possible de créer une énumération en affectant des attributs à chacune des valeurs contenues. Toutefois cette méthode est un peu lourde, avec un peu de réflexion on arrive à un résultat efficace sans se compliquer la vie. Il faut tout d'abord créer une classe contenant les champs ou les propriétés statiques :</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> WindowsPhone7
<span style="color: #000000;">&#123;</span>
     <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> Undefined <span style="color: #008000;">=</span> <span style="color: #666666;">&quot; &quot;</span><span style="color: #008000;">;</span>
     <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> Omnia7<span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Samsung Omnia 7&quot;</span><span style="color: #008000;">;</span>
     <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> Focus<span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Samsung Focus&quot;</span><span style="color: #008000;">;</span>
     <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> HD7<span style="color: #008000;">=</span> <span style="color: #666666;">&quot;HTC HD 7&quot;</span><span style="color: #008000;">;</span>
     <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> Optimus7<span style="color: #008000;">=</span> <span style="color: #666666;">&quot;LG Optimus 7&quot;</span><span style="color: #008000;">;</span>
     <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> VenuePro<span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Dell venue Pro&quot;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Ensuite côté VueModèle, vous pouvez exposer une liste de ces dernières grâce à un peu de réflexion et à Linq :</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">String</span><span style="color: #008000;">&gt;</span> WP7Types
<span style="color: #000000;">&#123;</span>
    get
     <span style="color: #000000;">&#123;</span>
         Type t <span style="color: #008000;">=</span> <span style="color: #008000;">typeof</span><span style="color: #000000;">&#40;</span>WindowsPhone7<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
         <span style="color: #008080; font-style: italic;">//GetProperties en lieu et place de getFields si beseoin</span>
         var call <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>from opp <span style="color: #0600FF;">in</span> t.<span style="color: #0000FF;">GetFields</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> select opp.<span style="color: #0000FF;">GetValue</span><span style="color: #000000;">&#40;</span>t<span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">as</span> <span style="color: #FF0000;">string</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToList</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
         <span style="color: #0600FF;">return</span> call<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Rien d'autre à faire à part un binding sur le ItemsSource d'un ItemsControl et le tour est joué <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/2011/02/16/fournir-itemssource-a-partir-de-champsproprietes-statiques/feed/</wfw:commentRss>
		<slash:comments>1</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>
	</channel>
</rss>

