我正在silverlight 上开发一个esri 地图项目。当我将自定义用户控件添加为元素层时,从浏览器中获取该错误:
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& outWidth, Single& outHeight)
这很奇怪,因为我没有写任何代码或其他东西。我的地图服务有效。我认为问题发生在解析 xaml 文件时。所以;
mainpage.xaml 是:
<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">
<Grid x:Name="LayoutRoot" Background="White">
<esri1:Map x:Name="esrimap">
<esri1:ArcGISTiledMapServiceLayer Url="http://.../ArcGIS/rest/services/.../MapServer">
</esri1:ArcGISTiledMapServiceLayer>
<esri1:ElementLayer>
<lcl:SilverlightControl1 esri1:ElementLayer.Envelope="495942.700915659,4509916.68364022,495942.700915659,4509916.683614022"></lcl:SilverlightControl1>
</esri1:ElementLayer>
</esri1:Map>
</Grid>
</UserControl>
和 silverlightcontrol.xaml:
<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">
<Grid x:Name="LayoutRoot" Background="White">
</Grid>
</UserControl>
有谁能够帮我?