New XAML elements do not display immediatelly

I created a test HTML page containing a WPF/E control - Canvas, clickable Rectangle that covers the entire canvas, TextBlock at the bottom of the control that displays a message about the coordinates of every click.

On every click after displaying the message, I create a small ellipse(circle) and add it to the Canvas at the point of the click.

It all works fine when the entire page is visible in the browser, BUT in a shorter browser window, where the TextBlock is not visible, the clicks do not render circles, UNTIL I scrolled the browser down and the TextBlock became visible. At this point all circles that should have been rendered moments earlier, appeared.

When clicking while the TextBlock is visible it all works fine. Scroll it out of view and the above mentioned behavior occures again.

Is this a bug or am I doing something wrong with the codding?

[893 byte] By [PeterKalev] at [2007-12-30]
# 1

hi peter ,

Have you tried by using collectionviewsource for canvas ? basically i m not geeting what u want to say ? i think u have to blind canvas with resource then you tried by following sample..

<canvas.Resource>

<CollectionViewResource source={BInding Path=xyz} x:Key="ddd">

<canvas.resorce>

k.Rahul at 2007-9-5 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) Developer Issues...
# 2

Just curious, but what happens if you add the ellipse to the canvas before displaying the message in the textblock?

I'm wondering if there is some kind of logic around redrawing things that is causing your issue.

BryantLikes at 2007-9-5 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) Developer Issues...
# 3

BTW - I tried to duplicate your issue but I couldn't. Take a look at my test here: http://blogs.sqlxml.org/wpfe/click/

Xaml: http://blogs.sqlxml.org/wpfe/click/click.xaml

JS: http://blogs.sqlxml.org/wpfe/click/eventhandlers.js

Seems to work even if I scroll the TextBlock out of view.

BryantLikes at 2007-9-5 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) Developer Issues...