title: How can I divide the figure into the fields using SilverLight
body: <p>Can someone help me solve the question: How can I divide the figure into the fields, so depending on which area will be  mouse click it will be carried out a specific event?</p>
  
  <pre><code>    private void LayoutRoot_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
      {
          //if (!isDragging)
          {
              //creating of my  user control element
              NodePicture node = new NodePicture();
              node.Width = 100;
              node.Height = 100;
  
              //use cursor position as the center of the figure
              Point point = e.GetPosition(this);
              node.SetValue(Canvas.TopProperty, point.Y - node.Height / 2);
              node.SetValue(Canvas.LeftProperty, point.X - node.Width / 2);
              node.MouseLeftButtonDown += controlReletionshipsLine;
              LayoutRoot.Children.Add(node);
          }
      }
  
      private void controlReletionshipsLine(object sender, MouseButtonEventArgs e)
      {
          //creating parant element of node
          ParentNode parentNode = new ParentNode();
  
          //creating connected element of the node
          ConnectedNode connectedNode = new ConnectedNode();
  
          //creating node element
          NodePicture node = (NodePicture)sender;
  
          //getting the relative position of the element
          Point point = e.GetPosition(this);
  </code></pre>