'Synchronise' Form Region State to Ribbon's control

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

'Synchronise' Form Region State to Ribbon's control
Reflecting Form Region State changes to controls on an Inspectors Ribbon 
James Irish




Posts: 6
Joined: 2010-06-17
Hi Guys,

Adx.Net 2010 Standard - Outlook 2007 - Visual Studio 2010

I've working on something very similar to the content of your video demonstration here Outlook Right Subpane

In the demonstration you use three buttons to change the state of the region, my requirement is to use two TOGGLE buttons. i.e.

'Show Status Form' (toggles state between Normal and Hidden)
'Minimise Status Form' (toggles state between Normal and Minimised)

I have been able to hook these toggle buttons up including the disabling of the second button when the form is hidden.

My problem is that the user may click the minimise icon or the close button on the form header itself, thus changing it's state. I am having trouble getting these changes at the form level reflected back to the items on my ribbon control. This is further complicated by the fact that the form is instanced to each inspector window, and therefore 'each ribbon' needs to have it's button state reflected differently.

In traditional VSTO Ribbon XML I could handle the getPressed callback, get the Inspector from Context and the form region for that Inspector, query the forms state and returns true or false to set the toggle state.

How do I achieve the same effect using Add-in Express?

Many Thanks,

James
Posted 30 Aug, 2012 04:39:14 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi James,

You can handle the Activated and Deactivate events of the AddinExpress.OL.ADXOlForm class for getting the RegionState property and to be notified about any changes in the ADXOlForm UI (when it is closed or minimized).

Please be aware that the Ribbon UI is a static thing from its birth. The only possible dynamism is to handle the OnPropertyChanging event of your Ribbon controls. You can read more about this in the Properties and events of Ribbon components section from the online documentation. Please check out the following similar forum threads:

ADX Ribbon Checkbox in Outlook Inspector
How do I change Toggle-Buttons only in the active Inspector
How to set the visiblity of a ribbon button for just the current inspector
Using the new PropertyChanging event

Also you may be interested in the Controlling Outlook region’s state and form’s size in Add-in Express 2010 article on our technical blog.
.NET, Extended MAPI, Windows Phone & RT
Posted 30 Aug, 2012 12:13:47 Top
James Irish




Posts: 6
Joined: 2010-06-17
Eugene,
PropertyChanging was just the thing I was looking for! Problem solved.
Many Thanks,
James
Posted 31 Aug, 2012 03:39:30 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
You are always welcome, James! :-)
.NET, Extended MAPI, Windows Phone & RT
Posted 31 Aug, 2012 03:53:02 Top