I have a TabControl with TabPage1 and TabPage2,
In TabPage1, there is another TabControl1 with 2 Items TabPage11 and TabPage12.
In TabPage2, there is another TabControl2 with 2 Items TabPage21 and TabPage22.
Each item (TabPage11 , TabPage12, TabPage21 and TabPage22) has its own View (in form of UserControl) and ViewModel. there is dataGrid on each View.
Now I want to implement ExportToExcel function for each dataGrid. I can put a ExportToExcel Button on each tabItem, but it does not look good. So I put one button on main window so when user clicks the button, the dataGrid on selected tabItem get processed.
The problem is that the button on the mainWindow does't know how to tell the
ViewModel of selected tabItem to export it.
Any Suggestions? Thanks in advance! Steve