ARTICLE AD BOX
I am trying to add a new Xaml element (in this case a Tab) that is done programmatically and not through Xaml directly. The trick is, the class that is meant to add the new tab, is going to be referenced between different areas, and ultimately end up adding a new tab to the MainPage's tab view.
The idea is it looks something like this:
MainPage has a TabView element set up ready to accept new tabs. Let's call it TabViewElement
Class 1 does something and prepares data, which is sent to Class 2
Class 2 actually programmatically creates the new tab based on data
Class 2 then adds this new tab, to the tabview section of MainPage.
Since I cannot simply go : TabViewElement.Items.Add(newTab) in Class 2 to add elements to MainPage, what would be the proper way?
The only way I can assume, is to have a method that gets called by Class 1 in MainPage, and that Method then calls Class 2 to create a new tab, gets the newTab back, and adds it to TabViewElements on the level of MainPage.
This seems like the wrong way to go about doing it to me though.
