Howto: Graphic features上鼠标事件失效

文章编号: 447
软件: ArcGIS Server 9.3, 9.3.1
操作系统: Windows 2003 Server, Vista, 2008 Server
已邀请:

EsriSupport

赞同来自:

摘要:
默认情况下, 在Silverlight 的应用程序中user interface (UI) elements 可以反应鼠标事件.这有可能的原因是它们组件之间有可能互相影响,例如:Microsoft Silverlight/WPF中的ArcGIS API 的Graphics图层,正常情况下, UI elements 可以通过设置IsHitTestVisible 属性为false来使鼠标事件失效,然而, Graphics layers 和Graphic components 都不是UI elements, 所以这个属性是没有价值的也是无效的. 相反, 客户化的控件模板能用来配置IsHitTestVisible 属性关于几何实体的符号来着色要素. 从而取代那种方法来使鼠标事件在几何要素的情况下无效.
内容: 在XAML页, 修改已经存在的控件模板,如下是一个修改图符号的一个例子:

<esriSymbols:SimpleFillSymbol x:Name="DefaultFillSymbol" Fill="#66FF0000"

BorderBrush="Red" BorderThickness="1" >

<esriSymbols:SimpleFillSymbol.ControlTemplate>

<ControlTemplate>

<Path x:Name="Element"

IsHitTestVisible="False"

Fill="{Binding Symbol.Fill}"

Stroke="{Binding Symbol.BorderBrush}"

StrokeThickness="{Binding Symbol.BorderThickness}"/>

</ControlTemplate>

</esriSymbols:SimpleFillSymbol.ControlTemplate>

</esriSymbols:SimpleFillSymbol>






创建时间:2009-11-25
最近更新:2009-11-25


原文链接
http://support.esrichina.com.cn/2009/1125/447.html

要回复问题请先登录注册