I have a workflow where the QueryTools object isn't being instantied in my InMemoryFeatureLayer.
Problematic workflow:
Create a WpfMap
Add features to map
Display the map
Access QueryTools -> null
Good workflow
Create a WpfMap
Display the map
Add features to map
Access QueryTools -> not null... everything's ok
Like I said, the layer where the QueryTools isn't being initialized is an InMemoryFeatureLayer. My other layers, which derive from FeatureLayer are just fine.
So, a question is this: for an InMemoryFeatureLayer, when does QueryTools get instantied?
Also, is there something I need to do to make QueryTools become instantied?
Both workflows exist due to the architecture of our application.
Yale is correct in that there is a Protected method called SetupTools that gets called in the Open method of the FeatureLayer base class. I think what we need to do to improve things is to raise a better exception when you try to get to the QueryTools or EditTools before you have opened the Layer. In this way you would have known you needed to open the Layer first. I will have the guys add this exception.