Help understanding passing variables between pages

Oct 17, 2013 at 10:31 AM
Edited Oct 17, 2013 at 10:32 AM
Using codebehind I can pass the parent window to the child using the code below
//Parent Window
new LoginWindow(this).ShowDialog();

//Child Window
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
    m_parentWindow = Window.GetWindow(this);
 }
However, I'm not sure how this should work using just mui XAML? For instance if I have
    <mui:ModernWindow.MenuLinkGroups>
        <mui:LinkGroup DisplayName="main" >
            <mui:LinkGroup.Links>
                <mui:Link DisplayName="Data" Source="/Pages/MainStart.xaml" />
                <mui:Link DisplayName="settings" Source="/Pages/MainSettings.xaml" />
            </mui:LinkGroup.Links>
        </mui:LinkGroup>
    </mui:ModernWindow.MenuLinkGroups>
    </mui:ModernWindow>
Then in /Pages/MainStart.xaml.cs I can get the main window by using
        private MainWindow m_mainform;

        public MainStart()
        {
            InitializeComponent();
            m_mainform = (MainWindow)Application.Current.MainWindow;
        }
but this seems a bit wrong. What is the correct method in mui to access parent windows. Can this be done through XAML only?