This project is read-only.

Subscribe to events of mui:Link-Source

May 15, 2013 at 12:42 PM
Edited May 28, 2013 at 3:40 PM

Problem

I have two ModernWindows with the following Pages implemented inside them with mui:Links in mui:LinkGroups:
  1. Login.xaml
    • Login.xaml
    • CreateLogin.xam
  2. Main.xaml
    • EditLogin.xaml
    • ...
When someone enters valid login information in the Login.xaml page, the event "SuccessfulLogin" is raised in it.

How can I subscribe to that in the Login.xaml window, so it can open Main.xaml and close itself?

My Try

I tried to assign the "Login.xaml" page to the mui:Link-Source in code behind (so I would have a page-object to work with), but I can only assign a URI to a mui:Links source property:
Login login = new Login();
login.SuccessfulLogin += SuccessfulLoginEventHandler;
LLogin.Source = login; // Compiler Error
May 28, 2013 at 3:33 PM
Edited May 28, 2013 at 3:39 PM
Any ideas?

I think I just miss the forest for the trees.
May 29, 2013 at 11:09 PM
You should solve this using a view model. See also this discussion.