title: Ribbon toggle button getPressed() not being called when expected
body: <p>I've added a custom toggle button to the new email ribbon in outlook 2013. When the button is toggled on, it adds a user property to the mail message.</p>
  
  <pre><code>    public void OnLockButton(Office.IRibbonControl control, bool pressed)
      {
          Outlook.MailItem mi = Globals.ThisAddIn.Application.ActiveInspector().CurrentItem as Outlook.MailItem;
          var userProp = mi.UserProperties.Add("MyIsLocked", Outlook.OlUserPropertyType.olYesNo, false);
          userProp.Value = pressed;
  
          // Make sure we update the ribbon
          ribbon.Invalidate();
      }
  </code></pre>
  
  <p>The 'toggle' state of the button is being updated with a getPressed() callback that checks the state of the user property:</p>
  
  <pre><code>    public bool GetLockButtonPressed(Office.IRibbonControl control)
      {
          Outlook.MailItem mailItem = Globals.ThisAddIn.Application.ActiveInspector().CurrentItem as Outlook.MailItem;
          var userProp = mailItem.UserProperties.Find("NMIsLocked");
  
          bool isLocked = (userProp != null &amp;&amp; userProp.Value);
  
          return isLocked;
      }
  </code></pre>
  
  <p>This is all working just fine.</p>
  
  <p>The problem happens when:</p>
  
  <ol>
  <li>Open a new mail message</li>
  <li>Switch on the toggle button</li>
  <li>Discard the mail message</li>
  <li>Open a new mail message</li>
  </ol>
  
  <p>At this point the toggle button looks like it's switched on on the new mail message even though the user property is not set on that message.</p>
  
  <p>In the debugger I can see that getPressed() is not being called for the new message, so I think that the ribbon button state is just the same as the last time it was drawn.</p>
  
  <p>Some ideas I've had include forcing the ribbon to be invalidated when the mail message is opened (or closed?) Or is there some other way that I've missed?</p>
  
  <p>I'm looking for similar functionality to the 'High Priority' toggle button in Outlook.</p>