Question : Access user control function from master page

Using silverlight 4, but still using a page switcher as the holder for the largest user control.  On the main page is Master.xaml.  Master holds a menu control, the main control which populates the switcher, and a footer user control.

My problem is how do I can't figure out how to use the selected item on the toolbar to call the functions on the current user control in the page switcher.

 

In XAML on the master pager, my page switcher is defined as:
1:
2:
3:
4:
 <Liquid:MainMenu x:Name="mainMenu" ItemSelected="mainMenu_ItemSelected" BorderBrush="{StaticResource boarder_10}" BorderThickness="1" Background="{StaticResource btnTextColor_10}" Canvas.Top="-37">

 <local:PageSwitcher x:Name="PageSW" Height="801" Width="1203" />


 

In the code behind we switch the page using:

1:
2:
3:
4:
5:
 PageSwitcher ps;

ps.Navigate(new ProjectsPage());

 


Now I have the projects page loaded when I attempt Save a project I call:


   
1:
2:
3:
4:
5:
6:
7:
    private void mainMenu_ItemSelected(object sender, Liquid.MenuEventArgs e)
        {
            switch (e.Tag.ToString())
            {
                case "Save":
                    saveRoutine();
                    break;

 Now in my Save Routine I want to call the SaveProject function on the ProjectsPage:

1:
2:
3:
4:
5:
6:
7:
8:
        void saveRoutine()
        {
            MessageBox.Show("Save button was pressed!");
            switch (CurrentPage)
            {
                case "Project":
                    
                    break;

 

 

This is where I'm lost, can't figure how to call into PageSW which is currently a ProjectsPage, but may be one of the other pages.

 

-Lester

Answer : Access user control function from master page

Random Solutions  
 
programming4us programming4us