Select to view content in your preferred language

Docking option

984
8
05-09-2021 05:44 AM
mody_buchbinder
Occasional Contributor III

Is it possible to dock using code a dockpane just like the attached image?

Note the the dockpane is dock between the TOC and the catalog and NOT under them (taking the full width of the window).

The only option in the code put the new dockpane so it cover (or make shorter) the toc and catalog.

 

Thanks

Mody

8 Replies
TomGeo
by
Occasional Contributor III

Well, go through this page here. I assume you already aware of the dock property but have also a look at the dockWith property.
A value of 'bottom' for the dock property should do the trick...

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
Asimov
by
New Contributor III

Really old topic, but it looks like it's still hard to achieve exactly what @mody_buchbinder asked. I'm currently in the same situation, and @TomGeo's answer is not the solution, since dock="bottom" places the dockpane in a way that it takes the whole horizontal space available, like mody wrote in his post.

I would use dock="group" together with dockWith property, but I couldn't find any example or documentation that shows which dockpanes are placed in the desired position, so I'm still stuck with it.

Mody, did you manage to achieve this? Anyone knows about any "stock" dockpane that opens in the center-bottom spot, or any other workaround that could solve this?

jmidtlyng
New Contributor II

Can't get there with DockPane. Have to use Pane. Not much documentation on Pane but if you add a new Pane item the boilerplate code does a lot for you.

For me the boilerplate CustomPaneClassName.Create() places the pane in whatever pane is active.

So to work around we did a little slight-of-hand/old-school-jank coding:

  1. Activate ArcPro’s built-in Attribute Table immediately before loading our custom Pane.
    • This will activate the Pane referenced in your screenshot.
    • Load our custom pane.
  2. There is no option for where to open it.
    • It will open in the Active pane because of step 1.
  3. Close the ArcPro Attribute Table.

Surprisingly I couldn't tell the ArcPro Attribute Table opened and closed. Happens quickly enough it appears to simply open my custom pane and no others. It also could be the case that my warm work laptop's latency helped make it appear magic.

Here's the admittedly silly code:

// validate map view
if (MapView.Active is null) return;

// get map ref and validate
var map = MapView.Active.Map;
if (map.MapType != MapType.Map) return;

// validate map layers
if (map.Layers.Count() > 0) {
    // first layer of TOC as placeholder and validate it can load to table content
    var placeholderLayerMapMember = map.Layers.First() as MapMember;

    // validate. If you use other layers, still recommend mapmember validation
    if (FrameworkApplication.Panes.CanOpenTablePane(placeholderLayerMapMember)) {
        // get ArcPros built-in Edit Attributes table pane in order to open the pane below the map. Otherwise could open in map tab
        var standardEditPane = FrameworkApplication.Panes.OpenTablePane(placeholderLayerMapMember) as Pane;

        // build my custom pane and open in active pane
        var pane = MyCustomPaneViewModel.Create();

        // opened my custom pane so can close ArcPros Edit Attributes table pane. Unecissary if you want ArcPros Edit Attributes table to stay open
        // open in parallel pane tab, but closing gives the illusion that only my custom pane opened
        standardEditPane.Close();

        // validate pane
        if (pane is null) return;

        // ... do things with my custom pane
    }
}

 

 

Asimov
by
New Contributor III

This really is an unnecessary headache just to achieve something that easy. Clearly a hole in the sdk architecture I would say, since you can always arrange a DockPane "by hand" anchoring it in that position, which is an evidence that there is nothing preventing it: it seems like we just miss a value for the dock attribute in daml (something like "center-bottom"), and I wonder if this is just an oversight or if there is some other reason for the lack of it.

Thanks @jmidtlyng for the workaround provided anyway, at least we have some way to do it.

jmidtlyng
New Contributor II

Wow didn't see your reply was only last Friday. Feel like 2 ppl who happened to wander into the same abandoned building at the same time.

Hopefully someone from Esri can show an official way to access, but from what I can tell that specific zone is called a TablePane and is contained within the inaccessible ArcGIS.Desktop.Editing.Internal.TablePane. If you want to kick the black box around a bit yourself the id is esri_editing_tablePane

jmidtlyng
New Contributor II

Back with an official, non-hack approach to do this. Follow the pro-guide here to use a TOCMapPaneProviderPane class for your custom Pane: https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Map-Pane-Impersonation

Then in the middle of step 2: "Note: Change the value of _dockUnderMapView to true if you want your pane to act like the attribute table pane and dock underneath its "impersonated" map view."

This worked really nicely. Anecdotally we put a custom TableControl in our Pane to build an attribute table with event listeners on highlight.

Not-so-nice alert: Wild a desirable customization seems documented on the fringes under a very confusing class name.

Asimov
by
New Contributor III

Hi @jmidtlyng, that sounds promising and I thank you a lot for sharing, but the link you provided is to the API reference of TOCMapPaneProviderPane Class, can you paste the link to the pro guide content that you mention?

jmidtlyng
New Contributor II

@Asimovthanks for the note. I updated my post so the content relating to step 2 makes sense with the link provided. Jic here's the link again: https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Map-Pane-Impersonation