Select to view content in your preferred language

FeatureLayer Command Binding issue

722
3
10-09-2012 04:26 AM
bayramüçüncü
Deactivated User
I wanna command bind to FeatureLayer, but not werking. I am using Prism library and Esri silverlght API. I read from prism document that Commands handle UI actions. Is the issue because FeatureLayer is not derived from Control?

My code is folowing.
            xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client" 
            xmlns:cmd="clr-namespace:Infrastructure.Commands;assembly=Infrastructure" 
            xmlns:fcmd="clr-namespace:Infrastructure.Commands.FeatureLayerCommands;assembly=Infrastructure" 

        <esri:Map x:Name="MyMap"
                  VerticalAlignment="Stretch"
                  HorizontalAlignment="Stretch"
                  cmd:MouseClick.Command="{Binding Map_Click}" 
                  cmd:SizeChange.Command="{Binding Size_Change}">
                       
                  <esri:FeatureLayer ID="ff"
                               Url="http://domain/arcgis/rest/services/serv/MapServer/4"
                               Mode="OnDemand"
                               fcmd:FeatureLayerMouseEnter.Command="{Binding FeatureLayer_MouseEnter}"                               
                               />

        </esri:Map>


Map commands as following are working
                  cmd:MouseClick.Command="{Binding Map_Click}"
                  cmd:SizeChange.Command="{Binding Size_Change}"

But feature layer command is not working and no error occuring.
                 fcmd:FeatureLayerMouseEnter.Command="{Binding FeatureLayer_MouseEnter}"    

Is the problem about FeatureLayer is not a UI Control
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
Yes, Layer is not a control. You can probably bind to Map, ConverterParameter with ID of your layer and a Converter that would get the layer given ID instead.
0 Kudos
bayramüçüncü
Deactivated User
Yes, Layer is not a control. You can probably bind to Map, ConverterParameter with ID of your layer and a Converter that would get the layer given ID instead.


I am binding to Map object successful and I wanna do composite application. For example MouseEnter and MouseLeave event binding with command to Feature Layer. But this not works. Binding everything to Map object is not make sense.
0 Kudos
bayramüçüncü
Deactivated User
I think, ESRI should convert to Control ArcgisDynamicServiceLayer and FeatureLayer objects to Command binding. Silverlight supports the composite application development with Prism. If we develop the applications in a single project (not composite), the xap files size is increasing. Is this true?
0 Kudos