title: How to create the border of a dynamic canvas in Silverlight?
body: <p>Hi I am creating a Canvas in code behind like below:</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>Now how can I add border to the canvas from the codebehind.</p>
  
  <p>I tried with creating a Border and assigning a child like below:</p>
  
  <pre><code>Border myBorder = new Border();
                      //Border Proporties
  
  
  
                      Canvas.SetTop(musicPlayerCanvas, 26);
                      Canvas.SetLeft(musicPlayerCanvas, 154);
                      LayoutRoot.Children.Add(musicPlayerCanvas);
                      myBorder.Child = musicPlayerCanvas;
  </code></pre>
  
  <p>It is not working for me . Any help please.</p>
  
  <p>Thanks,
  Subhen</p>