title: Unhandled Error in Silverlight Application Code: 4004 System.ArgumentException:
body: <p>I am developing a esri map project on silverlight. When i add custom user control as element layer, getting that error from browser:</p>
  
  <pre><code>Line: 56
  Error: Unhandled Error in Silverlight Application 
  Code: 4004    
  Category: ManagedRuntimeError       
  Message: System.ArgumentException: 
  Parameter name: height
     at System.Windows.Rect..ctor(Double x, Double y, Double width, Double height)
     at ESRI.ArcGIS.Client.LayerCanvas.ArrangeOverride(Size finalSize)
     at System.Windows.FrameworkElement.ArrangeOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single&amp; outWidth, Single&amp; outHeight)     
  </code></pre>
  
  <p>This is weird, because i didnt write any code or something. And my map service works. 
  i think the problem occurs at parsing xaml files. So;</p>
  
  <p>mainpage.xaml is:</p>
  
  <pre><code>&lt;UserControl x:Class="tbl.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"
      xmlns:esri1="http://schemas.esri.com/arcgis/client/2009"
      xmlns:lcl="clr-namespace:tbl"
      d:DesignHeight="600" d:DesignWidth="800"&gt;
  
      &lt;Grid x:Name="LayoutRoot" Background="White"&gt;
  
          &lt;esri1:Map x:Name="esrimap"&gt;
              &lt;esri1:ArcGISTiledMapServiceLayer Url="http://.../ArcGIS/rest/services/.../MapServer"&gt;
              &lt;/esri1:ArcGISTiledMapServiceLayer&gt;
  
              &lt;esri1:ElementLayer&gt;
                  &lt;lcl:SilverlightControl1 esri1:ElementLayer.Envelope="495942.700915659,4509916.68364022,495942.700915659,4509916.683614022"&gt;&lt;/lcl:SilverlightControl1&gt;
              &lt;/esri1:ElementLayer&gt;
  
          &lt;/esri1:Map&gt;
      &lt;/Grid&gt;
  
  
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>and silverlightcontrol.xaml:  </p>
  
  <pre><code>&lt;UserControl x:Class="tbl.SilverlightControl1"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"
      d:DesignHeight="300" d:DesignWidth="400"&gt;
  
      &lt;Grid x:Name="LayoutRoot" Background="White"&gt;
  
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>Can anybody help me?</p>