title: Setting the X and Y coordinates of a UIelement within a Canvas progmatically
body: <p>Admins: sorry if I asked this on the wrong forum, I'm new to the whole SE network.</p>
  
  <p>I've been working on a project for some time now, and now I'm stuck. The project is a Universal Windows 8.1 runtime app programmed in C# and XAML. Below is a function from the Windows 8.1 part of the project called updateMapGUI(). It is called after an event is triggered and adds items to a pre-existing canvas on the page.</p>
  
  <pre><code>private void updateMapGUI()
  {
      while (mapCanvas.Children.Count &gt; 0)
      {
          mapCanvas.Children.RemoveAt(0);
      }
      panelTracker = 0;
      foreach (User i in activeUsers)
      {
          if(i == null)
          {
              return;
          }
          else
          {
              //Update the mapCanvas with data from the appropriate User object from the array activeUsers[]
              dotpanels[panelTracker] = new Canvas();
              mapCanvas.Children.Add(dotpanels[panelTracker]);
              dotpanels[panelTracker].Height = 3;
              dotpanels[panelTracker].Width = 3;
              dotpanels[panelTracker].Left = getXOffset(i);
              dotpanels[panelTracker].Up = getYOffset(i);
              if (i.isSelected == false)
              {
                  SolidColorBrush unselectedDot = new SolidColorBrush(Windows.UI.Colors.Blue);
                  dotpanels[panelTracker].Background = unselectedDot;
              }
              else
              {
                  SolidColorBrush selectedDot = new   SolidColorBrush(Windows.UI.Colors.Green);
                  dotpanels[panelTracker].Background = selectedDot;
              }
              panelTracker++;
          }
      }
  }
  </code></pre>
  
  <p>dotpanels is a canvas[] array and panelTracker is an int[] array. The issue is with dotpanels[panelTracker].Left and dotpanels[panelTracker].Up. According to the documentation, this function can be called on any child of a canvas (not quite sure if I read that correctly). The compiler says that the Canvas in dotpanels[panelTracker] does not contain a definition for Up or Left. What am I doing wrong? If it's not possible, what I basically need to do is show some dots at specific X and Y locations. Thanks in advance for your responses!</p>