Skip to main content
Home Forums General Silverlight Getting Started Is this a bug or ???
12 replies. Latest Post by marthagfy96 on November 22, 2009.
(0)
talldaniel
Member
590 points
329 Posts
07-02-2009 9:21 PM |
The code below appears to work fine unless I uncomment the commented line below. If I uncomment the line below, then the Silverlight page locks up and wont respond, or allow any clicks, etc.
However, I have nearly identical code which does work with the line uncommented. In it, I am adding a different control.
WorkOrderDisplay is a simple control that only binds text to the values which are copied into a local value from workorder.
workOrder is actually defined in a WCF service.
Also, when it locks up, it doesnt do it instantly, it takes about two seconds from the time the code is hit, which makes me think it is somehow related to the workOrder being a class that is defined in a WCF service.
My question is, how can I can I make this work after I have uncommented the line. If I leave it commented, it places the control in the wrong place.
Thanks
display.SetValue(
LayoutRootTop.Children.Add(display);
vincracker
Contributor
3116 points
522 Posts
07-03-2009 1:31 AM |
I'm so sure that you might have overlooked something other than the code you shown. Your code is perfectly correct and it should work. There is no reason for your code to not work and hangup your application. Again go through your code and check for possible deadlock or post more code here(only that much which is enough to reproduce the bug.)
AngelaE1111
2 points
1 Posts
07-03-2009 3:28 AM |
Is this all of his code or is there more?
Roet
211 points
65 Posts
07-03-2009 4:11 AM |
Have you tried setting the Row using the following method? It might work.
Grid.SetRow(display,1);
rleclerc
10 points
15 Posts
07-03-2009 11:17 AM |
Just a shot in the dark, but maybe trying constructing this asynchronously and set the display parameters on the callback.
07-03-2009 2:24 PM |
It does work fine, unless I uncomment the line of code which is commented. I saw there was a similar bug in SL2.0 when it was beta.
07-03-2009 2:34 PM |
AngelaE1111: Is this all of his code or is there more?
What would you like to see? THere is the control, which has no code, except binding related.
There is the calling function, which is using the same code as another one that works, (with the line uncommented.) Let me know.
Jonathan...
All-Star
24939 points
2,425 Posts
07-09-2009 5:04 AM |
Hi Talldaniel,
I have put a StackPanel,which has a TextBox in it, to the Grid and do the same test on Silverlight 2 RTW. It works pretty well. Anyway, Silverlight 3 will be released very soon, you can test it on Silverlight 3.
Best regards,
Jonathan
07-09-2009 1:36 PM |
Hi Jonathan,
Sorry if I wasnt very clear, it is hard to communicate debugging problems in ascii text.
I am using Silverlight 3.0 for the above example, and I too was able to use the same code and have it work for a different user control. The control that it doesnt work for has almost no code, and is mostly done in binding.
I have since ran into a few problems with similar code that is solved by casting the variable in the setValue to the proper type. (Usually a double.) It may have been related to that, but i cant easily recreate the problem because I just worked around it and it is no longer setup the way it was.
LisaStha...
08-13-2009 2:33 AM |
Really a educative and informative post, the post is good in all regards,I am glad to read this post
Resveratrol
oscymobile
09-14-2009 4:53 PM |
Yes it helped me, as I had code issues too.
marthagfy96
11-22-2009 9:22 PM |
Hi, thanks a lot Roet. Your code works fine and fixes the issue. Really appreciate it a lot :)
Martha