AnsweredAssumed Answered

Connecting Map in MainWindow to UserControl

Question asked by dalejs on Sep 10, 2014

Thanks for looking at my question.  Learning Xaml, C# and WPF all at the same time.  I am working on on am Offline Editor for WPF. So here goes, I have an offline FeatureLayer that is created from an online FeatureLayer. The FeatureLayer is point data.  I can add a new point and any attributes of the new point to the offline geodatabase of the FeatureLayer.  This was all built using the Esri samples from GitHub.


Now I want to be able to edit the offline geodatabase of the FeatureLayer. I have created UserControls from the EditorWidget and TemplatePicker samples from GitHub as well.  The samples reference ArcGISLocalTiledLayer and ArcGISLocalFeatureLayer from esri:Map x:Name="MyMap"


My question is how do I access the offline Featurelayer/geodatabase from the UserControls?  I have tried esri:FeatureLayer wih the ID of the offline FeatureLayer, but since the layer is crated by the application I do not see how to tie it to the UserControl in the way the ArcGISLocalTiledLayer and ArcGISLocalFeatureLayer are in the sample code.


To add more to this, in my MainWindow my map is esri:Map x:Name="mapView", I am thinking I need to tie/access/connect the esri:Map from the UserControls to esri:Map x:Name="mapView" in the MainWindow for this to even begin to work?


What I have working is that after the new Featurelayer/geodatabase is created I click on an Edit button, the initialize component is fired off in the TemplatePicker, a dialog box opens and that is all that happens.  What I want to see is the TemplatePicker open with the different points to edit displayed.


I am even going down the correct thought process on this?


Thank you for your time.  Dale,