I have a boolean property Settings.Default.MarkAsRead
in the Setting.settings file, which I can access in my Ribbon class. What I\'d like to do is set the value
I didn't find a way to access the xml elements from the Ribbon_Load
method, so I've created a boolean property in the ribbon class that I update using the GetPressed
and OnAction
callbacks:
xml:
<checkBox id="markAsRead" label="Mark as read"
onAction="markAsRead_OnAction" getPressed="markAsRead_GetPressed"/>
c#:
private bool MarkAsRead { get; set; }
public bool markAsRead_GetPressed(Office.IRibbonControl control)
{
this.MarkAsRead = Settings.Default.MarkAsRead;
return this.MarkAsRead;
}
public void markAsRead_OnAction(Office.IRibbonControl control, bool isPressed)
{
this.MarkAsRead = isPressed;
}