Hi there,
I've got a .NET add-in that dynamically add a tab to the Ribbon in Microstation.
So far, so good. When I start Microstation and open a file, my tab is here.
However, if the user changes the workflow, obviously, the ribbon is completely changed and then my extra tab goes away.
I couldn't find anything about any event I can handle to know when the workflow changes so that I can set my tab back in the new ribbon....
Any idea?
PS: I know it's been asked a lot already but Bentley, when will there be some proper examples?
Hi Francois,
Francois Dauberlieu said:I've got a .NET add-in that dynamically add a tab to the Ribbon in Microstation.
Personally I am not sure, because I do not see any reason, why to add a tab to ribbon programatically. But maybe I have not met such situation yet ;-)
I do not know specific requirements, but when the tab is static, why to do not defined it in XML (compiled into RSC optionally). I think (even though I did not test it) it's possible to define it in such way it's displayed in more workflows.
Francois Dauberlieu said:I couldn't find anything about any event I can handle to know when the workflow changes so that I can set my tab back in the new ribbon....
What about SYNCITEM_SessionEvent_RibbonWorkflowChanged?
Francois Dauberlieu said:I know it's been asked a lot already but Bentley, when will there be some proper examples?
In my opinion the standard way, how to defined ribbon, using XML (including optional extension using providers) is well documented in MicroStation API documentation.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Francois Dauberlieu,
If you have/own a Telerik development license you can freely consume Telerik APIs and Events published within your (deployed) customizations.
If you do not have/own a Telerik development license then you will need to use the convenient User/Admin tools and workflows our software provides (See: Customizing the Ribbon and Importing and Exporting Ribbon Customizations). Due to Bentley's licensing agreement we cannot create/provide (public/published) Bentley APIs that wrap or export this functionality directly.
HTH,Bob
Jan,
Actually, my tab content is dynamic. I connect to a database which tells me what commands are available for the current drawing
I'll lookinto the SYNCITEM_SessionEvent_RibbonWorkflowChanged
Thanks
Regards,
____________________
Francois Dauberlieu
BTM Software Europe B.V.
http://www.btmsoftware.com
I'd be happy to use the importing the ribbon customization BUT my issue is not as much customizing the ribbon itself, it is to find out when the workflow has changed (thus changing the whole ribbon) so I could potentially update the XML and reload it
Francois Dauberlieu said:so I could potentially update the XML and reload it
This is quite costly operation.
Ribbon controls support feature aspect and show expression definitions, that in cooperation with SyncItemEvent allows to dynamically define what controls are displayed or enabled. These ribbon changes do not require to rebuild XML definition, so they are fast.
Yes, I should have included that the minimal Ribbon related items in the SDK do provide some event and resource options as per below that you can freely use w/o concern to needing a Telerik license for development purposes.
HTH,Bob.
Francois Dauberlieu said:Actually, my tab content is dynamic
"How much" is it dynamic? Ribbon in general is not well designed to be used to display any information.
Francois Dauberlieu said:I connect to a database which tells me what commands are available for the current drawing
By "command" you mean standard DB commans like query, post/commit etc? It sounds more like a request to display some from several different combinations (buttons or labels).
dynamic in the sense that some icons should be visible/hidden depending on what my database says
By command, I mean commands implemented by my addin
Thanks Bob
Now, I just have to see how I can use that in a C# addin ;-)
Francois Dauberlieu said:dynamic in the sense that some icons should be visible/hidden depending on what my database says
I think it is exactly the workflow supported by MicroStation ribbon by default, with no need to create any control (button, tab, workflow...) using code: