<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Ucaya Blog</title>
  <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/" />
  <link rel="self" href="http://www.ucaya.com/blog/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2011-10-11T17:21:59.9655299+02:00</updated>
  <author>
    <name>Ucaya Team</name>
  </author>
  <subtitle />
  <id>http://www.ucaya.com/blog/</id>
  <generator uri="http://dasblog.info/" version="2.3.9074.18820">DasBlog</generator>
  <entry>
    <title>Présentation Kinect - semaine Internet des Objets - Brest</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2011/10/11/Pr%c3%a9sentationKinectSemaineInternetDesObjetsBrest.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,57ae88a2-a50d-4a80-a731-852840361969.aspx</id>
    <published>2011-10-11T17:21:59.9655299+02:00</published>
    <updated>2011-10-11T17:21:59.9655299+02:00</updated>
    <author>
      <name>Thierry Bouquain</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Entre le 3 et le 7 octobre 2011 se tenait à Brest la <a href="http://www.b-ware.fr/2011/07/03/b-ware-une-semaine-de-rencontres-sur-l%e2%80%99internet-des-objets-et-les-objets-de-l%e2%80%99internet/" target="_blank">“semaine
Internet des Objets”</a>. Ucaya y était présent pour faire une présentation / atelier
autour de Kinect.
</p>
        <h1>La présentation
</h1>
        <p>
Cette session avait plusieurs buts que nous avons axé en destination d’un public novice. 
</p>
        <ul>
          <li>
En premier nous avons introduit le capteur en lui même et son principe de fonctionnement. 
</li>
          <li>
Puis à travers de brèves démos nous avons présenté comment accéder aux différents
flux avec “<a href="http://research.microsoft.com/en-us/um/redmond/projects/kinectsdk/" target="_blank">Kinect
for windows sdk</a>”.</li>
          <li>
Nous avons terminé la présentation par les usages de Kinect. Les réflexions liées
à un cette nouvelle manière d’agir avec la machine et leurs applications sur un lecteur
de flux videos au travers du framework <a href="http://kinectextensions.codeplex.com/" target="_blank">KinectExtensions</a>.</li>
        </ul>
        <h1>L’atelier
</h1>
        <p>
Pour cette partie nous avons proposé de réaliser un casse brique. A partir du squelette
du jeu, les participants ont pû comprendre le fonctionnement du sdk et cabler les
interactions.
</p>
        <p>
          <a href="http://www.ucaya.com/blog/content/binary/Windows-Live-Writer/Prsentation-KinectSemaine_DC1B/arkinectoid_4.jpg">
            <img title="arkinectoid" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: right; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="arkinectoid" align="right" src="http://www.ucaya.com/blog/content/binary/Windows-Live-Writer/Prsentation-KinectSemaine_DC1B/arkinectoid_thumb_1.jpg" width="244" height="201" />
          </a>Fichiers
liés à la présentation :
</p>
        <ul>
          <li>
            <a href="https://skydrive.live.com/view.aspx?cid=A50A4BDBECBD99EE&amp;resid=A50A4BDBECBD99EE%21110" target="_blank">Kinect
- semaine internet de Objets - Brest.pptx</a>
          </li>
          <li>
            <a href="https://skydrive.live.com/view.aspx?cid=A50A4BDBECBD99EE&amp;resid=A50A4BDBECBD99EE%21111" target="_blank">Hands
on Lab – ArKinectOid - Brest.docx</a>
          </li>
          <li>
            <a href="https://skydrive.live.com/?cid=a50a4bdbecbd99ee&amp;sc=documents&amp;uc=2&amp;id=A50A4BDBECBD99EE%21109#" target="_blank">Arkinectoid
- sources.7z</a>
          </li>
          <li>
            <a title="Arkinectoid.exe.7z" href="https://skydrive.live.com/?cid=a50a4bdbecbd99ee&amp;sc=documents&amp;uc=2&amp;id=A50A4BDBECBD99EE%21109#">Arkinectoid.exe.7z</a>
          </li>
        </ul>
        <img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=57ae88a2-a50d-4a80-a731-852840361969" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Désactiver le bouton d’une ScrollBar quand elle est au Minimum ou au Maximum</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2010/06/03/D%c3%a9sactiverLeBoutonDuneScrollBarQuandElleEstAuMinimumOuAuMaximum.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,9691defd-a426-4ffb-bdc6-46034be57042.aspx</id>
    <published>2010-06-03T15:30:51.4413693+02:00</published>
    <updated>2010-06-03T15:30:51.4413693+02:00</updated>
    <category term="Dev" label="Dev" scheme="http://www.ucaya.com/blog/CategoryView,category,Dev.aspx" />
    <category term="Silverlight" label="Silverlight" scheme="http://www.ucaya.com/blog/CategoryView,category,Silverlight.aspx" />
    <category term="slextensions" label="slextensions" scheme="http://www.ucaya.com/blog/CategoryView,category,slextensions.aspx" />
    <author>
      <name>Thierry Bouquain</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Le contrôle ScrollBar de Silverlight ne désactive pas les boutons des ScrollBars lorsque
le curseur arrive à une extrémité.
</p>
        <p>
          <a href="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/DsactiverleboutonduneScrollBarquandellee_BFE4/image_2.png">
            <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/DsactiverleboutonduneScrollBarquandellee_BFE4/image_thumb.png" width="93" height="35" />
          </a>
        </p>
        <p>
Ce design n’est en général pas satisfaisant dès l’instant ou on veut faire une application
un peu jolie et ergonomique.
</p>
        <p>
          <a href="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/DsactiverleboutonduneScrollBarquandellee_BFE4/image_4.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/DsactiverleboutonduneScrollBarquandellee_BFE4/image_thumb_1.png" width="112" height="49" />
          </a>
        </p>
        <p>
Pour activer ce comportement sur une ScrollBar, il faut éditer son template et utiliser
la classe ScrollBarExtensions. Dans le Template nous commençons par activer la classe
d’extensions sur la ScrollBar. Sur n’importe quel élément du template il suffit de
déclarer l’AttachedProperty suivante:
</p>
        <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #a31515">                        </span>
            <span style="color: blue">&lt;</span>
            <span style="color: #a31515">Grid</span>
            <span style="color: red"> x</span>
            <span style="color: blue">:</span>
            <span style="color: red">Name</span>
            <span style="color: blue">="Root"</span>
          </p>
          <p style="margin: 0px">
                             <span style="color: red">slec</span><span style="color: blue">:</span><span style="color: red">ScrollBarExtensions.RegisterScrollbar</span><span style="color: blue">="{</span><span style="color: #a31515">Binding</span><span style="color: red"> RelativeSource</span><span style="color: blue">={</span><span style="color: #a31515">RelativeSource</span><span style="color: red"> TemplatedParent</span><span style="color: blue">}}"&gt;</span></p>
          <p style="margin: 0px">
 
</p>
        </div>
        <p>
Une fois initialisée, la classe d’extensions calcule si la valeur est différente du
Minimum ou Maximum et pose deux AttachedProperty sur la ScrollBar : CanIncrease et
CanDecrease. Il ne reste plus en suite qu’à Binder les propriété IsEnabled des boutons
à ces valeurs.
</p>
        <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: red"> IsEnabled</span>
            <span style="color: blue">="{</span>
            <span style="color: #a31515">Binding</span>
            <span style="color: blue"> (slec:ScrollBarExtensions.CanDecrease),</span>
            <span style="color: red"> RelativeSource</span>
            <span style="color: blue">={</span>
            <span style="color: #a31515">RelativeSource</span>
            <span style="color: red"> TemplatedParent</span>
            <span style="color: blue">}}"</span>
          </p>
        </div>
        <p>
        </p>
        <p>
La classe ScrollBarExtensions:
</p>
        <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
          <p style="margin: 0px">
    <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
    <span style="color: gray">///</span><span style="color: green"> Provide
behavior extensions to a ScrollBar control. When registered add CanIncrease and CanDecrease
attached property</span></p>
          <p style="margin: 0px">
    <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
    <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">class</span><span style="color: #2b91af">ScrollBarExtensions</span></p>
          <p style="margin: 0px">
    {
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> Get
the epsillon value arround the Maximum or Minimum value that activate or deactive
the CanIncrease and CanDecrease property</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="obj"&gt;&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;returns&gt;&lt;/returns&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">double</span> GetEpsillon(<span style="color: #2b91af">DependencyObject</span> obj)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: blue">return</span> (<span style="color: blue">double</span>)obj.GetValue(EpsillonProperty);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> Set
the epsillon value arround the Maximum or Minimum value that activate or deactive
the CanIncrease and CanDecrease property</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="obj"&gt;&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="value"&gt;&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">void</span> SetEpsillon(<span style="color: #2b91af">DependencyObject</span> obj, <span style="color: blue">double</span> value)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            obj.SetValue(EpsillonProperty,
value);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: green">// Using a DependencyProperty
as the backing store for Epsillon.  This enables animation, styling, binding,
etc...</span></p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">readonly</span><span style="color: #2b91af">DependencyProperty</span> EpsillonProperty
=
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">DependencyProperty</span>.RegisterAttached(<span style="color: #a31515">"Epsillon"</span>, <span style="color: blue">typeof</span>(<span style="color: blue">double</span>), <span style="color: blue">typeof</span>(<span style="color: #2b91af">ScrollBarExtensions</span>), <span style="color: blue">new</span><span style="color: #2b91af">PropertyMetadata</span>(0.001d));
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> Get
the registered ScrollBar</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="obj"&gt;&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;returns&gt;&lt;/returns&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: #2b91af">ScrollBar</span> GetRegisterScrollbar(<span style="color: #2b91af">DependencyObject</span> obj)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: blue">return</span> (<span style="color: #2b91af">ScrollBar</span>)obj.GetValue(RegisterScrollbarProperty);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> Register
a ScrollBar</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="obj"&gt;&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="value"&gt;&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">void</span> SetRegisterScrollbar(<span style="color: #2b91af">DependencyObject</span> obj, <span style="color: #2b91af">ScrollBar</span> value)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            obj.SetValue(RegisterScrollbarProperty,
value);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">readonly</span><span style="color: #2b91af">DependencyProperty</span> RegisterScrollbarProperty
=
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">DependencyProperty</span>.RegisterAttached(<span style="color: #a31515">"RegisterScrollbar"</span>, <span style="color: blue">typeof</span>(<span style="color: #2b91af">ScrollBar</span>), <span style="color: blue">typeof</span>(<span style="color: #2b91af">ScrollBarExtensions</span>), <span style="color: blue">new</span><span style="color: #2b91af">PropertyMetadata</span>(RegisterScrollbarChangedCallback));
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: blue">private</span><span style="color: blue">static</span><span style="color: blue">void</span> RegisterScrollbarChangedCallback(<span style="color: #2b91af">DependencyObject</span> d, <span style="color: #2b91af">DependencyPropertyChangedEventArgs</span> e)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: blue">var</span> sb
= (<span style="color: #2b91af">ScrollBar</span>)e.OldValue;
</p>
          <p style="margin: 0px">
            <span style="color: blue">if</span> (sb
!= <span style="color: blue">null</span>)
</p>
          <p style="margin: 0px">
            {
</p>
          <p style="margin: 0px">
               
sb.ValueChanged -= storyBoardPropertyChanged;
</p>
          <p style="margin: 0px">
               
sb.RemoveChangedHandler(<span style="color: #a31515">"Maximum"</span>, storyBoardDependecyPropertyChanged);
</p>
          <p style="margin: 0px">
               
sb.RemoveChangedHandler(<span style="color: #a31515">"Minimum"</span>, storyBoardDependecyPropertyChanged);
</p>
          <p style="margin: 0px">
            }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            sb = (<span style="color: #2b91af">ScrollBar</span>)e.NewValue;
</p>
          <p style="margin: 0px">
            <span style="color: blue">if</span> (sb
!= <span style="color: blue">null</span>)
</p>
          <p style="margin: 0px">
            {
</p>
          <p style="margin: 0px">
               
sb.ValueChanged += storyBoardPropertyChanged;
</p>
          <p style="margin: 0px">
               
sb.AddChangedHandler(<span style="color: #a31515">"Maximum"</span>, storyBoardDependecyPropertyChanged);
</p>
          <p style="margin: 0px">
               
sb.AddChangedHandler(<span style="color: #a31515">"Minimum"</span>, storyBoardDependecyPropertyChanged);
</p>
          <p style="margin: 0px">
               
RefreshValue(sb);
</p>
          <p style="margin: 0px">
            }
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: blue">private</span><span style="color: blue">static</span><span style="color: blue">void</span> RefreshValue(<span style="color: #2b91af">ScrollBar</span> sb)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: blue">var</span> epsillon
= GetEpsillon(sb);
</p>
          <p style="margin: 0px">
            SetCanDecrease(sb,
(sb.Value - sb.Minimum) &gt; epsillon);
</p>
          <p style="margin: 0px">
            SetCanIncrease(sb,
(sb.Maximum - sb.Value) &gt; epsillon);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: blue">static</span><span style="color: blue">void</span> storyBoardDependecyPropertyChanged(<span style="color: blue">object</span> sender, <span style="color: #2b91af">DependencyPropertyChangedEventArgs</span> e)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            RefreshValue((<span style="color: #2b91af">ScrollBar</span>)sender);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
        <span style="color: blue">static</span><span style="color: blue">void</span> storyBoardPropertyChanged(<span style="color: blue">object</span> sender, <span style="color: #2b91af">EventArgs</span> e)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            RefreshValue((<span style="color: #2b91af">ScrollBar</span>)sender);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> true
when the Value of a ScrollBar is greater than the Minimum + the Epsillon value</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="obj"&gt;&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;returns&gt;&lt;/returns&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">bool</span> GetCanDecrease(<span style="color: #2b91af">DependencyObject</span> obj)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: blue">return</span> (<span style="color: blue">bool</span>)obj.GetValue(CanDecreaseProperty);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">void</span> SetCanDecrease(<span style="color: #2b91af">DependencyObject</span> obj, <span style="color: blue">bool</span> value)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            obj.SetValue(CanDecreaseProperty,
value);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">readonly</span><span style="color: #2b91af">DependencyProperty</span> CanDecreaseProperty
=
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">DependencyProperty</span>.RegisterAttached(<span style="color: #a31515">"CanDecrease"</span>, <span style="color: blue">typeof</span>(<span style="color: blue">bool</span>), <span style="color: blue">typeof</span>(<span style="color: #2b91af">ScrollBarExtensions</span>), <span style="color: blue">null</span>);
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> true
when the Value of a ScrollBar is loawer than the Maximum - the Epsillon value</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="obj"&gt;&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;returns&gt;&lt;/returns&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">bool</span> GetCanIncrease(<span style="color: #2b91af">DependencyObject</span> obj)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: blue">return</span> (<span style="color: blue">bool</span>)obj.GetValue(CanIncreaseProperty);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">void</span> SetCanIncrease(<span style="color: #2b91af">DependencyObject</span> obj, <span style="color: blue">bool</span> value)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            obj.SetValue(CanIncreaseProperty,
value);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">readonly</span><span style="color: #2b91af">DependencyProperty</span> CanIncreaseProperty
=
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">DependencyProperty</span>.RegisterAttached(<span style="color: #a31515">"CanIncrease"</span>, <span style="color: blue">typeof</span>(<span style="color: blue">bool</span>), <span style="color: blue">typeof</span>(<span style="color: #2b91af">ScrollBarExtensions</span>), <span style="color: blue">null</span>);
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
    }
</p>
        </div>
        <img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=9691defd-a426-4ffb-bdc6-46034be57042" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Etre notifié du changement de valeur d’une DependencyProperty</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2010/06/03/EtreNotifi%c3%a9DuChangementDeValeurDuneDependencyProperty.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,51278873-94e9-4261-bd78-d2a7b407a3d1.aspx</id>
    <published>2010-06-03T15:07:24.5907798+02:00</published>
    <updated>2010-06-03T15:07:24.5907798+02:00</updated>
    <category term="Dev" label="Dev" scheme="http://www.ucaya.com/blog/CategoryView,category,Dev.aspx" />
    <category term="Silverlight" label="Silverlight" scheme="http://www.ucaya.com/blog/CategoryView,category,Silverlight.aspx" />
    <category term="slextensions" label="slextensions" scheme="http://www.ucaya.com/blog/CategoryView,category,slextensions.aspx" />
    <category term="WPF" label="WPF" scheme="http://www.ucaya.com/blog/CategoryView,category,WPF.aspx" />
    <author>
      <name>Thierry Bouquain</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Les contrôles n’implémentent pas tous des événements notifiant du changement de valeur
de leurs propriétés. Un moyen d’être notifié est d’utiliser le Binding. Voici une
classe fournissant des méthodes d’extensions sur les DependencyObject pour ajouter
des handlers d’événements.
</p>
        <p>
Ajouter un événement très simple :
</p>
        <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #2b91af">ScrollBar</span> sb
= <span style="color: blue">new</span><span style="color: #2b91af">ScrollBar</span>();
</p>
          <p style="margin: 0px">
            sb.AddChangedHandler(<span style="color: #a31515">"Value"</span>,
(o, e) =&gt;
</p>
          <p style="margin: 0px">
            {
</p>
          <p style="margin: 0px">
                <span style="color: #2b91af">MessageBox</span>.Show(<span style="color: #2b91af">Convert</span>.ToString(e.NewValue));
</p>
          <p style="margin: 0px">
            });
</p>
        </div>
        <p>
Code :
</p>
        <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
          <p style="margin: 0px">
    <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">class</span><span style="color: #2b91af">DependencyObjectExtensions</span></p>
          <p style="margin: 0px">
    {
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> Inner
class bound to the Property we want to monitor</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">private</span><span style="color: blue">class</span><span style="color: #2b91af">BindingSubscription</span> : <span style="color: #2b91af">DependencyObject</span>, <span style="color: #2b91af">IDisposable</span></p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"> Constructor</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="source"&gt;</span><span style="color: green">The DependencyObject
instance on which we want to monitor the property</span><span style="color: gray">&lt;/param&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="name"&gt;</span><span style="color: green">The PropertyPath to the
property we want to monitor</span><span style="color: gray">&lt;/param&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="handler"&gt;</span><span style="color: green">The handler to invoke
when the property changed</span><span style="color: gray">&lt;/param&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: blue">public</span> BindingSubscription(<span style="color: #2b91af">DependencyObject</span> source, <span style="color: blue">string</span> name, <span style="color: #2b91af">DependencyPropertyChangedEventHandler</span> handler)
</p>
          <p style="margin: 0px">
            {
</p>
          <p style="margin: 0px">
                <span style="color: blue">this</span>.Handler
= handler;
</p>
          <p style="margin: 0px">
               
binding = <span style="color: blue">new</span><span style="color: #2b91af">Binding</span>(name)
{ Source = source };
</p>
          <p style="margin: 0px">
                <span style="color: blue">this</span>.PropertyPath
= name;
</p>
          <p style="margin: 0px">
                <span style="color: #2b91af">BindingOperations</span>.SetBinding(<span style="color: blue">this</span>,
ValueProperty, binding);
</p>
          <p style="margin: 0px">
            }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: blue">private</span><span style="color: #2b91af">Binding</span> binding;
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"> The
PropertyPath to the property we want to monitor</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: blue">public</span><span style="color: blue">string</span> PropertyPath
{ <span style="color: blue">get</span>; <span style="color: blue">set</span>; }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"> The
handler to invoke when the property changed</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: blue">public</span><span style="color: #2b91af">DependencyPropertyChangedEventHandler</span> Handler
{ <span style="color: blue">get</span>; <span style="color: blue">set</span>; }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"> Value
depedency property.</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
            <p style="margin: 0px">
            <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">readonly</span><span style="color: #2b91af">DependencyProperty</span> ValueProperty
=
</p>
            <p style="margin: 0px">
                <span style="color: #2b91af">DependencyProperty</span>.Register(
</p>
            <p style="margin: 0px">
                    <span style="color: #a31515">"Value"</span>,
</p>
            <p style="margin: 0px">
                    <span style="color: blue">typeof</span>(<span style="color: blue">object</span>),
</p>
            <p style="margin: 0px">
                    <span style="color: blue">typeof</span>(<span style="color: #2b91af">BindingSubscription</span>),
</p>
            <p style="margin: 0px">
                    <span style="color: blue">new</span><span style="color: #2b91af">PropertyMetadata</span>((d,
e) =&gt;
</p>
            <p style="margin: 0px">
                   
{
</p>
            <p style="margin: 0px">
                        <span style="color: blue">var</span> subscription
= ((<span style="color: #2b91af">BindingSubscription</span>)d);
</p>
            <p style="margin: 0px">
                        <span style="color: blue">var</span> handler
= subscription.Handler;
</p>
            <p style="margin: 0px">
                        <span style="color: blue">if</span> (handler
!= <span style="color: blue">null</span>)
</p>
            <p style="margin: 0px">
                           
handler(subscription.source, e);
</p>
            <p style="margin: 0px">
                   
}));
</p>
          </div>
          <p style="margin: 0px">
          </p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"> Release
the binding from the source</span></p>
          <p style="margin: 0px">
            <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: blue">public</span><span style="color: blue">void</span> Dispose()
</p>
          <p style="margin: 0px">
            {
</p>
          <p style="margin: 0px">
                <span style="color: blue">this</span>.ClearValue(ValueProperty);
</p>
          <p style="margin: 0px">
            }
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> Get
the list of BindingSubscription stored on one object</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="obj"&gt;&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;returns&gt;&lt;/returns&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">private</span><span style="color: blue">static</span><span style="color: #2b91af">List</span>&lt;<span style="color: #2b91af">BindingSubscription</span>&gt;
GetListeners(<span style="color: #2b91af">DependencyObject</span> obj)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: blue">var</span> list
= (<span style="color: #2b91af">List</span>&lt;<span style="color: #2b91af">BindingSubscription</span>&gt;)obj.GetValue(ListenersProperty);
</p>
          <p style="margin: 0px">
            <span style="color: blue">if</span> (list
== <span style="color: blue">null</span>)
</p>
          <p style="margin: 0px">
            {
</p>
          <p style="margin: 0px">
               
list = <span style="color: blue">new</span><span style="color: #2b91af">List</span>&lt;<span style="color: #2b91af">BindingSubscription</span>&gt;();
</p>
          <p style="margin: 0px">
               
SetListeners(obj, list);
</p>
          <p style="margin: 0px">
            }
</p>
          <p style="margin: 0px">
            <span style="color: blue">return</span> list;
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> Set
the list of BindingSubscription on an object</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="obj"&gt;&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="value"&gt;&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">private</span><span style="color: blue">static</span><span style="color: blue">void</span> SetListeners(<span style="color: #2b91af">DependencyObject</span> obj, <span style="color: #2b91af">List</span>&lt;<span style="color: #2b91af">BindingSubscription</span>&gt;
value)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            obj.SetValue(ListenersProperty,
value);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> Listeners
dependency property</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">private</span><span style="color: blue">static</span><span style="color: blue">readonly</span><span style="color: #2b91af">DependencyProperty</span> ListenersProperty
=
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">DependencyProperty</span>.RegisterAttached(<span style="color: #a31515">"Listeners"</span>, <span style="color: blue">typeof</span>(<span style="color: #2b91af">List</span>&lt;<span style="color: #2b91af">BindingSubscription</span>&gt;), <span style="color: blue">typeof</span>(<span style="color: #2b91af">DependencyObjectExtensions</span>), <span style="color: blue">null</span>);
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> Add
a handler to a DependencyProperty for change notification</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="source"&gt;</span><span style="color: green">The DependencyObject
instance on which we want to monitor the property</span><span style="color: gray">&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="name"&gt;</span><span style="color: green">The PropertyPath to the
property we want to monitor</span><span style="color: gray">&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="handler"&gt;</span><span style="color: green">The handler to invoke
when the property changed</span><span style="color: gray">&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">void</span> AddChangedHandler(<span style="color: blue">this</span><span style="color: #2b91af">DependencyObject</span> source, <span style="color: blue">string</span> name, <span style="color: #2b91af">DependencyPropertyChangedEventHandler</span> handler)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: green">//
Create the binding</span></p>
          <p style="margin: 0px">
            <span style="color: #2b91af">BindingSubscription</span> subscriber
= <span style="color: blue">new</span><span style="color: #2b91af">BindingSubscription</span>(source,
name, handler);
</p>
          <p style="margin: 0px">
            <span style="color: green">//
Store the binding into de DependencyObject to prevent garbage collection of the subscriber</span></p>
          <p style="margin: 0px">
            GetListeners(source).Add(subscriber);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"> Remove
a handler from a DependencyProperty</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;/summary&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="source"&gt;</span><span style="color: green">The DependencyObject
instance on which we want to monitor the property</span><span style="color: gray">&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="name"&gt;</span><span style="color: green">The PropertyPath to the
property we want to monitor</span><span style="color: gray">&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: gray">///</span><span style="color: green"></span><span style="color: gray">&lt;param
name="handler"&gt;</span><span style="color: green">The handler to invoke
when the property changed</span><span style="color: gray">&lt;/param&gt;</span></p>
          <p style="margin: 0px">
        <span style="color: blue">public</span><span style="color: blue">static</span><span style="color: blue">void</span> RemoveChangedHandler(<span style="color: blue">this</span><span style="color: #2b91af">DependencyObject</span> source, <span style="color: blue">string</span> name, <span style="color: #2b91af">DependencyPropertyChangedEventHandler</span> handler)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: blue">var</span> subscribers
= GetListeners(source);
</p>
          <p style="margin: 0px">
            <span style="color: blue">var</span> subscriber
= subscribers.FirstOrDefault(s =&gt; s.Handler == handler &amp;&amp; s.PropertyPath
== name);
</p>
          <p style="margin: 0px">
            <span style="color: blue">if</span> (subscriber
!= <span style="color: blue">null</span>)
</p>
          <p style="margin: 0px">
            {
</p>
          <p style="margin: 0px">
               
subscriber.Dispose();
</p>
          <p style="margin: 0px">
               
subscribers.Remove(subscriber);
</p>
          <p style="margin: 0px">
            }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: blue">if</span> (subscribers.Count
== 0)
</p>
          <p style="margin: 0px">
               
source.ClearValue(ListenersProperty);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
    }
</p>
        </div>
        <img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=51278873-94e9-4261-bd78-d2a7b407a3d1" />
      </div>
    </content>
  </entry>
  <entry>
    <title>SLExtensions – Création d’un player vidéo avec SLMedia – partie 1</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2010/05/30/SLExtensionsCr%c3%a9ationDunPlayerVid%c3%a9oAvecSLMediaPartie1.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,c5d4361d-ff0c-493b-bf81-5be860c9f079.aspx</id>
    <published>2010-05-30T18:14:55.9837301+02:00</published>
    <updated>2010-05-30T18:14:55.9837301+02:00</updated>
    <category term="Dev" label="Dev" scheme="http://www.ucaya.com/blog/CategoryView,category,Dev.aspx" />
    <category term="Silverlight" label="Silverlight" scheme="http://www.ucaya.com/blog/CategoryView,category,Silverlight.aspx" />
    <category term="slextensions" label="slextensions" scheme="http://www.ucaya.com/blog/CategoryView,category,slextensions.aspx" />
    <author>
      <name>Thierry Bouquain</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
La partie SLMedia du projet <a href="http://slextensions.codeplex.com/" target="_blank">SLExtensions</a> contient
tout le nécessaire pour réaliser un player video. Contrairement à un projet comme <a href="http://smf.codeplex.com/" target="_blank">SMF</a> qui
vous fourni un contrôle tout prêt, SLMedia vous fourni des classes “Controller” vous
permettant de développer votre player à base de MVVM. Si un player packagé est simple
à templater, il trouve vite ses limites lorsque vous voulez intégrer des comportements
spécifiques.
</p>
        <p>
Il y a quelque temps sur ce blog j’avais commencé la création d’un player video <a href="http://www.ucaya.com/blog/2009/06/08/SLMediaLePlayerPhotoVideoDeSLExtensions.aspx" target="_blank">ici</a> et <a href="http://www.ucaya.com/blog/2009/06/08/SLMediaEtSmoothStreaming.aspx" target="_blank">ici</a>.
SLMedia a évolué je vais donc mettre à jour mes exemples.
</p>
        <h1>Affichage de la vidéo
</h1>
        <p>
La classe principale de gestion reposant sur la notion de playlist, le passage d’un
élément smoothstreaming à un élément video normal n’était pas aisé. Le conteneur affichant
la vidéo (le MediaElement ou le SmoothStreamingMediaElement) et maintenant déterminé
en fonction du IMediaElement courrant. Pour être plus facilement modulaire et pour
permettre de séparer la librairie affichant du smoothstreaming, les éléments video
reposent sur des VideoAdapters qui se chargent de la création et de s’attacher aux
différents événements des composants videos. 
<br />
Le design de l’application n’a plus qu’à créer un ContentControl et récupérer le contrôle
d’affichage à partir du VideoController.
</p>
        <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #a31515">        </span>
            <span style="color: blue">&lt;</span>
            <span style="color: #a31515">ContentControl</span>
            <span style="color: red"> Content</span>
            <span style="color: blue">="{</span>
            <span style="color: #a31515">Binding</span>
            <span style="color: red"> VideoAdapter</span>
            <span style="color: blue">.Content}"</span>
          </p>
          <p style="margin: 0px">
                       <span style="color: red">VerticalContentAlignment</span><span style="color: blue">="Stretch"</span></p>
          <p style="margin: 0px">
                       <span style="color: red">HorizontalContentAlignment</span><span style="color: blue">="Stretch"
/&gt;</span></p>
        </div>
        <h1>Etats visuels
</h1>
        <p>
Grâce à Silverlight 4 qui permet maintenant de faire du binding sur des objets de
type DependencyObject, l’écriture d’un MapState est un peu simple. Il suffit de binder
la propriété Value sur l’objet à surveiller. Et lorsque la valeur change, en fonction
des différents mappings définis, l’état visuel correspondant sera déclenché.
</p>
        <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #a31515">        </span>
            <span style="color: blue">&lt;</span>
            <span style="color: #a31515">i</span>
            <span style="color: blue">:</span>
            <span style="color: #a31515">Interaction.Behaviors</span>
            <span style="color: blue">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #a31515">            </span>
            <span style="color: blue">&lt;</span>
            <span style="color: #a31515">slint</span>
            <span style="color: blue">:</span>
            <span style="color: #a31515">MapState</span>
            <span style="color: red"> Value</span>
            <span style="color: blue">="{</span>
            <span style="color: #a31515">Binding</span>
            <span style="color: red"> IsPlaying</span>
            <span style="color: blue">}"&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #a31515">                </span>
            <span style="color: blue">&lt;</span>
            <span style="color: #a31515">slint</span>
            <span style="color: blue">:</span>
            <span style="color: #a31515">MapStateMapping</span>
            <span style="color: red"> StateName</span>
            <span style="color: blue">="Playing"</span>
          </p>
          <p style="margin: 0px">
                                      <span style="color: red">Value</span><span style="color: blue">="true"
/&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #a31515">                </span>
            <span style="color: blue">&lt;</span>
            <span style="color: #a31515">slint</span>
            <span style="color: blue">:</span>
            <span style="color: #a31515">MapStateMapping</span>
            <span style="color: red"> StateName</span>
            <span style="color: blue">="Paused"</span>
          </p>
          <p style="margin: 0px">
                                      <span style="color: red">Value</span><span style="color: blue">="false"
/&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #a31515">            </span>
            <span style="color: blue">&lt;/</span>
            <span style="color: #a31515">slint</span>
            <span style="color: blue">:</span>
            <span style="color: #a31515">MapState</span>
            <span style="color: blue">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #a31515">        </span>
            <span style="color: blue">&lt;/</span>
            <span style="color: #a31515">i</span>
            <span style="color: blue">:</span>
            <span style="color: #a31515">Interaction.Behaviors</span>
            <span style="color: blue">&gt;</span>
          </p>
        </div>
        <h1>StringFormat
</h1>
        <p>
De même, grâce à Silverlight 4, exit le StringFormatConverter. Il est maintenant possible
de directement spécifier la conversion en string dans l’objet Binding.
</p>
        <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #a31515">            </span>
            <span style="color: blue">&lt;</span>
            <span style="color: #a31515">TextBlock</span>
            <span style="color: red"> Text</span>
            <span style="color: blue">="{</span>
            <span style="color: #a31515">Binding</span>
            <span style="color: red"> Path</span>
            <span style="color: blue">=BufferingProgress,</span>
            <span style="color: red"> Mode</span>
            <span style="color: blue">=TwoWay,</span>
            <span style="color: red"> StringFormat</span>
            <span style="color: blue">=p}"
/&gt;</span>
          </p>
        </div>
        <p>
        </p>
        <h1>La playlist
</h1>
        <p>
Le MediaController fournit maintenant des commandes permettant de naviguer dans la
playlist. Il suffit de relier deux boutons Précédent / Suivant à ces commandes pour
passer d’un élément à l’autre. De même, pour enchainer les éléments à la fin de la
lecture, il suffit d’activer la propriété IsChaining.
</p>
        <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
          <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
            <p style="margin: 0px">
              <span style="color: #a31515">        </span>
              <span style="color: blue">&lt;</span>
              <span style="color: #a31515">slvideo</span>
              <span style="color: blue">:</span>
              <span style="color: #a31515">VideoController</span>
              <span style="color: red"> x</span>
              <span style="color: blue">:</span>
              <span style="color: red">Name</span>
              <span style="color: blue">="controller"</span>
            </p>
            <p style="margin: 0px">
                                <span style="color: red">AutoPlay</span><span style="color: blue">="True"</span></p>
            <p style="margin: 0px">
                                <span style="color: red">IsChaining</span><span style="color: blue">="True"&gt;</span></p>
            <p style="margin: 0px">
              <span style="color: #a31515">            </span>
              <span style="color: blue">&lt;</span>
              <span style="color: #a31515">slvideo</span>
              <span style="color: blue">:</span>
              <span style="color: #a31515">VideoController.Playlist</span>
              <span style="color: blue">&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #a31515">                </span>
              <span style="color: blue">&lt;</span>
              <span style="color: #a31515">slvideo</span>
              <span style="color: blue">:</span>
              <span style="color: #a31515">VideoItem</span>
              <span style="color: red"> Source</span>
              <span style="color: blue">="http://labs.ucaya.com/lake.wmv"
/&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #a31515">                </span>
              <span style="color: blue">&lt;</span>
              <span style="color: #a31515">slvideoSmooth</span>
              <span style="color: blue">:</span>
              <span style="color: #a31515">SmoothVideoItem</span>
              <span style="color: red"> Source</span>
              <span style="color: blue">="http://mediadl.microsoft.com/mediadl/iisnet/smoothmedia/Experience/BigBuckBunny_720p.ism/Manifest"
/&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #a31515">                </span>
              <span style="color: blue">&lt;</span>
              <span style="color: #a31515">slvideo</span>
              <span style="color: blue">:</span>
              <span style="color: #a31515">VideoItem</span>
              <span style="color: red"> Source</span>
              <span style="color: blue">="http://labs.ucaya.com/butterfly.wmv"
/&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #a31515">                </span>
              <span style="color: blue">&lt;</span>
              <span style="color: #a31515">slvideo</span>
              <span style="color: blue">:</span>
              <span style="color: #a31515">VideoItem</span>
              <span style="color: red"> Source</span>
              <span style="color: blue">="http://labs.ucaya.com/bear.wmv"
/&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #a31515">            </span>
              <span style="color: blue">&lt;/</span>
              <span style="color: #a31515">slvideo</span>
              <span style="color: blue">:</span>
              <span style="color: #a31515">VideoController.Playlist</span>
              <span style="color: blue">&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #a31515">        </span>
              <span style="color: blue">&lt;/</span>
              <span style="color: #a31515">slvideo</span>
              <span style="color: blue">:</span>
              <span style="color: #a31515">VideoController</span>
              <span style="color: blue">&gt;</span>
            </p>
          </div>
        </div>
        <p>
Navigation :
</p>
        <div style="font-family: consolas; background: white; color: black; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #a31515">            </span>
            <span style="color: blue">&lt;</span>
            <span style="color: #a31515">Button</span>
            <span style="color: red"> Content</span>
            <span style="color: blue">="Previous"</span>
          </p>
          <p style="margin: 0px">
                   <span style="color: red">Command</span><span style="color: blue">="{</span><span style="color: #a31515">Binding</span><span style="color: red"> PreviousItem</span><span style="color: blue">}"
/&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #a31515">            </span>
            <span style="color: blue">&lt;</span>
            <span style="color: #a31515">Button</span>
            <span style="color: red"> Content</span>
            <span style="color: blue">="Next"</span>
          </p>
          <p style="margin: 0px">
                   <span style="color: red">Command</span><span style="color: blue">="{</span><span style="color: #a31515">Binding</span><span style="color: red"> NextItem</span><span style="color: blue">}"
/&gt;</span></p>
        </div>
        <h1>Les sources
</h1>
        <p>
        </p>
        <p>
        </p>
        <p>
          <iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="http://cid-b7145a2861d183da.skydrive.live.com/embedicon.aspx/Code/VideoPlayer2.7z" frameborder="0" marginwidth="0" scrolling="no">
          </iframe>
        </p>
        <img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=c5d4361d-ff0c-493b-bf81-5be860c9f079" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Live meeting "Ma première appli Windows Phone 7"</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2010/04/02/LiveMeetingMaPremi%c3%a8reAppliWindowsPhone7.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,b43c9315-5fb1-40e7-a6b0-904b0b55518f.aspx</id>
    <published>2010-04-02T12:27:15.3895536+02:00</published>
    <updated>2010-04-02T12:27:15.3895536+02:00</updated>
    <author>
      <name>Thierry Bouquain</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032448416&amp;Culture=fr-FR">
            <img style="border-bottom: 0px; border-left: 0px; margin: 0px 20px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/LivemeetingMapremireappliWindowsPhone_AB9A/image_5.png" width="122" height="244" />
          </a>Tu
es fan de Silverlight ou XNA, Microsoft te convie à un eEvent pour t’apprendre comment
appliquer ta techno au développement d’application Windows Phone. Tu pourras te rendre
compte de la facilité de mise en oeuvre d’une application et peut être te donner l’envie
de réaliser l’application qui “déchire” et que tout le monde voudra sur son téléphone.
</p>
        <p>
Je suis sur que tu n’as rien de mieux à faire le 29 avril à 18h, alors n’hésite pas
à te connecter là : <a href="https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032448416&amp;Culture=fr-FR">https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032448416&amp;Culture=fr-FR</a></p>
        <img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=b43c9315-5fb1-40e7-a6b0-904b0b55518f" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Mix10 - Silverlight 4 RC - Windows Phone 7 - IE9 Preview – OData – Codename Dallas</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2010/03/16/Mix10Silverlight4RCWindowsPhone7IE9PreviewODataCodenameDallas.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,10e8e637-9ded-4d90-aa19-6b2b46564a0a.aspx</id>
    <published>2010-03-16T23:12:20.053215+01:00</published>
    <updated>2010-03-16T23:13:05.5900058+01:00</updated>
    <category term="Dev" label="Dev" scheme="http://www.ucaya.com/blog/CategoryView,category,Dev.aspx" />
    <category term="Mix10" label="Mix10" scheme="http://www.ucaya.com/blog/CategoryView,category,Mix10.aspx" />
    <category term="News" label="News" scheme="http://www.ucaya.com/blog/CategoryView,category,News.aspx" />
    <category term="Silverlight" label="Silverlight" scheme="http://www.ucaya.com/blog/CategoryView,category,Silverlight.aspx" />
    <category term="WCF" label="WCF" scheme="http://www.ucaya.com/blog/CategoryView,category,WCF.aspx" />
    <author>
      <name>Thierry Bouquain</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">Lors des 2 keynotes au Mix10 de Las Vegas,
Microsoft à annoncé et mis à disposition plusieurs produits. Voici les points les
plus intéressants que j'ai pu relever. 
<br /><h1>Silverlight 4 RC
</h1><p><img style="display: inline; margin-left: 0px; margin-right: 0px" align="right" src="http://ts4.mm.bing.net/images/thumbnail.aspx?q=1686445893699&amp;id=56ea5b36a78a6badd8058355f84435cb&amp;url=http%3a%2f%2fwindowsteamblog.com%2fcfs-file.ashx%2f__key%2fCommunityServer.Blogs.Components.WeblogFiles%2fwmdev%2fMI" />La
première annonce a été pour Silverlight 4, qui est disponible en version RC. Un an
après le version finale de SL3, cette version apporte son lot d'amméliorations. 
<br />
Entre autre:
</p><ul><li>
Rich Text: 
<br />
    - Propriété "Xaml" pour la sérialisation du contenu</li><li>
Réseau 
<br />
    - Les application FullTrust outofbrowser n'ont plus besoin de serveur
de crossdomain 
<br />
    - Le crossdomain pour les appels sockets est récupéré par http.</li><li>
Out of Browser (Full Trust) 
<br />
    - Signature des applications. La boite de dialogue d'installation
des applications fulltrust vous indique si l'application est certifiée. Un utilisateur
pourra donc s'assurer de la provenance de l'application qu'il est en train d'installer. 
<br />
    - Personnalisation de la fenêtre principale</li><li>
Media 
<br />
    - Possibilité de garder une application fullscreen sur un deuxième
écran 
<br />
    - Support du multicast</li><li>
Graphics and Printing 
<br />
    - Les perspective transforms supportent l'accélération materielle 
<br />
    - Accélération matérielle pour deepzoom</li><li>
Data 
<br />
    - Support du XPath pour le XML 
</li><li>
Plugin 
<br />
    - Support de Google Chrome sur windows 
<br />
    - Support de MEF 
<br />
    - Support de Windows Phone</li></ul><p>
