Circular effect in ticker-silverlight -


i working on silverlight ticker application, 5 links visible , moving ticker(right left). able parse i/p xml file , getting title , corresponding urls, coming in page, moving ticker , circular effect missing.means continuous flow of links not proper.

  <grid x:name="layoutroot">     <stackpanel x:name="mystackpanel" grid.column="1" orientation="vertical">         <canvas>             <canvas.resources>                 <storyboard x:name="sb">                     <doubleanimation x:name="da" begintime="00:00:05"                 storyboard.targetname="linklist"                 storyboard.targetproperty="(canvas.left)"                 from="0" to="-500" duration="0:0:5" repeatbehavior="forever"/>                  </storyboard>             </canvas.resources>             <listbox x:name="linklist"                       borderthickness="0"                       opacity="0.5"                       horizontalalignment="left"                      >             <listbox.itemspanel>                 <itemspaneltemplate>                     <stackpanel x:name="panel" orientation="horizontal"  horizontalalignment="left"/>                 </itemspaneltemplate>             </listbox.itemspanel>             <listbox.itemtemplate>                 <datatemplate>                     <hyperlinkbutton x:name="mylink"                                          foreground="black"                                          fontsize="10"                                          fontweight="bold"                                          scrollviewer.horizontalscrollbarvisibility="disabled"                                          tag="{binding}"                                          content="{binding path=title}"                                          navigateuri="{binding path=uri}"                                          istabstop="false"/>                 </datatemplate>             </listbox.itemtemplate>         </listbox>  </canvas>  </stackpanel>      </grid> 

how circular effect?

here the simplest approach effect need.

  • set from in double animation width of outer stackpanel. way urls start extreme right.
  • make sure to value negative of @ least full width of content scrolled.
  • add rectanglegeometry outer stackpanel starts @ 0,0 , has width , height of stackpanel.
  • adjust duration reasonable pixels/second rate (you want constant speed not appearing increase in speed more content present).

Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -