WPF: Calling a method from a different "branch" of the tree
- by sofri
Hey, I'm doing a WPF Application.
The tree looks like this:
SurfaceWindow --- Startscreen
..........................-------- Page---------- Subpage
I'm trying to call a method from the "Subpage" from the "Code Behind" of the Startscreen(Startscreen.xaml.cs).
The method from the Subpage looks like this:
public void showTheme(ThemeViewModel theme)
{
...
}
If know that I can call it when I'm on the "Page" or the "SurfaceWindow", because it's in the same "branch" of the tree, and I just do something like this:
ThemeViewModel theme = (ThemeViewModel)mvm.CurrentItem.ThemeViewModel;
katalog.katalogblatt.showTheme(theme);
But how do I do it when I'm not on the same branch of the tree and want to call the method?