Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 264727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:42:35+00:00 2026-05-11T22:42:35+00:00

I’m looking for some insight into the workings of Silverlight – at this time

  • 0

I’m looking for some insight into the workings of Silverlight – at this time I suspect I need to know more about how UI event dispatching and control repainting are done to work out a solution or compromise for the following problem:

I have a large number of elements (of which I am representing as controls) on screen. Numerically it’s around 300, though the exact number is dependent on the size of the browser window.

Each element will eventually display information (TextBlocks, Images) and have some mouse interactions (ToolTips, mouse events for toggling and drag and drop). At first glance it might resemble a DataGrid, but unfortunately it’s not (it’s an infinitely scrollable non-rectangular surface). But at the moment each element is just a user control with nothing but a Rectangle inside it.

<UserControl x:Class="MyElement" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  Width="49" Height="49">
    <Grid>
        <Rectangle x:Name="Border" Stroke="Black" Fill="White" />
    </Grid>
</UserControl>

 

for (int i = 0; i < elementsRequired; i++)
{
    var item = new MyElement();
    // Set Canvas.LeftProperty and Canvas.TopProperty to a unique position
    ElementsArea.Children.Add(item);                    
}

Creating 300 of these controls and dropping them onto a Canvas (or Grid) is slow – 4 seconds to complete. However since this operation is rarely done, I’m not as concerned about it as the next problem.

Once the controls are placed CPU is normal (0%), but attempting to use an unrelated ScrollBar (a ScrollBar primative with no events) shows a lot of lag – the scrolbar thumb struggles to keep up with the mouse. If I increase/decrease the number of elements, the scrollbar lag changes accordingly.


Under the assumption that the canvas element (which normally allows elements to overflow) is doing some clipping calculations I tried both defining a clipping rectangle for the canvas, moving the scrollbar entirely away the canvas (into a different layout tree), and changing from a canvas to a grid (with all 300 elements just sitting in the center overlapping). I also testing changing the elements Visiblity to Collasped, with no effect.

I’ve also tried substituting the elements – creating just a rectangle or an image reduces the slowdown, but only to the degree I’d expect from there being fewer elements on the tree (MyElement being 3 controls, UserControl, Grid and Rectangle, instead of 1).

Under the assumption that some Find method was having to transverse all 300 of my elements before getting to the scrollbar, I tried to change the order of declaration in the XAML file, with no luck.

And finally I’ve tried setting IsHitTestVisible and IsEnabled to false on the elements and the entire Canvas, to no effect.


So far as I can tell I have a large but entirely reasonable number of static controls, that are not using any CPU normally, yet when I try interacting with an unrelated ScrollBar, they create some kind of traffic jam in the UI or rendering pipeline.

Any ideas where that is or how to solve it?

EDIT: Initial cause has been found, see below. (Added themes tag)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:42:35+00:00Added an answer on May 11, 2026 at 10:42 pm

    Through trial and error I’ve finally found the factor responsible.

    I’m using the Theming system from the Silverlight Toolkit. As I create a lot of controls dynamically (“windows” and “dialogs”), the theme has ApplyMode=”Auto”, in which controls automatically have the theme styles applied.

    For whatever reason dragging the thumb of the scrollbar control is triggering this constantly, causing the style information of all those controls to be updated, regardless of where they are or if they are even visible.

    Unfortunately I don’t see any quick solution for just turning that off as dynamical controls are everywhere. What I’ve tried to do is change ApplyMode to one time only for just the ScrollBar, however this doesn’t seem to be working. My best guess is that the scrollbar is dynamically creating some control for every change – any insight into this?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.