Skip to main content

Microsoft Silverlight

Answered Question Is this a bug or ???RSS Feed

(0)

talldaniel
talldaniel

Member

Member

590 points

330 Posts

Is this a bug or ???

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

WorkOrderDisplay display = new WorkOrderDisplay(workOrder);

display.SetValue(Grid.ColumnProperty, 1);

display.SetValue(Grid.RowSpanProperty, 3);

//display.SetValue(Grid.RowProperty, 1);

display.SetValue(Grid.ColumnSpanProperty, 2);

LayoutRootTop.Children.Add(display);

vincracker
vincracker

Contributor

Contributor

3116 points

522 Posts

Re: Is this a bug or ???

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
AngelaE1111

Member

Member

2 points

1 Posts

Re: Re: Is this a bug or ???

 Is this all of his code or is there more?

Roet
Roet

Member

Member

211 points

65 Posts

Re: Is this a bug or ???

Have you tried setting the Row using the following method? It might work.

 

Grid.SetRow(display,1);

 

 

If this post helped you, please mark it as answer! It helps other people too.

rleclerc
rleclerc

Member

Member

10 points

15 Posts

Re: Is this a bug or ???

Just a shot in the dark, but maybe trying constructing this asynchronously and set the display parameters on the callback.

talldaniel
talldaniel

Member

Member

590 points

330 Posts

Re: Is this a bug or ???

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.

talldaniel
talldaniel

Member

Member

590 points

330 Posts

Re: Is this a bug or ???

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.

(This is t

talldaniel
talldaniel

Member

Member

590 points

330 Posts

Re: Re: Is this a bug or ???

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 Shen – MSFT
Jonathan...

All-Star

All-Star

24939 points

2,425 Posts

Microsoft
Answered Question

Re: Re: Is this a bug or ???

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

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

talldaniel
talldaniel

Member

Member

590 points

330 Posts

Answered Question

Re: Re: Is this a bug or ???

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.

 

LisaSthalekar
LisaStha...

Member

Member

2 points

1 Posts

Resveratrol

 
Really a educative and informative post, the post is good in all regards,I am glad to read this post

 

 Resveratrol

oscymobile
oscymobile

Member

Member

2 points

1 Posts

Re: Resveratrol

Yes it helped me, as I had code issues too.

marthagfy96
marthagfy96

Member

Member

2 points

1 Posts

Re: Is this a bug or ???

 Hi, thanks a lot Roet. Your code works fine and fixes the issue. Really appreciate it a lot :)

 Martha

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities