Tuesday, January 22, 2013

How to create the border of a dynamic canvas in Silverlight?

How to create the border of a dynamic canvas in Silverlight?

Hi I am creating a Canvas in code behind like below:

Canvas musicPlayerCanvas = new Canvas();                     musicPlayerCanvas.Background = new SolidColorBrush(Colors.White);                     musicPlayerCanvas.Height = 80;                     musicPlayerCanvas.Width = 1018; LayoutRoot.Children.Add(musicPlayerCanvas);  musicPlayerCanvas.Children.Add(playingText); musicPlayerCanvas.Children.Add(albumImage); 

Now how can I add border to the canvas from the codebehind.

I tried with creating a Border and assigning a child like below:

Border myBorder = new Border();                     //Border Proporties                        Canvas.SetTop(musicPlayerCanvas, 26);                     Canvas.SetLeft(musicPlayerCanvas, 154);                     LayoutRoot.Children.Add(musicPlayerCanvas);                     myBorder.Child = musicPlayerCanvas; 

It is not working for me . Any help please.

Thanks, Subhen

Answers & Comments...

Answer: 1

You want to add the canvas to the border, like so:

Canvas musicPlayerCanvas = new Canvas(); musicPlayerCanvas.Background = new SolidColorBrush(Colors.Purple);  Border border = new Border(); border.BorderBrush = new SolidColorBrush(Colors.Black); border.BorderThickness = new Thickness(5); border.Height = 80; border.Width = 1018; border.Child = musicPlayerCanvas;  LayoutRoot.Children.Add(border); 

On a side note, when using controls like text boxes and images (which is what I think you might be doing looking at your control names), you might want to use a Grid rather than a Canvas as a container control. Cheers, Phil

by : Philhttp://stackoverflow.com/users/158551




Load testing Silverlight application that uses CSLA DataPortal

Load testing Silverlight application that uses CSLA DataPortal

We need to perform a load test on a Silverlight application that uses Data Portal to communicate with the server. Since the point of these tests is to evaluate application server's performance, I ignore the client part, and send SOAP-requests directly to the server, but in doing so I've encountered a few problems:

  1. Since JMeter is a preferable tool, but it doesn't support soap+msbin content-type, I'm having problems decoding binary xmls that are sent both by client and by server.
  2. Using Fiddler and a WCF binary plug-in, I've noticed that SOAP messages contain fields like ClientContext, GlobalContext, CriteriaData and so on, that are base64 encoded binary data. From what I understand, this is the way CSLA Data Portal exchanges information - by sending serialized objects encoded in base64.

So, what I would like to know is, is it possible to make JMeter able to receive and send MSBIN encoded xml-files, preferably without using any external applications? And if I use a different load testing tool, like WAPT or LoadRunner, that already has this functionality, how do I parametrize the serialized data? Or maybe there are other solutions (free ones, if possible)?

Any help would be greatly appreciated.

Answers & Comments...