@ScottGu nous annonce aussi une sortie finale pour le mois prochain. 
</p><h1>Windows Phone 7 alias WP7
</h1><p><img style="display: inline; margin-left: 0px; margin-right: 0px" align="right" src="http://ts3.mm.bing.net/images/thumbnail.aspx?q=1696396018042&amp;id=e8ce4bbebec63a213845814278ce5337&amp;url=http%3a%2f%2fwww.fonehome.co.uk%2fwp-content%2fuploads%2f2009%2f12%2fwindows_phone_logo-300x300.jpg" />La
deuxième grosse annonce est la disponibilité des kits de développements pour windows
phone 7. Ces kits contiennent des outils gratuits qui permettront à tout le monde
de pouvoir concevoir des applications pour WP7. Visual Studio 2010 Express fait son
apparition ainsi qu'une marchine virtuelle faisant tourner un device WP7. Coté designer,
une version beta de Blend 4 est disponible en téléchargement sur laquelle il est possible
d'installer les outils pour windows phone. 
<br /><a href="http://developer.windowsphone.com">http://developer.windowsphone.com</a></p><h1>Internet Explorer 9
</h1><p><img style="display: inline; margin-left: 0px; margin-right: 0px" align="right" src="http://ts3.mm.bing.net/images/thumbnail.aspx?q=1603013837354&amp;id=fb94c0316caa79095faba558f57ad7f8&amp;url=http%3a%2f%2fblogs.nitobi.com%2falexei%2fwp-content%2fuploads%2f2008%2f03%2finternet_explorer_7_logo.png" />Le
deuxième jour, Microsoft a présenté IE9, la nouvelle mouture de son navigateur. Les
développements d'ie9 s'orrientent vers les besoins utilisateurs. Pour cette nouvelle
version, au menu : performances et conformités aux standards (HTML5, CSS3). 
<br />
Pour améliorer les perfomances javascript, Microsoft a analysé les 7000 premiers sites
webs afin de déterminer les fonctions les plus fréquement utilisées et de les optimiser
en priorité. Le nouveau moteur javascript compile les scripts pour gagner en performance
d'exécution. Cette compilation est effectuée en arrière plan et est multi coeur. 
<br />
Une autre piste pour l'amélioration des performances est l'utilisation de l'accélération
graphique pour tout ce qui est rendu. L'utilisation de DirectX permet un gain non
negligeable de performances pour l'affichage des images mais aussi pour le rendu cleartype
du text. 
<br />
Ce rendu DirectX permet d'afficher du SVG et des videos HD avec des performances impressionantes.
Lors de la keynote, un netbook affichait 2 videos HD 720p avec la balise video de
html5 sans ralentissement alors que chrome ne permettait pas un rendu fluide d'une
seule. 
<br />
La preview de ie9 est téléchargeable ici : <a href="http://www.ietestdrive.com">http://www.ietestdrive.com</a></p><h1>Open Data Protocol
</h1><p><a href="http://services.odata.org/website/odata.svc"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" border="0" alt="odata" align="right" src="http://www.odata.org/images/OData-logo.png" width="202" height="57" /></a>La
dernière annonce concerne oData. Une standardisation d'un système de requêtage sur
un modèle REST. Les détails de ce protocole sont accessibles sur <a href="http://www.odata.org">http://www.odata.org</a>.
De nombreux clients sont capables d'utiliser oData. Microsoft fourni sur le site oData
des clients pour différents langages (java, php, .net). Le code mis à disposition
sur odata.org est publié sous licence Apache 2. Sur les environements Microsoft comme
silverlight, un proxy est généré par visual studio est permet de traduire des requêtes
linq en requêtes oData et de récupérer le résultat sous forme d'objets fortements
typés. Ce type de services sont déjà exposés par Sharepoint 2010. Chaque liste de
donnée sharepoint est récupérable par ce biais. Des sources oData peuvent être crées
manuellement sur des webservices WCF mais aussi directement sur des bases de données
SQL Azure. 
</p><h1>Codename Dallas
</h1><p><a href="https://www.sqlazureservices.com/Default.aspx"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" border="0" align="right" src="https://www.sqlazureservices.com/Images/dataplex_logo.png" /></a>Microsoft
propose une place de marché où vous pouvez référencer vos services créés avec oData.
Il devient alors très facile à un développeur de tirer parti de toutes ces sources
et de construire une application (sur WP7 par exemple). Le market place est disponible
ici : <a href="http://www.sqlazureservices.com">http://www.sqlazureservices.com</a></p><img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=10e8e637-9ded-4d90-aa19-6b2b46564a0a" /></div>
    </content>
  </entry>
  <entry>
    <title>Serialisation webservices Proto Buffer et client Silverlight</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2009/09/01/SerialisationWebservicesProtoBufferEtClientSilverlight.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,88d17f87-7a6e-49f7-929e-1c28b340ab37.aspx</id>
    <published>2009-09-01T12:47:46.75825+02:00</published>
    <updated>2009-09-01T12:47:46.75825+02:00</updated>
    <author>
      <name>Thierry Bouquain</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Un de mes amis m’a conseiller de jeter un oeil à la sérialisation Proto Buffer. Elle
est rapide et légère. Idéale donc pour la consommer par webservice. Il existe plusieurs
implémentation pour c#, je me suis intéressé à <a href="http://code.google.com/p/protobuf-net" target="_blank">protobuf-net</a>.
Pour une comparaison des <a href="http://code.google.com/p/protobuf-net/wiki/Performance" target="_blank">performances</a> par
rapport à du BinaryFormatter du Soap ou du Json, vous pouvez vous rendre sur cette <a href="http://code.google.com/p/protobuf-net/wiki/Performance" target="_blank">page</a>.
</p>
        <h1>Utilisation avec WCF
</h1>
        <p>
Dans mes premiers tests, je voulais remplacer le DataContractSerializer de mes ServiceContract
par le serializer <a href="http://code.google.com/p/protobuf-net" target="_blank">protobuf-net</a>,
malheureusement le support de WCF de silverlight est assez léger et il n’est actuellement
pas possible de le faire. Dans ses exemples <a href="http://code.google.com/p/protobuf-net" target="_blank">protobuf-net</a> contient
un serveur et client RPC. J’ai donc configuré WCF avec une adaptation de ce serveur
RPC et remplacé le client généré par le wizard de visual studio par le client <a href="http://code.google.com/p/protobuf-net" target="_blank">protobuf-net</a>.
</p>
        <h1>
        </h1>
        <h1>Côté serveur
</h1>
        <p>
Pour avoir un serveur RPC compatible avec l’exemple fourni par <a href="http://code.google.com/p/protobuf-net" target="_blank">protobuf-net</a>,
il faut rajouter à WCF un OperationSelector routant les urls entrantes vers le bon
service contract. J’ai réalisé un EndPointBehavior paramettrant tout ça. La configuration
ressemble à ceci:
</p>
        <div style="font-family: consolas; background: black; color: #e0e0e0; font-size: 8pt">
          <p style="margin: 0px">
            <span style="color: #40c4ff">    &lt;system.serviceModel&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">        &lt;extensions&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">           
&lt;behaviorExtensions&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">               
&lt;add </span>
            <span style="color: #eee8aa">name</span>
            <span style="color: #40c4ff">=</span>
            <span style="color: #60ff60">"protoRPC"</span>
            <span style="color: #40c4ff">
            </span>
            <span style="color: #eee8aa">type</span>
            <span style="color: #40c4ff">=</span>
            <span style="color: #60ff60">"ProtoBuf.RPC.ProtoRpcEndpointBehaviorSection,
protobuf-wcf, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"</span>
            <span style="color: #40c4ff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">           
&lt;/behaviorExtensions&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">        &lt;/extensions&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">        &lt;behaviors&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">           
&lt;endpointBehaviors&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">               
&lt;behavior </span>
            <span style="color: #eee8aa">name</span>
            <span style="color: #40c4ff">=</span>
            <span style="color: #60ff60">"rpcBehavior"</span>
            <span style="color: #40c4ff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">                   
&lt;protoRPC/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">               
&lt;/behavior&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">           
&lt;/endpointBehaviors&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">        &lt;/behaviors&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">        &lt;services&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">           
&lt;service </span>
            <span style="color: #eee8aa">name</span>
            <span style="color: #40c4ff">=</span>
            <span style="color: #60ff60">"SilverlightApplication4.Web.TestService"</span>
            <span style="color: #40c4ff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">               
&lt;endpoint </span>
            <span style="color: #eee8aa">address</span>
            <span style="color: #40c4ff">=</span>
            <span style="color: #60ff60">""</span>
            <span style="color: #40c4ff">
            </span>
            <span style="color: #eee8aa">binding</span>
            <span style="color: #40c4ff">=</span>
            <span style="color: #60ff60">"webHttpBinding"</span>
            <span style="color: #40c4ff">
            </span>
            <span style="color: #eee8aa">contract</span>
            <span style="color: #40c4ff">=</span>
            <span style="color: #60ff60">"TestServices.ITestService"</span>
            <span style="color: #40c4ff">
            </span>
            <span style="color: #eee8aa">behaviorConfiguration</span>
            <span style="color: #40c4ff">=</span>
            <span style="color: #60ff60">"rpcBehavior"</span>
            <span style="color: #40c4ff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">           
&lt;/service&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">        &lt;/services&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">    &lt;/system.serviceModel&gt;</span>
          </p>
        </div>
        <p>
La classe implémentant le ServiceContract doit également autoriser toutes les urls:
</p>
        <div style="font-family: consolas; background: black; color: #e0e0e0; font-size: 8pt">
          <p style="margin: 0px">
    [<span style="color: #66cdaa">ServiceBehavior</span>(<span style="color: #eee8aa">AddressFilterMode</span><span style="color: silver">=</span><span style="color: #2b91af">AddressFilterMode</span><span style="color: silver">.</span><span style="color: #eee8aa">Any</span>)]
</p>
          <p style="margin: 0px">
    <span style="color: #40c4ff">public</span><span style="color: #40c4ff">class</span><span style="color: #66cdaa">TestService</span> : <span style="color: #2b91af">ITestService</span></p>
          <p style="margin: 0px">
    {
</p>
          <p style="margin: 0px">
            <span style="color: #8080ff">        #region</span> ITestService
Members
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: #40c4ff">public</span><span style="color: #eee8aa">TestServices</span><span style="color: silver">.</span><span style="color: #66cdaa">Customer</span><span style="color: #eee8aa">DoWork</span>(<span style="color: #40c4ff">string</span><span style="color: #eee8aa">a</span>, <span style="color: #eee8aa">TestServices</span><span style="color: silver">.</span><span style="color: #66cdaa">Customer</span><span style="color: #eee8aa">c</span>)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">return</span><span style="color: #eee8aa">TestServices</span><span style="color: silver">.</span><span style="color: #66cdaa">Customer</span><span style="color: silver">.</span><span style="color: #eee8aa">Invent</span>();
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: #8080ff">        #endregion</span>
          </p>
          <p style="margin: 0px">
    }
</p>
        </div>
        <p>
J’ai choisi d’externaliser le ServiceContract dans une interface pour pouvoir générer
simplement un client dans la partie Silverlight. Voici à quoi il ressemble:
</p>
        <div style="font-family: consolas; background: black; color: #e0e0e0; font-size: 8pt">
          <p style="margin: 0px">
    [<span style="color: #66cdaa">ServiceContract</span>]
</p>
          <p style="margin: 0px">
    <span style="color: #40c4ff">public</span><span style="color: #40c4ff">interface</span><span style="color: #2b91af">ITestService</span></p>
          <p style="margin: 0px">
    {
</p>
          <p style="margin: 0px">
        [<span style="color: #66cdaa">OperationContract</span>(<span style="color: #eee8aa">Action</span><span style="color: silver">=</span><span style="color: #60ff60">"dowork"</span>)]
</p>
          <p style="margin: 0px">
        <span style="color: #66cdaa">Customer</span><span style="color: #eee8aa">DoWork</span>(<span style="color: #40c4ff">string</span><span style="color: #eee8aa">a</span>, <span style="color: #66cdaa">Customer</span><span style="color: #eee8aa">c</span>);
</p>
          <p style="margin: 0px">
    }
</p>
        </div>
        <h1>Côté Silverlight
</h1>
        <p>
Pour fonctionner avec Silverlight, il a fallu que je corrige un bug dans les sources
de <a href="http://code.google.com/p/protobuf-net" target="_blank">protobuf-net</a>.
Les classes temporaires de sérialization générées par <a href="http://code.google.com/p/protobuf-net" target="_blank">protobuf-net</a> sont
privées et Silverlight ne permet pas de faire de réflection sur celles-ci. Il faut
les mettres en internal.
</p>
        <h2>DataContracts
</h2>
        <p>
          <a href="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/ProtobufferwebserviceserializationandSil_D8BC/image_2.png">
            <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/ProtobufferwebserviceserializationandSil_D8BC/image_thumb.png" width="158" height="205" />
          </a>Dans
l’implémentation de mon exemple, j’ai isolé mes datacontracts dans une assembly séparée.
J’ai créé la même assembly pour Silverlight en référençant simplement les fichiers
par liens, ce qui me permet de n’avoir qu’une seule version de ces fichiers. Pour
ceux qui ne saurait pas comment faire et pour éviter de perdre 2 heures à chercher,
il suffit lorsque vous ajouter un élément à la solution de cliquer sur la petite flêche
à côté du boutton Add et de choisie Add as link. <a href="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/ProtobufferwebserviceserializationandSil_D8BC/image_4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/ProtobufferwebserviceserializationandSil_D8BC/image_thumb_1.png" width="198" height="87" /></a></p>
        <h2>Génération du client
</h2>
        <p>
Nous voici donc avec la même assembly que côté serveur, mais compilée au format Silverlight.
Cette assembly contenant notre interface de ServiceContract, nous allons rajouter
dans la version Silverlight la génération du client. J’ai fais cette génération par
l’utilisation des fichiers t4. Il suffit de copier coller le fichier .tt qui se trouve
dans la solution et de le nommer du nom du fichier qui contient l’interface de ServiceContract
pour que la génération s’effectue (ici ITestService.tt). La génération utilise le
FileCodeModel pour déterminer les Méthodes de l’interface à implémenter dans le client.
Le client généré contient des fonctions d’appels asynchrones et les événements completed
qui correspondent.
</p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <h2>Utilisation
</h2>
        <p>
L’utilisation de notre client reste aussi simple que l’utilisation d’un client WCF
silverlight standard. 
</p>
        <div style="font-family: consolas; background: black; color: #e0e0e0; font-size: 8pt">
          <p style="margin: 0px">
        <span style="color: #40c4ff">private</span><span style="color: #40c4ff">void</span><span style="color: #eee8aa">Button_Click</span>(<span style="color: #40c4ff">object</span><span style="color: #eee8aa">sender</span>, <span style="color: #66cdaa">RoutedEventArgs</span><span style="color: #eee8aa">e</span>)
</p>
          <p style="margin: 0px">
        {
</p>
          <div style="font-family: consolas; background: black; color: #e0e0e0; font-size: 8pt">
            <p style="margin: 0px">
            <span style="color: #66cdaa">ITestServiceClient</span><span style="color: #eee8aa">client</span><span style="color: silver">=</span><span style="color: #40c4ff">new</span><span style="color: #66cdaa">ITestServiceClient</span>(<span style="color: #40c4ff">new</span><span style="color: #66cdaa">Uri</span>(<span style="color: #60ff60">"../"</span>, <span style="color: #2b91af">UriKind</span><span style="color: silver">.</span><span style="color: #eee8aa">Relative</span>));
</p>
          </div>
          <p style="margin: 0px">
            <span style="color: #eee8aa">client</span><span style="color: silver">.</span><span style="color: #eee8aa">DoWorkCompleted</span><span style="color: silver">+=</span><span style="color: #40c4ff">new</span><span style="color: #2b91af">EventHandler</span><span style="color: silver">&lt;</span><span style="color: #66cdaa">ITestServiceClient</span><span style="color: silver">.</span><span style="color: #66cdaa">DoWorkResultEventArgs</span><span style="color: silver">&gt;</span>(<span style="color: #eee8aa">client_DoWorkCompleted</span>);
</p>
          <p style="margin: 0px">
            <span style="color: #eee8aa">client</span><span style="color: silver">.</span><span style="color: #eee8aa">DoWorkAsync</span>(<span style="color: #60ff60">"aazer"</span>, <span style="color: #66cdaa">Customer</span><span style="color: silver">.</span><span style="color: #eee8aa">Invent</span>());
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: #40c4ff">void</span><span style="color: #eee8aa">client_DoWorkCompleted</span>(<span style="color: #40c4ff">object</span><span style="color: #eee8aa">sender</span>, <span style="color: #66cdaa">ITestServiceClient</span><span style="color: silver">.</span><span style="color: #66cdaa">DoWorkResultEventArgs</span><span style="color: #eee8aa">e</span>)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">var</span><span style="color: #eee8aa">r</span><span style="color: silver">=</span><span style="color: #eee8aa">e</span><span style="color: silver">.</span><span style="color: #eee8aa">Result</span>;
</p>
          <p style="margin: 0px">
        }
</p>
        </div>
        <p>
        </p>
        <p>
Il y a plusieurs façons d’instancier le client. Tout dépend d’où vos webservices se
trouvent. 
<br />
Le constructeur par défaut va chercher un webservice se nommant du même nom que l’interface
de service contract sans le I se trouvant de le même dossier que votre .xap. Sur une
surcharge du constructeur, vous pouvez spécifier soit une Url donnant le dossier dans
lequel va se trouver le webservice ou alors un url d’appel direct vers le fichier
svc.
</p>
        <p>
          <a href="http://cid-b7145a2861d183da.skydrive.live.com/self.aspx/Code/proto-buffer.7z" target="_blank">Les
sources</a>
        </p>
        <img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=88d17f87-7a6e-49f7-929e-1c28b340ab37" />
      </div>
    </content>
  </entry>
  <entry>
    <title>France Télévisions – L’info en vidéo</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2009/06/08/FranceT%c3%a9l%c3%a9visionsLinfoEnVid%c3%a9o.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,8d6d7195-d5d5-4288-9a44-4ed3a06b3374.aspx</id>
    <published>2009-06-08T23:03:08.88775+02:00</published>
    <updated>2009-06-08T23:03:08.88775+02:00</updated>
    <category term="Silverlight" label="Silverlight" scheme="http://www.ucaya.com/blog/CategoryView,category,Silverlight.aspx" />
    <author>
      <name>Romuald Boulanger</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Et une nouvelle version pour l’application <a href="http://info.francetelevisions.fr" target="_blank">L’info
en vidéo</a>.
</p>
        <p>
Maintenant vous avez accès aux Directs !
</p>
        <p>
          <a href="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/FranceTlvisionsLinfoenvido_143B7/ftvi-2_2.png" target="_blank">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ftvi-2" border="0" alt="ftvi-2" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/FranceTlvisionsLinfoenvido_143B7/ftvi-2_thumb.png" width="579" height="426" />
          </a> 
</p>
        <p>
Une nouvelle entrée “Evenements” dans le menu donne accès à tous les directs. Et lorsqu’une
catégorie du menu contient un direct, un picto rouge vous l’indique.
</p>
        <p>
          <a href="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/FranceTlvisionsLinfoenvido_143B7/ftvi-3_2.png" target="_blank">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ftvi-3" border="0" alt="ftvi-3" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/FranceTlvisionsLinfoenvido_143B7/ftvi-3_thumb.png" width="578" height="429" />
          </a>
        </p>
        <img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=8d6d7195-d5d5-4288-9a44-4ed3a06b3374" />
      </div>
    </content>
  </entry>
  <entry>
    <title>SLMedia et Smooth Streaming</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2009/06/08/SLMediaEtSmoothStreaming.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,83630aaf-3b89-481a-90a4-bdefb6757ec1.aspx</id>
    <published>2009-06-08T19:41:52.153375+02:00</published>
    <updated>2009-06-08T19:41:52.153375+02:00</updated>
    <author>
      <name>Thierry Bouquain</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Comme les français ont put le voir avec <a href="http://msdn.microsoft.com/fr-fr/silverlight/dd876822.aspx" target="_blank">Roland
Garros</a>, le Smooth Streaming permet de diffuser des flux de grande qualité qui
vont s’adapter à la connexion et à la puissance de la machine et de pouvoir faire
du timeshifting (contrôle du direct) sur les emissions live.
</p>
        <h1>Smooth Streaming c’est quoi ?
</h1>
        <p>
Le smooth streaming n’est pas un format de compression de video. C’est une technologie
de diffusion qui permet de découper la vidéo et le son en morceaux de 2 secondes et
diffuser le tout par http. La vidéo étant encodé en plusieurs niveau de qualité, nous
obtenons des échantillons de différents poids qui vont être mis à disposition sur
un serveur web. 
<br />
La partie client web (<a href="http://silverlight.net/" target="_blank">silverlight</a>)
va récupérer ces différents paquets et les mettre bout à bout pour reconstituer le
flux vidéo. L’application silverlight récupérera le paquet de poids correspondant
au mieux à la qualité de la connexion à internet. 
<br />
Pour la partie diffusion en live, un ou plusieurs encodeur envoyent au serveur web
ces paquets de 2 secondes au fur et à mesure qu’ils sont reçu de la source et encodés. 
<br />
Pour silverlight 2, la vidéo est au format VLC1 et nous devrions avoir droit au H264
avec silverlight 3. 
<br />
Le découpage en paquets et la diffusion au format HTTP permettent de tirer partie
des différents Cache HTTP qui existent sur internet.
</p>
        <h2>Côté serveur
</h2>
        <p>
La diffusion des flux smooth streaming nécessitent des composants côté serveur. Actuellement,
IIS7 est la seule plateforme supportant la diffusion de ce format. Deux versions existent.
La première vous permet de diffuser des vidéos préenregistrées au format smooth streaming
et la deuxième encore en beta permet la diffusion de flux live. 
</p>
        <h2>Côté client
</h2>
        <p>
Silverlight est actuellement le seul moyen de lire de la vidéo en Smooth Streaming.
Des exemples existent pour Silverlight 2 et Silverlight 3.
</p>
        <h2>Encodeur
</h2>
        <p>
Pour encoder des vidéos préenregistrées, vous devrez passer par <a href="http://www.microsoft.com/expression/products/Overview.aspx?key=encoder" target="_blank">Microsoft
Expression Encoder SP1</a>. Pour les flux live, des encodeurs hardwares sont en cours
de développement. Pour <a href="http://msdn.microsoft.com/fr-fr/silverlight/dd876822.aspx" target="_blank">Roland
Garros</a>, c’est la société Inlet qui les a fourni. Vous pouvez cependant simuler
un flux live à partir d’une vidéo préencodée en Smooth Streaming. Allez sur le <a href="http://learn.iis.net/page.aspx/620/live-smooth-streaming-for-iis-70---getting-started/" target="_blank">site
officiel</a> et <a href="http://go.microsoft.com/?linkid=9656616" target="_blank">téléchargez
le starter kit</a>. Vous trouverez 2 exécutables PushEncoder32.exe et PushEncoder64.exe
qui poussent votre vidéo préencodée sur le point de distribution live.
</p>
        <h1>
        </h1>
        <h1>SLMedia
</h1>
        <p>
La librairie de décodage du flux smoothstreaming (Microsoft.Web.Media.SmoothStreaming.dll)
est récupérable dans le player d’exemple silverlight du <a href="http://go.microsoft.com/?linkid=9656616" target="_blank">starter
kit</a>.
</p>
        <p>
Pour cet exemple, je vais réutiliser le <a href="http://www.ucaya.com/blog/2009/06/08/SLMediaLePlayerPhotoVideoDeSLExtensions.aspx" target="_blank">VideoPlayer
d’un précédent billet</a>. 
<br />
L’assignation d’une vidéo à un MediaElement ne se fait pas de la même manière que
la video soit du smooth streaming ou non. Pour gérer ceci, la notion de VideoSourceAdapter
et VideoAdapter a été ajoutée à <a href="http://www.slextensions.net" target="_blank">SLExtensions</a>.
Le VideoSourceAdapter va instancier la bonne source en fonction de l’url de la vidéo.
La première chose à faire dans le projet est de référencer le projet SLMedia.SmoothStreaming
et d’initialiser le SmoothStreamingVideoSourceAdapter. Il suffit de rajouter la ligne
ci-dessous au constructeur de la classe App.xaml.cs.
</p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #eee8aa">SLMedia</span><span style="color: silver">.</span><span style="color: #eee8aa">SmoothStreaming</span><span style="color: silver">.</span><span style="color: #66cdaa">SmoothStreamingVideoSourceAdapter</span><span style="color: silver">.</span><span style="color: #eee8aa">Initialize</span>();
</p>
        </div>
        <p>
Ensuite, changez le binding sur le source du MediaElement et l’url de la video.
</p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">MediaElement</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"mediaelement"</span>
          </p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">slvideo</span><span style="color: #80ffff">:</span><span style="color: #ffff80">VideoSourceAdapter.Source</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">CurrentItem</span><span style="color: #80ffff">.</span><span style="color: #cb97ff">SourceUri</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">slvideo</span><span style="color: #80ffff">:</span><span style="color: #ffff80">VideoController.MediaElement</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">StaticResource</span><span style="color: #8080ff"> controller</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">IsMuted</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">IsMuted</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">Volume</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">Volume</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">AutoPlay</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">AutoPlay</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span>    
</p>
          <p style="margin: 0px">
                    <span style="color: #80ffff">/&gt;</span></p>
          <p style="margin: 0px">
 
</p>
        </div>
        <p style="margin: 0px">
          <span style="color: #80ffff">
          </span> 
</p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #eee8aa">controller</span><span style="color: silver">.</span><span style="color: #eee8aa">Playlist</span><span style="color: silver">.</span><span style="color: #eee8aa">Add</span>(<span style="color: #60ff60">"http://localhost/live.isml/Manifest"</span>);
</p>
        </div>
        <p>
Attention, le chemin d’accès au Manifest est sensible au crossdomain. Pensez à autoriser
votre player à accéder à la video si le player n’est pas dans le même domaine (crossdomain.xml)
</p>
        <p>
Poussez votre video en live  PushEncoder64.exe http://localhost/live.isml "Big
Buck Bunny.ism" et lancez votre player. Vous devriez voir la video. Si vous voulez
un contenu préencodé, téléchargez la video <a href="http://go.microsoft.com/?linkid=9652408" target="_blank">Big
Buck Bunny ici</a>.
</p>
        <p>
Par défaut, la lecture du flux commence toujours au début de la vidéo qui a été encodée.
Si vous voulez rejoindre le direct, vous pouvez appeler la fonction GoToLive du VideoAdapter
ou créer un mediaitem de type LiveVideoItem et lui assigner sa propriété JoinLive.
</p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
        <span style="color: #40c4ff">void</span><span style="color: #eee8aa">Page_Loaded</span>(<span style="color: #40c4ff">object</span><span style="color: #eee8aa">sender</span>, <span style="color: #66cdaa">RoutedEventArgs</span><span style="color: #eee8aa">e</span>)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: #eee8aa">controller</span><span style="color: silver">.</span><span style="color: #eee8aa">Playlist</span><span style="color: silver">.</span><span style="color: #eee8aa">Add</span>(<span style="color: #40c4ff">new</span><span style="color: #66cdaa">LiveVideoItem</span></p>
          <p style="margin: 0px">
            {
</p>
          <p style="margin: 0px">
                <span style="color: #eee8aa">Source</span><span style="color: silver">=</span><span style="color: #60ff60">"http://localhost/live.isml/Manifest"</span>,
</p>
          <p style="margin: 0px">
                <span style="color: #eee8aa">JoinLive</span><span style="color: silver">=</span><span style="color: #40c4ff">true</span></p>
          <p style="margin: 0px">
            });
</p>
          <p style="margin: 0px">
            <span style="color: #eee8aa">controller</span><span style="color: silver">.</span><span style="color: #eee8aa">Next</span>();
</p>
          <p style="margin: 0px">
        }
</p>
        </div>
        <br />
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <h2>la timeline pour le Live Smooth Streaming
</h2>
        <p>
Pour les événements live, les informations de position ne démarrent pas forcément
à 0. Il faut changer la déclaration des bindings du slider pour tenir compte des propriétés
Start et LivePosition.
</p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">slec</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">Slider</span>
            <span style="color: #ffff80"> Maximum</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">VideoAdapter</span>
            <span style="color: #80ffff">.</span>
            <span style="color: #cb97ff">LivePosition</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Converter</span>
            <span style="color: #80ffff">={</span>
            <span style="color: #ff80c0">StaticResource</span>
            <span style="color: #8080ff"> timeSpanConverter</span>
            <span style="color: #80ffff">}}</span>
            <span style="color: #80ff80">"</span>
          </p>
          <p style="margin: 0px">
                        <span style="color: #ffff80">Minimum</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">VideoAdapter</span><span style="color: #80ffff">.</span><span style="color: #cb97ff">Start</span><span style="color: #80ffff">,</span><span style="color: #8080ff"> Converter</span><span style="color: #80ffff">={</span><span style="color: #ff80c0">StaticResource</span><span style="color: #8080ff"> timeSpanConverter</span><span style="color: #80ffff">}}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                        <span style="color: #ffff80">MoveValue</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Converter</span><span style="color: #80ffff">={</span><span style="color: #ff80c0">StaticResource</span><span style="color: #8080ff"> timeSpanConverter</span><span style="color: #80ffff">},</span><span style="color: #8080ff"> Mode</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">TwoWay</span><span style="color: #80ffff">,</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">Position</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                        <span style="color: #ffff80">Width</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"200"</span><span style="color: #ffff80"> Margin</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"20,0,0,0"</span></p>
          <p style="margin: 0px">
                        <span style="color: #80ffff">/&gt;</span></p>
        </div>
        <h3>Quelle représentation pour la timeline
</h3>
        <ol>
          <li>
Un slider simple</li>
        </ol>
        <p>
Ce contrôle est utilisé dans le majorité des players vidéos disponible sur internet.
Il se prête bien pour des vidéos de taille connues et relativement petites. Dans le
cas de diffusion de flux live, la taille du slider ne représente pas toujours la même
durée. Au bout d’une heure d’émission, amener le slider au milieu reculera d’une demi
heure alors qu’au bout d’une journée on reculera d’une demi journée. 
</p>
        <p>
          <a href="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/SLMediaetSmoothStreaming_BF51/image_16.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/SLMediaetSmoothStreaming_BF51/image_thumb_7.png" width="244" height="127" />
          </a>
        </p>
        <ol>
          <li>
Un “slider inversé”</li>
        </ol>
        <p>
Le marqueur au milieu indique la position de lecture. La barre orange indique la durée
de la vidéo. Cette barre grandit au fur et à mesure que le flux live est émis. Quand
l’utilisateur regarde en live, la barre orange s’agrandit vers la gauche et rien ne
dépasse à droite du marqueur. 
<br />
Si l’utilisateur met en pause, le barre s’agrandit à droite du marqueur montrant qu’on
est plus en live et indique la durée du décalage par rapport au live. 
<br />
Quand la lecture reprend, la barre regrandit à gauche.
</p>
        <p>
Contrairement au slider simple, ce type de contrôle permet d’avoir une échelle de
temps constante tout au long de la diffusion. Lorsqu’on déplace la timeline, c’est
la barre orange qui se déplace, le marqueur reste toujours au milieu. Peut être un
peu déroutant au départ, un utilisateur en comprendra vite la logique
</p>
        <p>
          <a href="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/SLMediaetSmoothStreaming_BF51/image_12.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/SLMediaetSmoothStreaming_BF51/image_thumb_5.png" width="244" height="154" />
          </a>
        </p>
        <ol>
          <li>
Un slider sur une ligne de temps</li>
        </ol>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
C’est ce qui a été utilisé pour <a href="http://msdn.microsoft.com/fr-fr/silverlight/dd876822.aspx" target="_blank">Roland
Garros</a>, une barre de temps représente la journée entière. La taille du slider
grandit au fur et à mesure du live. Le slider garde une échelle constante mais est
quasi invisible au départ. Le principe de déplacement du curseur est préservé.
</p>
        <p>
          <a href="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/SLMediaetSmoothStreaming_BF51/image_18.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/SLMediaetSmoothStreaming_BF51/image_thumb_8.png" width="244" height="67" />
          </a>
        </p>
        <p>
          <iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 66px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-b7145a2861d183da.skydrive.live.com/embedrowdetail.aspx/Code/VideoPlayerSmoothStreaming.zip" frameborder="0" marginwidth="0" scrolling="no">
          </iframe>
        </p>
        <p>
N’oubliez pas de télécharger les sources de SLMedia sur le site de <a href="http://www.slextensions.net" target="_blank">slextensions</a>.
</p>
        <img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=83630aaf-3b89-481a-90a4-bdefb6757ec1" />
      </div>
    </content>
  </entry>
  <entry>
    <title>SLMedia le player Photo / Video de SLExtensions</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2009/06/08/SLMediaLePlayerPhotoVideoDeSLExtensions.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,aa66f5d0-6bd2-46c5-a95f-90e05bfcf606.aspx</id>
    <published>2009-06-08T13:16:46.13775+02:00</published>
    <updated>2009-06-08T13:16:46.13775+02:00</updated>
    <author>
      <name>Thierry Bouquain</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Les librairies SLMedia regroupent tout ce qu'il vous faut pour gérer vos galeries
photos et vidéo. Ces librairies sont séparées en plusieurs dlls gérant chacune un
type de média.
</p>
        <ul>
          <li>
SLMedia.Core : Librairie centrale prenant en charge les fonctions communes. 
</li>
          <li>
SLMedia.Picture : Librairie vous permettant de réaliser des slideshows d’images. 
</li>
          <li>
SLMedia.Deepzoom : Librairie vous permettant d’afficher des galeries deepzoom de vos
images. 
</li>
          <li>
SLMedia.Video : Librairie gérant les galeries vidéos. 
</li>
          <li>
SLMedia.SmoothStreaming : Gestion des vidéos en Smooth Streaming 
</li>
        </ul>
        <h1>Création d’un player video avec SLMedia
</h1>
        <p>
La réalisation d’un player avec SLMedia repose sur les concepts de Binding et de Behavior.
Les Bindings vont vous servir à lier les informations provenant du controller (ici
un VideoController) et les différents éléments graphiques qui vont vous permettre
d’afficher et d’agir sur votre vidéo.
</p>
        <h2>MediaController
</h2>
        <p>
Cette classe appartenant à SLMedia.Core sert de base au VideoController. Elle regroupe
les fonctionnalités communes aux différents controllers. 
</p>
        <ul>
          <li>
Gestion de la playlist (Next, Previous, IsPlaying, SelectedItem) 
</li>
          <li>
Gestion du fullscreen (IsFullscreen) 
</li>
          <li>
Gestion des progressions pour les slideshow / videos (Position, Duration) 
</li>
          <li>
Etc.. 
</li>
        </ul>
        <h2>VideoController
</h2>
        <p>
Cette classe hérite du MediaController et lui rajoute des fonctions spécifiques pour
la vidéo.
</p>
        <ul>
          <li>
MediaElement 
</li>
          <li>
Buffering 
</li>
          <li>
Support de différentes source par les VideoAdapter 
</li>
        </ul>
        <h2>Etape 1 : Affichage d’une video de la playlist
</h2>
        <p>
Dans votre page xaml, référencez le namespace correspondant à SLMedia.Video et ajouter
le VideoController aux ressources. 
<br /></p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">UserControl</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Class</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"VideoPlayer1.Page"</span>
          </p>
          <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span></p>
          <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">x</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"http://schemas.microsoft.com/winfx/2006/xaml"</span></p>
          <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">slvideo</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"clr-namespace:SLMedia.Video;assembly=SLMedia.Video"</span></p>
          <p style="margin: 0px">
   <span style="color: #80ffff">&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #60ff60">    </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">UserControl.Resources</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">slvideo</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VideoController</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"controller"</span>
            <span style="color: #80ffff"> /&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">    </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">UserControl.Resources</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
        </div>
        <p>
Ensuite posez un MediaElement et associez sa source avec la propriété CurrentItem
de notre controller. Le CurrentItem sera du type IMediaItem et possèdera donc une
propriété SourceUri contenant l’url de la vidéo à afficher. 
<br /></p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #60ff60">    </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">Grid</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"LayoutRoot"</span>
            <span style="color: #80ffff">
            </span>
            <span style="color: #ffff80">DataContext</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Source</span>
            <span style="color: #80ffff">={</span>
            <span style="color: #ff80c0">StaticResource</span>
            <span style="color: #8080ff"> controller</span>
            <span style="color: #80ffff">}}</span>
            <span style="color: #80ff80">" </span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">MediaElement</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"mediaelement"</span>
          </p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">Source</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">CurrentItem</span><span style="color: #80ffff">.</span><span style="color: #cb97ff">SourceUri</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #80ffff">/&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #60ff60">    </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">Grid</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
        </div>
        <p>
Il ne reste plus qu’à renseigner un nouvel item dans la playlist et de le sélectionner
pour que la video se lancer. 
<br /></p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #40c4ff">using</span>
            <span style="color: #eee8aa">SLMedia</span>
            <span style="color: silver">.</span>
            <span style="color: #eee8aa">Video</span>;
</p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">using</span>
            <span style="color: #eee8aa">SLMedia</span>
            <span style="color: silver">.</span>
            <span style="color: #eee8aa">Core</span>;
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">namespace</span>
            <span style="color: #eee8aa">VideoPlayer1</span>
          </p>
          <p style="margin: 0px">
{
</p>
          <p style="margin: 0px">
    <span style="color: #40c4ff">public</span><span style="color: #40c4ff">partial</span><span style="color: #40c4ff">class</span><span style="color: #66cdaa">Page</span> : <span style="color: #66cdaa">UserControl</span></p>
          <p style="margin: 0px">
    {
</p>
          <p style="margin: 0px">
        <span style="color: #40c4ff">public</span><span style="color: #eee8aa">Page</span>()
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: #eee8aa">InitializeComponent</span>();
</p>
          <p style="margin: 0px">
            <span style="color: #eee8aa">controller</span><span style="color: silver">=</span> (<span style="color: #66cdaa">VideoController</span>)<span style="color: #eee8aa">Resources</span>[<span style="color: #60ff60">"controller"</span>];
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: #40c4ff">this</span><span style="color: silver">.</span><span style="color: #eee8aa">Loaded</span><span style="color: silver">+=</span><span style="color: #40c4ff">new</span><span style="color: #2b91af">RoutedEventHandler</span>(<span style="color: #eee8aa">Page_Loaded</span>);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: #40c4ff">void</span><span style="color: #eee8aa">Page_Loaded</span>(<span style="color: #40c4ff">object</span><span style="color: #eee8aa">sender</span>, <span style="color: #66cdaa">RoutedEventArgs</span><span style="color: #eee8aa">e</span>)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            <span style="color: #eee8aa">controller</span><span style="color: silver">.</span><span style="color: #eee8aa">Playlist</span><span style="color: silver">.</span><span style="color: #eee8aa">Add</span>(<span style="color: #60ff60">"http://labs.ucaya.com/lake.wmv"</span>);
</p>
          <p style="margin: 0px">
            <span style="color: #eee8aa">controller</span><span style="color: silver">.</span><span style="color: #eee8aa">Next</span>();
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
    }
</p>
          <p style="margin: 0px">
}
</p>
        </div>
        <p>
Pour rendre complétement opérationnel notre videocontroller, nous devons lui indiquer
quel est le MediaElement qui affiche la vidéo. De cette manière il pourra récupérer
les états de lecture, de progression et de buffering. Nous allons également lier quelques
propriétés supplémentaires qui nous permettrons de tout contrôler depuis le VideoController.
</p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">MediaElement</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"mediaelement"</span>
          </p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">Source</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">CurrentItem</span><span style="color: #80ffff">.</span><span style="color: #cb97ff">SourceUri</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">slvideo</span><span style="color: #80ffff">:</span><span style="color: #ffff80">VideoController.MediaElement</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">StaticResource</span><span style="color: #8080ff"> controller</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">IsMuted</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">IsMuted</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">Volume</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">Volume</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">AutoPlay</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">AutoPlay</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span>    
</p>
          <p style="margin: 0px">
                    <span style="color: #80ffff">/&gt;</span></p>
        </div>
        <h2>Etape 2 : Lecture / Pause
</h2>
        <p>
L’état lecture / pause est géré dans notre controller par la propriété IsPlaying.
Un binding entre une checkbox et cette propriété permetra de contrôler facilement
l’état de lecture. 
</p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">StackPanel</span>
            <span style="color: #ffff80"> Orientation</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Horizontal"</span>
            <span style="color: #ffff80"> VerticalAlignment</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Bottom"</span>
            <span style="color: #ffff80"> Background</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"#50000000"</span>
            <span style="color: #ffff80"> Margin</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"30"</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">CheckBox</span>
            <span style="color: #ffff80"> IsChecked</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">IsPlaying</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Mode</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">TwoWay</span>
            <span style="color: #80ffff">}</span>
            <span style="color: #80ff80">"</span>
            <span style="color: #80ffff"> /&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">StackPanel</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
        </div>
        <p>
        </p>
        <p>
        </p>
        <h2>Etape 3 : Position / Durée
</h2>
        <p>
Un slider Bindé sur les propriétés Duration et Position fera l’affaire. Les propriétés
Duration et Position étant du type TimeSpan, nous allons utiliser un IValueConverter
pour transformer la valeur en Double.
</p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
            <p style="margin: 0px">
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">UserControl</span>
              <span style="color: #ffff80"> x</span>
              <span style="color: #80ffff">:</span>
              <span style="color: #ffff80">Class</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #80ff80">"VideoPlayer1.Page"</span>
            </p>
            <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span></p>
            <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">x</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"http://schemas.microsoft.com/winfx/2006/xaml"</span></p>
            <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">slvideo</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"clr-namespace:SLMedia.Video;assembly=SLMedia.Video"</span></p>
            <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">slec</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"clr-namespace:SLExtensions.Controls;assembly=SLExtensions.Controls"</span></p>
            <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">sled</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"clr-namespace:SLExtensions.Data;assembly=SLExtensions.Data"</span></p>
            <p style="margin: 0px">
   <span style="color: #ffff80">Foreground</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"White"</span></p>
            <p style="margin: 0px">
              <span style="color: #80ffff">    &gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #60ff60">    </span>
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">UserControl.Resources</span>
              <span style="color: #80ffff">&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #60ff60">        </span>
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">slvideo</span>
              <span style="color: #80ffff">:</span>
              <span style="color: #0080ff">VideoController</span>
              <span style="color: #ffff80"> x</span>
              <span style="color: #80ffff">:</span>
              <span style="color: #ffff80">Name</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #80ff80">"controller"</span>
              <span style="color: #80ffff"> /&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #60ff60">        </span>
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">sled</span>
              <span style="color: #80ffff">:</span>
              <span style="color: #0080ff">TimeSpanConverter</span>
              <span style="color: #ffff80"> x</span>
              <span style="color: #80ffff">:</span>
              <span style="color: #ffff80">Name</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #80ff80">"timeSpanConverter"</span>
              <span style="color: #80ffff">/&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #60ff60">    </span>
              <span style="color: #80ffff">&lt;/</span>
              <span style="color: #0080ff">UserControl.Resources</span>
              <span style="color: #80ffff">&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #60ff60">    </span>
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">Grid</span>
              <span style="color: #ffff80"> x</span>
              <span style="color: #80ffff">:</span>
              <span style="color: #ffff80">Name</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #80ff80">"LayoutRoot"</span>
              <span style="color: #ffff80"> DataContext</span>
              <span style="color: #80ffff">="{</span>
              <span style="color: #ff80c0">Binding</span>
              <span style="color: #8080ff"> Source</span>
              <span style="color: #80ffff">={</span>
              <span style="color: #ff80c0">StaticResource</span>
              <span style="color: #8080ff"> controller</span>
              <span style="color: #80ffff">}}</span>
              <span style="color: #80ff80">"</span>
              <span style="color: #80ffff">&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #60ff60">        </span>
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">MediaElement</span>
              <span style="color: #ffff80"> x</span>
              <span style="color: #80ffff">:</span>
              <span style="color: #ffff80">Name</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #80ff80">"mediaelement"</span>
            </p>
            <p style="margin: 0px">
                    <span style="color: #ffff80">Source</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">CurrentItem</span><span style="color: #80ffff">.</span><span style="color: #cb97ff">SourceUri</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
            <p style="margin: 0px">
                    <span style="color: #ffff80">slvideo</span><span style="color: #80ffff">:</span><span style="color: #ffff80">VideoController.MediaElement</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">StaticResource</span><span style="color: #8080ff"> controller</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
            <p style="margin: 0px">
                    <span style="color: #ffff80">IsMuted</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">IsMuted</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
            <p style="margin: 0px">
                    <span style="color: #ffff80">Volume</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">Volume</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
            <p style="margin: 0px">
                    <span style="color: #ffff80">AutoPlay</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">AutoPlay</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span>    
</p>
            <p style="margin: 0px">
                    <span style="color: #80ffff">/&gt;</span></p>
            <p style="margin: 0px">
              <span style="color: #60ff60">        </span>
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">StackPanel</span>
              <span style="color: #ffff80"> Orientation</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #80ff80">"Horizontal"</span>
              <span style="color: #ffff80"> VerticalAlignment</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #80ff80">"Bottom"</span>
              <span style="color: #ffff80"> Background</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #80ff80">"#50000000"</span>
              <span style="color: #ffff80"> Margin</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #80ff80">"30"</span>
              <span style="color: #80ffff">&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #60ff60">            </span>
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">CheckBox</span>
              <span style="color: #ffff80"> IsChecked</span>
              <span style="color: #80ffff">="{</span>
              <span style="color: #ff80c0">Binding</span>
              <span style="color: #8080ff"> Path</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #cb97ff">IsPlaying</span>
              <span style="color: #80ffff">,</span>
              <span style="color: #8080ff"> Mode</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #cb97ff">TwoWay</span>
              <span style="color: #80ffff">}</span>
              <span style="color: #80ff80">"</span>
              <span style="color: #80ffff"> /&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #60ff60">            </span>
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">slec</span>
              <span style="color: #80ffff">:</span>
              <span style="color: #0080ff">Slider</span>
              <span style="color: #ffff80"> Maximum</span>
              <span style="color: #80ffff">="{</span>
              <span style="color: #ff80c0">Binding</span>
              <span style="color: #8080ff"> Converter</span>
              <span style="color: #80ffff">={</span>
              <span style="color: #ff80c0">StaticResource</span>
              <span style="color: #8080ff"> timeSpanConverter</span>
              <span style="color: #80ffff">},</span>
              <span style="color: #8080ff"> Path</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #cb97ff">Duration</span>
              <span style="color: #80ffff">}</span>
              <span style="color: #80ff80">"</span>
            </p>
            <p style="margin: 0px">
                        <span style="color: #ffff80">MoveValue</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Converter</span><span style="color: #80ffff">={</span><span style="color: #ff80c0">StaticResource</span><span style="color: #8080ff"> timeSpanConverter</span><span style="color: #80ffff">},</span><span style="color: #8080ff"> Mode</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">TwoWay</span><span style="color: #80ffff">,</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">Position</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
            <p style="margin: 0px">
                        <span style="color: #ffff80">Width</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"200"</span><span style="color: #ffff80"> Margin</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"20,0,0,0"</span></p>
            <p style="margin: 0px">
                        <span style="color: #80ffff">/&gt;</span></p>
            <p style="margin: 0px">
              <span style="color: #60ff60">            </span>
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">TextBlock</span>
              <span style="color: #ffff80"> Text</span>
              <span style="color: #80ffff">="{</span>
              <span style="color: #ff80c0">Binding</span>
              <span style="color: #8080ff"> Converter</span>
              <span style="color: #80ffff">={</span>
              <span style="color: #ff80c0">StaticResource</span>
              <span style="color: #8080ff"> timeSpanConverter</span>
              <span style="color: #80ffff">},</span>
              <span style="color: #8080ff"> Path</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #cb97ff">Position</span>
              <span style="color: #80ffff">}</span>
              <span style="color: #80ff80">"</span>
            </p>
            <p style="margin: 0px">
                    <span style="color: #ffff80">Margin</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"20,0,0,0"</span><span style="color: #80ffff">/&gt;</span></p>
            <p style="margin: 0px">
              <span style="color: #60ff60">            </span>
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">TextBlock</span>
              <span style="color: #ffff80"> Text</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #80ff80">"
/ "</span>
              <span style="color: #80ffff"> /&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #60ff60">            </span>
              <span style="color: #80ffff">&lt;</span>
              <span style="color: #0080ff">TextBlock</span>
              <span style="color: #ffff80"> Text</span>
              <span style="color: #80ffff">="{</span>
              <span style="color: #ff80c0">Binding</span>
              <span style="color: #8080ff"> Converter</span>
              <span style="color: #80ffff">={</span>
              <span style="color: #ff80c0">StaticResource</span>
              <span style="color: #8080ff"> timeSpanConverter</span>
              <span style="color: #80ffff">},</span>
              <span style="color: #8080ff"> Path</span>
              <span style="color: #80ffff">=</span>
              <span style="color: #cb97ff">Duration</span>
              <span style="color: #80ffff">}</span>
              <span style="color: #80ff80">"</span>
              <span style="color: #80ffff"> /&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #60ff60">        </span>
              <span style="color: #80ffff">&lt;/</span>
              <span style="color: #0080ff">StackPanel</span>
              <span style="color: #80ffff">&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #60ff60">    </span>
              <span style="color: #80ffff">&lt;/</span>
              <span style="color: #0080ff">Grid</span>
              <span style="color: #80ffff">&gt;</span>
            </p>
            <p style="margin: 0px">
              <span style="color: #80ffff">&lt;/</span>
              <span style="color: #0080ff">UserControl</span>
              <span style="color: #80ffff">&gt;</span>
            </p>
          </div>
        </div>
        <p>
Si vous utilisez le slider de base de silverlight, vous noterez des problèmes lorsque
vous déplacez le curseur. Pendant que vous déplacez le curseur, la propriété Value
peut être remise à jour par le binding et le curseur donne l’impression de sauter.
</p>
        <h2>Etape 4 : Volume
</h2>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
De même que pour la position, nous allons utiliser un slider pour le volume et une
checkbox pour le mute
</p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">CheckBox</span>
            <span style="color: #ffff80"> IsChecked</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">IsMuted</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Mode</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">TwoWay</span>
            <span style="color: #80ffff">}</span>
            <span style="color: #80ff80">"</span>
            <span style="color: #ffff80"> Margin</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"20,0,0,0"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">Slider</span>
            <span style="color: #ffff80"> Maximum</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"1"</span>
            <span style="color: #ffff80"> SmallChange</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"0.1"</span>
            <span style="color: #ffff80"> LargeChange</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"0.1"</span>
          </p>
          <p style="margin: 0px">
                   <span style="color: #ffff80">Value</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">Volume</span><span style="color: #80ffff">,</span><span style="color: #8080ff"> Mode</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">TwoWay</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span><span style="color: #ffff80"> Width</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"50"</span><span style="color: #80ffff"> /&gt;</span></p>
        </div>
        <h2>Etape 5 : Buffering - Downloading
</h2>
        <p>
Encore du binding
</p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">TextBlock</span>
            <span style="color: #ffff80"> Text</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Buffering:"</span>
            <span style="color: #80ffff"> /&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">TextBlock</span>
            <span style="color: #ffff80"> Text</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">BufferingProgress</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Mode</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">TwoWay</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Converter</span>
            <span style="color: #80ffff">={</span>
            <span style="color: #ff80c0">StaticResource</span>
            <span style="color: #8080ff"> strConverter</span>
            <span style="color: #80ffff">},</span>
            <span style="color: #8080ff"> ConverterParameter</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">'</span>
            <span style="color: #80ffff">{</span>0<span style="color: #80ffff">:</span><span style="color: #ff80c0">p</span><span style="color: #80ffff">}</span><span style="color: #80ff80">'</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span><span style="color: #80ffff"> /&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">Slider</span>
            <span style="color: #ffff80"> Maximum</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"1"</span>
          </p>
          <p style="margin: 0px">
                   <span style="color: #ffff80">Value</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">BufferingProgress</span><span style="color: #80ffff">,</span><span style="color: #8080ff"> Mode</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">TwoWay</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span><span style="color: #ffff80"> Width</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"50"</span><span style="color: #ffff80"> IsHitTestVisible</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"False"</span><span style="color: #ffff80"> Margin</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"5,0,0,0"</span><span style="color: #80ffff">/&gt;</span></p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">TextBlock</span>
            <span style="color: #ffff80"> Text</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Downloading:"</span>
            <span style="color: #ffff80"> Margin</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"20,0,0,0"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">TextBlock</span>
            <span style="color: #ffff80"> Text</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">DownloadProgress</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Mode</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">TwoWay</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Converter</span>
            <span style="color: #80ffff">={</span>
            <span style="color: #ff80c0">StaticResource</span>
            <span style="color: #8080ff"> strConverter</span>
            <span style="color: #80ffff">},</span>
            <span style="color: #8080ff"> ConverterParameter</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">'</span>
            <span style="color: #80ffff">{</span>0<span style="color: #80ffff">:</span><span style="color: #ff80c0">p</span><span style="color: #80ffff">}</span><span style="color: #80ff80">'</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span><span style="color: #80ffff"> /&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">Slider</span>
            <span style="color: #ffff80"> Maximum</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"1"</span>
          </p>
          <p style="margin: 0px">
                   <span style="color: #ffff80">Value</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">DownloadProgress</span><span style="color: #80ffff">,</span><span style="color: #8080ff"> Mode</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">TwoWay</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span><span style="color: #ffff80"> Width</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"50"</span><span style="color: #ffff80"> IsHitTestVisible</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"False"</span></p>
          <p style="margin: 0px">
                   <span style="color: #ffff80">Margin</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"5,0,0,0"</span><span style="color: #80ffff">/&gt;</span></p>
        </div>
        <h2>Etape 6 : Gestion des états visuels
</h2>
        <p>
Le VideoController centralise les propriétés de notre player video. Il est possible
de changer l’état visuel de nos contrôles en fonction des propriétés du VideoController.
Nous allons utiliser le behaviors fournis par SLExtensions pour mapper ces propriétés
à nos VisualStates.
</p>
        <p>
        </p>
        <div style="font-family: consolas; background: #282828; color: #e0e0e0; font-size: 10pt">
          <p style="margin: 0px">
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">UserControl</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Class</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"VideoPlayer1.Page"</span>
          </p>
          <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span></p>
          <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">x</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"http://schemas.microsoft.com/winfx/2006/xaml"</span></p>
          <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">slvideo</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"clr-namespace:SLMedia.Video;assembly=SLMedia.Video"</span></p>
          <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">slec</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"clr-namespace:SLExtensions.Controls;assembly=SLExtensions.Controls"</span></p>
          <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">sled</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"clr-namespace:SLExtensions.Data;assembly=SLExtensions.Data"</span></p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">inter</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"clr-namespace:Microsoft.Expression.Interactivity;assembly=Microsoft.Expression.Interactivity"</span></p>
          <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">slint</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"clr-namespace:SLExtensions.Interactivity;assembly=SLExtensions.Interactivity"</span></p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
   <span style="color: #ffff80">xmlns</span><span style="color: #80ffff">:</span><span style="color: #ffff80">vsm</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"clr-namespace:System.Windows;assembly=System.Windows"</span></p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
   <span style="color: #ffff80">Foreground</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"White"</span></p>
          <p style="margin: 0px">
            <span style="color: #80ffff">    &gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">    </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">UserControl.Resources</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">slvideo</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VideoController</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"controller"</span>
            <span style="color: #80ffff"> /&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">sled</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">TimeSpanConverter</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"timeSpanConverter"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">sled</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">StringFormatConverter</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"strConverter"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">    </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">UserControl.Resources</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">    </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">Grid</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"LayoutRoot"</span>
            <span style="color: #ffff80"> DataContext</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Source</span>
            <span style="color: #80ffff">={</span>
            <span style="color: #ff80c0">StaticResource</span>
            <span style="color: #8080ff"> controller</span>
            <span style="color: #80ffff">}}</span>
            <span style="color: #80ff80">"</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">vsm</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VisualStateManager.VisualStateGroups</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">vsm</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VisualStateGroup</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"PlayingStates"</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">vsm</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VisualStateGroup.Transitions</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                    </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">vsm</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VisualTransition</span>
            <span style="color: #ffff80"> GeneratedDuration</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"00:00:00.3000000"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">vsm</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VisualStateGroup.Transitions</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">vsm</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VisualState</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Playing"</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                    </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">Storyboard</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">ColorAnimationUsingKeyFrames</span>
            <span style="color: #ffff80"> BeginTime</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"00:00:00"</span>
            <span style="color: #ffff80"> Duration</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"00:00:00.0010000"</span>
            <span style="color: #ffff80"> Storyboard.TargetName</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"stackPanel"</span>
            <span style="color: #ffff80"> Storyboard.TargetProperty</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"(Panel.Background).(SolidColorBrush.Color)"</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">SplineColorKeyFrame</span>
            <span style="color: #ffff80"> KeyTime</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"00:00:00"</span>
            <span style="color: #ffff80"> Value</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"#5039FF00"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                        </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">ColorAnimationUsingKeyFrames</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                    </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">Storyboard</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">vsm</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VisualState</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">vsm</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VisualState</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Paused"</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                    </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">Storyboard</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">ColorAnimationUsingKeyFrames</span>
            <span style="color: #ffff80"> BeginTime</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"00:00:00"</span>
            <span style="color: #ffff80"> Duration</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"00:00:00.0010000"</span>
            <span style="color: #ffff80"> Storyboard.TargetName</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"stackPanel"</span>
            <span style="color: #ffff80"> Storyboard.TargetProperty</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"(Panel.Background).(SolidColorBrush.Color)"</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">SplineColorKeyFrame</span>
            <span style="color: #ffff80"> KeyTime</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"00:00:00"</span>
            <span style="color: #ffff80"> Value</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"#50D56700"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                        </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">ColorAnimationUsingKeyFrames</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                    </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">Storyboard</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">vsm</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VisualState</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">vsm</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VisualStateGroup</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">vsm</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">VisualStateManager.VisualStateGroups</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">inter</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">Interaction.Behaviors</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">slint</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">MapState</span>
            <span style="color: #ffff80"> Source</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">StaticResource</span>
            <span style="color: #8080ff"> controller</span>
            <span style="color: #80ffff">}</span>
            <span style="color: #80ff80">"</span>
            <span style="color: #ffff80"> Property</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"IsPlaying"</span>
            <span style="color: #80ffff"> &gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">slint</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">MapStateMapping</span>
            <span style="color: #ffff80"> StateName</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Playing"</span>
            <span style="color: #ffff80"> Value</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"true"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">                </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">slint</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">MapStateMapping</span>
            <span style="color: #ffff80"> StateName</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Paused"</span>
            <span style="color: #ffff80"> Value</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"false"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">slint</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">MapState</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">inter</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">Interaction.Behaviors</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">MediaElement</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"mediaelement"</span>
          </p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">Source</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">CurrentItem</span><span style="color: #80ffff">.</span><span style="color: #cb97ff">SourceUri</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">slvideo</span><span style="color: #80ffff">:</span><span style="color: #ffff80">VideoController.MediaElement</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">StaticResource</span><span style="color: #8080ff"> controller</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">IsMuted</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">IsMuted</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">Volume</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">Volume</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">AutoPlay</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">AutoPlay</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span>    
</p>
          <p style="margin: 0px">
                    <span style="color: #80ffff">/&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">StackPanel</span>
            <span style="color: #ffff80"> Orientation</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Horizontal"</span>
            <span style="color: #ffff80"> VerticalAlignment</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Bottom"</span>
            <span style="color: #ffff80"> Background</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"#50000000"</span>
            <span style="color: #ffff80"> Margin</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"30"</span>
            <span style="color: #ffff80"> x</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #ffff80">Name</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"stackPanel"</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">CheckBox</span>
            <span style="color: #ffff80"> IsChecked</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">IsPlaying</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Mode</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">TwoWay</span>
            <span style="color: #80ffff">}</span>
            <span style="color: #80ff80">"</span>
            <span style="color: #80ffff"> /&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">slec</span>
            <span style="color: #80ffff">:</span>
            <span style="color: #0080ff">Slider</span>
            <span style="color: #ffff80"> Maximum</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Converter</span>
            <span style="color: #80ffff">={</span>
            <span style="color: #ff80c0">StaticResource</span>
            <span style="color: #8080ff"> timeSpanConverter</span>
            <span style="color: #80ffff">},</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">Duration</span>
            <span style="color: #80ffff">}</span>
            <span style="color: #80ff80">"</span>
          </p>
          <p style="margin: 0px">
                        <span style="color: #ffff80">MoveValue</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Converter</span><span style="color: #80ffff">={</span><span style="color: #ff80c0">StaticResource</span><span style="color: #8080ff"> timeSpanConverter</span><span style="color: #80ffff">},</span><span style="color: #8080ff"> Mode</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">TwoWay</span><span style="color: #80ffff">,</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">Position</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span></p>
          <p style="margin: 0px">
                        <span style="color: #ffff80">Width</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"200"</span><span style="color: #ffff80"> Margin</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"20,0,0,0"</span></p>
          <p style="margin: 0px">
                        <span style="color: #80ffff">/&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">TextBlock</span>
            <span style="color: #ffff80"> Text</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Converter</span>
            <span style="color: #80ffff">={</span>
            <span style="color: #ff80c0">StaticResource</span>
            <span style="color: #8080ff"> timeSpanConverter</span>
            <span style="color: #80ffff">},</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">Position</span>
            <span style="color: #80ffff">}</span>
            <span style="color: #80ff80">"</span>
          </p>
          <p style="margin: 0px">
                    <span style="color: #ffff80">Margin</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"20,0,0,0"</span><span style="color: #80ffff">/&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">TextBlock</span>
            <span style="color: #ffff80"> Text</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"
/ "</span>
            <span style="color: #80ffff"> /&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">TextBlock</span>
            <span style="color: #ffff80"> Text</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Converter</span>
            <span style="color: #80ffff">={</span>
            <span style="color: #ff80c0">StaticResource</span>
            <span style="color: #8080ff"> timeSpanConverter</span>
            <span style="color: #80ffff">},</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">Duration</span>
            <span style="color: #80ffff">}</span>
            <span style="color: #80ff80">"</span>
            <span style="color: #80ffff"> /&gt;</span>
          </p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">CheckBox</span>
            <span style="color: #ffff80"> IsChecked</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">IsMuted</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Mode</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">TwoWay</span>
            <span style="color: #80ffff">}</span>
            <span style="color: #80ff80">"</span>
            <span style="color: #ffff80"> Margin</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"20,0,0,0"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">Slider</span>
            <span style="color: #ffff80"> Maximum</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"1"</span>
            <span style="color: #ffff80"> SmallChange</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"0.1"</span>
            <span style="color: #ffff80"> LargeChange</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"0.1"</span>
          </p>
          <p style="margin: 0px">
                   <span style="color: #ffff80">Value</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">Volume</span><span style="color: #80ffff">,</span><span style="color: #8080ff"> Mode</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">TwoWay</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span><span style="color: #ffff80"> Width</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"50"</span><span style="color: #80ffff"> /&gt;</span></p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">TextBlock</span>
            <span style="color: #ffff80"> Text</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Buffering:"</span>
            <span style="color: #80ffff"> /&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">TextBlock</span>
            <span style="color: #ffff80"> Text</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">BufferingProgress</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Mode</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">TwoWay</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Converter</span>
            <span style="color: #80ffff">={</span>
            <span style="color: #ff80c0">StaticResource</span>
            <span style="color: #8080ff"> strConverter</span>
            <span style="color: #80ffff">},</span>
            <span style="color: #8080ff"> ConverterParameter</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">'</span>
            <span style="color: #80ffff">{</span>0<span style="color: #80ffff">:</span><span style="color: #ff80c0">p</span><span style="color: #80ffff">}</span><span style="color: #80ff80">'</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span><span style="color: #80ffff"> /&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">Slider</span>
            <span style="color: #ffff80"> Maximum</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"1"</span>
          </p>
          <p style="margin: 0px">
                   <span style="color: #ffff80">Value</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">BufferingProgress</span><span style="color: #80ffff">,</span><span style="color: #8080ff"> Mode</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">TwoWay</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span><span style="color: #ffff80"> Width</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"50"</span><span style="color: #ffff80"> IsHitTestVisible</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"False"</span><span style="color: #ffff80"> Margin</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"5,0,0,0"</span><span style="color: #80ffff">/&gt;</span></p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">TextBlock</span>
            <span style="color: #ffff80"> Text</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Downloading:"</span>
            <span style="color: #ffff80"> Margin</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"20,0,0,0"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">TextBlock</span>
            <span style="color: #ffff80"> Text</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">DownloadProgress</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Mode</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">TwoWay</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Converter</span>
            <span style="color: #80ffff">={</span>
            <span style="color: #ff80c0">StaticResource</span>
            <span style="color: #8080ff"> strConverter</span>
            <span style="color: #80ffff">},</span>
            <span style="color: #8080ff"> ConverterParameter</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">'</span>
            <span style="color: #80ffff">{</span>0<span style="color: #80ffff">:</span><span style="color: #ff80c0">p</span><span style="color: #80ffff">}</span><span style="color: #80ff80">'</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span><span style="color: #80ffff"> /&gt;</span></p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">Slider</span>
            <span style="color: #ffff80"> Maximum</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"1"</span>
          </p>
          <p style="margin: 0px">
                   <span style="color: #ffff80">Value</span><span style="color: #80ffff">="{</span><span style="color: #ff80c0">Binding</span><span style="color: #8080ff"> Path</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">DownloadProgress</span><span style="color: #80ffff">,</span><span style="color: #8080ff"> Mode</span><span style="color: #80ffff">=</span><span style="color: #cb97ff">TwoWay</span><span style="color: #80ffff">}</span><span style="color: #80ff80">"</span><span style="color: #ffff80"> Width</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"50"</span><span style="color: #ffff80"> IsHitTestVisible</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"False"</span></p>
          <p style="margin: 0px">
                   <span style="color: #ffff80">Margin</span><span style="color: #80ffff">=</span><span style="color: #80ff80">"5,0,0,0"</span><span style="color: #80ffff">/&gt;</span></p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: #60ff60">            </span>
            <span style="color: #80ffff">&lt;</span>
            <span style="color: #0080ff">CheckBox</span>
            <span style="color: #ffff80"> IsChecked</span>
            <span style="color: #80ffff">="{</span>
            <span style="color: #ff80c0">Binding</span>
            <span style="color: #8080ff"> Path</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">IsFullscreen</span>
            <span style="color: #80ffff">,</span>
            <span style="color: #8080ff"> Mode</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #cb97ff">TwoWay</span>
            <span style="color: #80ffff">}</span>
            <span style="color: #80ff80">"</span>
            <span style="color: #ffff80"> Margin</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"20,0,0,0"</span>
            <span style="color: #ffff80"> Content</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"Fullscreen"</span>
            <span style="color: #ffff80"> Foreground</span>
            <span style="color: #80ffff">=</span>
            <span style="color: #80ff80">"White"</span>
            <span style="color: #80ffff">/&gt;</span>
          </p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: #60ff60">        </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">StackPanel</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #60ff60">    </span>
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">Grid</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
          <p style="margin: 0px">
            <span style="color: #80ffff">&lt;/</span>
            <span style="color: #0080ff">UserControl</span>
            <span style="color: #80ffff">&gt;</span>
          </p>
        </div>
        <p>
          <iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 66px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-b7145a2861d183da.skydrive.live.com/embedrowdetail.aspx/Code/VideoPlayer1.7z" frameborder="0" marginwidth="0" scrolling="no">
          </iframe>
        </p>
        <img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=aa66f5d0-6bd2-46c5-a95f-90e05bfcf606" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Being the Big Boss</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2009/05/11/BeingTheBigBoss.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,cc3d4024-0316-4cb2-b0b0-82f65a505ba8.aspx</id>
    <published>2009-05-11T11:02:31.720625+02:00</published>
    <updated>2009-05-11T11:02:31.720625+02:00</updated>
    <category term="Divers" label="Divers" scheme="http://www.ucaya.com/blog/CategoryView,category,Divers.aspx" />
    <category term="Silverlight" label="Silverlight" scheme="http://www.ucaya.com/blog/CategoryView,category,Silverlight.aspx" />
    <category term="Soft" label="Soft" scheme="http://www.ucaya.com/blog/CategoryView,category,Soft.aspx" />
    <author>
      <name>Romuald Boulanger</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p align="left">
          <a href="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/BeingtheBigBoss_9AEF/image_2.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/BeingtheBigBoss_9AEF/image_thumb.png" width="311" height="214" />
          </a>
        </p>
        <p>
        </p>
        <p>
En ce début de semaine <a href="http://www.beingthebigboss.com">www.beingthebigboss.com</a> depasse
les 14 000 inscrits !!
</p>
        <p>
          <a href="http://www.beingthebigboss.com/Registration.aspx">Venez nombreux prendre
les commandes d’une multinationale !</a>
        </p>
        <p>
Et n’oubliez pas si vous êtes étudiant le concours <a href="http://www.bigbosstrophy.com">www.bigbosstrophy.com</a> se
prépare. <a href="http://www.bigbosstrophy.com/registration.aspx">Inscrivez-vous</a> !
</p>
        <img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=cc3d4024-0316-4cb2-b0b0-82f65a505ba8" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Testez moonlight sous Windows</title>
    <link rel="alternate" type="text/html" href="http://www.ucaya.com/blog/2009/05/08/TestezMoonlightSousWindows.aspx" />
    <id>http://www.ucaya.com/blog/PermaLink,guid,79aef505-cbee-4d37-8142-b69ba986e7f3.aspx</id>
    <published>2009-05-08T09:33:11.461+02:00</published>
    <updated>2009-05-12T08:13:15.36125+02:00</updated>
    <author>
      <name>Thierry Bouquain</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="moonlight_logo" border="0" alt="moonlight_logo" align="right" src="http://www.ucaya.com/blog/content/binary/WindowsLiveWriter/TestezmoonlightsousWindows_860C/moonlight_logo_thumb.png" width="104" height="129" />Même
si au final vous aurez une fenêtre faisant tourner moonlight sur votre windows, ce
ne sera pas réellement le cas. L’idée expliquée dans ce <a href="http://chriscavanagh.wordpress.com/2009/05/06/more-on-moonlight-20-preview-1/" target="_blank">post
de Chris Cavanagh</a> est d’utiliser <a href="http://portableubuntu.demonccc.cloudius.com.ar/" target="_blank">Portable
Ubuntu</a>. Cette distribution d’Ubuntu tourne en tant que programme windows. Vous
pourrez donc installer <a href="http://go-mono.com/moonlight-preview/" target="_blank">Moonlight</a> sur
le firefox d’ubuntu.
</p>
        <img width="0" height="0" src="http://www.ucaya.com/blog/aggbug.ashx?id=79aef505-cbee-4d37-8142-b69ba986e7f3" />
      </div>
    </content>
  </entry>
</feed>
