Events for Non Framework Elements

Topics: Conventions, Getting Started
Feb 16, 2012 at 4:02 PM

Is there a way to capture events for non framework elements (which are mostly 3rd party elements in my app) using CM? I dont know how ConventionManager is used. Is that something that can be used? If yes then can someone please point me to a sample on how to use ConventionManager? I have following spatial components in my WPF app-


  <esri:Map x:Name="SMARTMap" WrapAround="True" Extent="-14845297.1729313940, 771252.4065809906, -5401390.1535723, 7067190.4194870535" SnapToLevels="True" extensions:MapExtentHelper.MapZoomGeometry="{Binding ZoomGeometry}">
            <bing:TileLayer ID="BingLayer" LayerStyle="AerialWithLabels"  Visible="True" 

And I want to know if its possible to use CM for events like Initialized in the code above. Any help is highly appreciated!!!





Feb 21, 2012 at 2:53 PM

Can someone please help me in this regard? Please let me know if its not possible.





Feb 21, 2012 at 8:41 PM

If the Map control is not a descendent of FramorkElement then you cannot use Action Messages with it. You could:

a. use the code behind

b. wrap the control in a framework element, create new events and forward them back and forth to the underlying map control

c. use the event aggregator (from code behind)

d. create a custom behavior that bridges from a non-framework element into the Action Message mechanism by creating "fake" framework elements at critical points in time to satisfy the infrastructure

e. there are probably other ways too

Feb 23, 2012 at 8:28 PM

Thank you so much for the help. That re-assures me that I wasnt doing something that could be done the right way.!!