I am writing code that opens up the attribute table and then proceeds to open the GoTo command. The attribute table needs to be fully loaded before the GoTo command will execute. I subscribed to the ActivePaneChangedEvent to ensure initialisation of the table. I was surprised however to discover that the ActivePaneChangedEvent happens before the pane is fully initialised. In the code below pane.Initialized returns false inside the ActivePaneChangedEvent. Is this expected behaviour? @UmaHarano @Wolf
ActivePaneInitializedEvent.Subscribe(OnActivePaneInitialized);
var openTableBtnCmd = FrameworkApplication.GetPlugInWrapper("esri_editing_table_openTablePaneButton") as ICommand;
if (openTableBtnCmd != null)
{
// Let ArcGIS Pro do the work for us
if (openTableBtnCmd.CanExecute(null))
{
openTableBtnCmd.Execute(null);
}
}
private void OnActivePaneInitialized(ActivePaneInitializedEventArgs obj)
{
var pane = FrameworkApplication.Panes.ActivePane;
if (pane is ITablePane)
{
if (pane.Initialized)
{
var goToBtnCmd = FrameworkApplication.GetPlugInWrapper("esri_editing_tableGoTo") as ICommand;
if (goToBtnCmd != null)
{
if (goToBtnCmd.CanExecute(null))
{
goToBtnCmd.Execute(null);
}
}
}
}
}