Hy, Can someone tell me how can i find the page parent of an element in Silverlight 4. The element is in a page of a Project2 (is a userControl), and i want to find that page in the codeSource of the ControlElement. The code which i use now is this (this code is in control):
Project1.MainPage pageM = Application.Current.RootVisual as Project1.MainPage;
Page page = pageM.ContentFrame.Content as Page;
TabControl tabControl = page.FindName("tabControl") as TabControl;
But the problem is that i can-t add a reference to Project1 from Project2, because i have a reference to Project2. I need to find the parent because i want to add something in the tabControl from that page.
Here is how i use the control in Project1:
<usrctrl:Menu x:Name="Menu" VerticalAlignment="Top"HorizontalAlignment="Stretch" Margin="5,1,0,0">
Thanks.