Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>When animating text in Silverlight you should be setting the <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.textoptions.texthintingmode(v=VS.95).aspx" rel="nofollow noreferrer">TextHintingMode</a> attached property to "Animated" on your TextBlock. To improve text readability Silverlight usually uses hinting to smooth each text glyph. This can have a large performance impact when animating text, since a change will cause recalculation of how the glyph is most legible which could be happening up to 60 frames a second with in an animation.</p> <pre><code>&lt;TextBlock TextOptions.TextHintingMode="Animated" FontFamily="Arial" FontSize="12" Width="555" Foreground="White" TextWrapping="Wrap" Canvas.Left="10" Text="{Binding Credits}" x:Name="Credits" TextAlignment="Center" RenderTransformOrigin="0.5,0.5"&gt; ... &lt;/TextBlock&gt; </code></pre> <p>If that does not solve your problem I would recommend you start debugging performance with <a href="http://msdn.microsoft.com/en-us/performance/default.aspx" rel="nofollow noreferrer">XPerf</a>. There is a <a href="http://blogs.msdn.com/b/seema/archive/2008/10/08/xperf-a-cpu-sampler-for-silverlight.aspx" rel="nofollow noreferrer">good tutorial</a> on using this command-line tool to see where most of your CPU time is spent while a portion of your Silverlight application runs. You should be paying attention to how much CPU time is spent in <em>agcore.dll, npctrl.dll, and coreclr.dll</em>. If your performance problems are related to redrawing, most of the CPU time is likely spent in agcore.dll since that does most of the graphics related work for Silverlight. You can then drill into that and see the specific functions in agcore.dll that are getting called most often during your sample time. This can often help you realize which portions of your code are causing the performance hit and how you can optimize.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload