Mutually exclusive panes

Add-in Express™ Support Service
That's what is more important than anything else

Mutually exclusive panes
How can I handle the visibility of panes according to the selected e-mail? 
Subscribe
Tibor Vízhányó




Posts: 4
Joined: 2017-03-13
Hi,

In our add-in solution we have a sidebar (which is a RightReadingPane in the explorer and a RightSubPane in the inspectors). This Panes only have a WPF form hosted in an elementhost component. It worked well, until we have been developed another WPF form. This new form we would like to use in case of email composing. The WPF form downloads data from a server which is associated with the currently selected email/recipients etc.

My first solution was that I registered a new Pane in the FormManager than everything worked fine except I cannot automate the panes visibility (in my case the visibility means the RegionState of the pane and the if it enabled or not). Both WPF forms works fine, but there are these Pane chooser arrows which your library shows if 2 pane overlaps, and we don't want that, but only show the correct WPF form.

My issue is I cannot find an event which I can use to show the correct Pane, and hide the other (of course I'm using the ExplorerSelectionChange event but it not works correctly for the first email after starting the Outlook).
I have examined what is wrong and I found the NewExplorer event comes first (here we initialize the class which handles the Pane show/hide logic for that explorer). Then the PaneForm's constructor called, whis I cannot use because the ExplorerObj is not initialized yet. Then the topmost Pane (again we have 2 overlapping Panes simultanously) OnActivate event, where I can get the visibility handler class from the IoC, and subscribe for their event. For The other Pane which not visible I wasn't able to find any events where I can subscribe for the events.

My question is: what is the recommended method to automatically decide and display 2 mutually exclusive Panes.
- 2 panes with its own WPF form,
- 1 pane and somehow changing the elementhost's Child property (this seems a hack for me).

In the first case, what do you suggest which events can I use for the cahnging the visibilty of the Panes?

Thank you.
Tibor
Posted 04 Jun, 2019 07:45:33 Top
Andrei Smolin


Add-in Express team


Posts: 16334
Joined: 2006-05-11
Hello Tibor,

You can prevent a form/pane from being shown by setting ADXOlFrom.Visible=False in the ADXOlForm.ADXBeforeFormShow event. Is this what you are looking for?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 04 Jun, 2019 08:15:33 Top
Tibor Vízhányó




Posts: 4
Joined: 2017-03-13
Hello Andrei,

Thank you for your quick answer. Your suggestion perfectly solved my problem.

Tibor
Posted 06 Jun, 2019 08:45:58 Top
Andrei Smolin


Add-in Express team


Posts: 16334
Joined: 2006-05-11
Welcome!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 06 Jun, 2019 09:12:02 Top