Hi,
I have a project which will use the RibbonView (if I can make it work like I want). I have managed to bind simple business objects to the ribbon and display tabs, groups and buttons including icons, but this is where it stops. My problem is that I am unable to find a good way to attach events to the buttons dynamically. The application has a lot of child views and each of these will have it's own items on the ribbonview. I was hoping that I could have one ribbon view defined in the main view and just bind business objects from the childviews. I was also hoping I could mix items on the ribbon view from both the main view and the active child view so that I don't have to add those "global" items everytime.
What I have done now is that I have one event handler in the datatemplate which handles all events from all buttons on the ribbon. This is a problem as I cannot distinguish them in any way except from looking at the content/text of the buttons, but this seems rather "ugly".
Do you have any good suggestion on how I can dynamically add items to ribbonview for a childview with attached events? Can I achieve this just by binding business objects or do I have to create a viewmodel and a view with a whole RadRibbonView for each separate childview? So far I haven't defined anything in xaml except for the ribbon view itself and the templates. Will this work or must I start defining tabs, groups and buttons so that I can add dedicated events to each of them?
I have looked at the RadRibbonView demo (Paint) you have where business objects are bound to the RibbonView with tabs, groups and buttons including icons, but no events are attached so it doesn't help me anything.
I'm sure there is some easy solution to this as it has to be a common scenario to dynamically populate a ribbon from multiple views. Probably I'm just missing something obvious, but hopefully you can help me with this.
Regards,
Rolf
I have a project which will use the RibbonView (if I can make it work like I want). I have managed to bind simple business objects to the ribbon and display tabs, groups and buttons including icons, but this is where it stops. My problem is that I am unable to find a good way to attach events to the buttons dynamically. The application has a lot of child views and each of these will have it's own items on the ribbonview. I was hoping that I could have one ribbon view defined in the main view and just bind business objects from the childviews. I was also hoping I could mix items on the ribbon view from both the main view and the active child view so that I don't have to add those "global" items everytime.
What I have done now is that I have one event handler in the datatemplate which handles all events from all buttons on the ribbon. This is a problem as I cannot distinguish them in any way except from looking at the content/text of the buttons, but this seems rather "ugly".
Do you have any good suggestion on how I can dynamically add items to ribbonview for a childview with attached events? Can I achieve this just by binding business objects or do I have to create a viewmodel and a view with a whole RadRibbonView for each separate childview? So far I haven't defined anything in xaml except for the ribbon view itself and the templates. Will this work or must I start defining tabs, groups and buttons so that I can add dedicated events to each of them?
I have looked at the RadRibbonView demo (Paint) you have where business objects are bound to the RibbonView with tabs, groups and buttons including icons, but no events are attached so it doesn't help me anything.
I'm sure there is some easy solution to this as it has to be a common scenario to dynamically populate a ribbon from multiple views. Probably I'm just missing something obvious, but hopefully you can help me with this.
Regards,
Rolf