Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding tabs to tabcontrol from inside a tab
    primarykey
    data
    text
    <p>Well, I have been scratching my head for some time now. But failed to find solution to my problem. What I have is a MainViewModel with and ObservableCollection TabItems. The MainViewModel is set as DataContext for the MainView (User Control) which in turn hosts the TabControl. The tabcontrol is bound to TabItems collection. The Content of the tabcontrol will be ReportItems User Control.</p> <p>This setup is basically for report for reporting UI for SSRS. The first tab contains a list of Reports selecting which would show a few listboxes from where the user would select the Report Parameters. Not after selecting parameters, the user click a button which in turn generates a report and adds a tab to the tab control with the reporthost.</p> <p>The reason I am trying to select the report from a tab and not the Main View is that there are a lot of parameters to be selected and if I add the listboxes to the MainView, the space left for the tabcontrol would be less and the user would need to scroll down to view the reports. </p> <p>I am not sure if my design is flawed but I wanted to figure out a way to add the new ReportItemViewModel to be added to the TabItem collection. That means allowing a child tab to add a sibling by sending a ReportItemViewModel object to MainViewModel and add to the colection.</p> <p>I thought of using a static Collection to do so but that would not call my OnPropertyChange method. Also, having a static method in the MainViewModel does not help as it would not be able to add the object to the collection since the collection is not static.</p> <p>I am not posting any code here since I am stuck at how to begin itself. I looked at another post <a href="https://stackoverflow.com/questions/3064365/adding-tabs-to-tabcontrol-from-inside-usercontrol">here</a> but could not figure out how to use it.</p> <p>Sorry for long description, Just wanted to make the question clear.</p> <p>I am open to any suggestion, also if I can get a better design. I am desperate and any help would be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload