Hi,
How would you go about trying to access the data from a ViewModel (belonging to a ProWindow) from another ViewModel?
I have tried to find some way of doing it via the FrameworkApplication - in the same style as the DockPaneManager - but alas there does not seem to be an equivalent for a ProWindow.
Should I hold a reference to the ViewModel in the Module class?
Solved! Go to Solution.
You can use the Module class (which is a singleton) to register your dockpane(s) for access throughout your add-in or even from other add-ins. The pattern is utilized by this sample for internal access: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/MapToolIdentify...https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/MapToolIdentify....
Look in the Module1 class for usage of this property:
internal static MapToolIdentifyDockpaneViewModel MapToolIdentifyDockpaneVM { get; set; }
You can use the Module class (which is a singleton) to register your dockpane(s) for access throughout your add-in or even from other add-ins. The pattern is utilized by this sample for internal access: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/MapToolIdentify...https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/MapToolIdentify....
Look in the Module1 class for usage of this property:
internal static MapToolIdentifyDockpaneViewModel MapToolIdentifyDockpaneVM { get; set; }