protected void OnOpenLoginWindow(object sender, InteractionEventArgs args)
        {
            try
            {
                LoginWindow loginWindow    = viewLocator.LoadWindow <LoginWindow>(this.WindowManager, "UI/Logins/Login");
                var         callback       = args.Callback;
                var         loginViewModel = args.Context;

                if (callback != null)
                {
                    EventHandler handler = null;
                    handler = (window, e) =>
                    {
                        loginWindow.OnDismissed -= handler;
                        if (callback != null)
                        {
                            callback();
                        }
                    };
                    loginWindow.OnDismissed += handler;
                }

                loginWindow.SetDataContext(loginViewModel);
                loginWindow.Create();
                loginWindow.Show();
            }
            catch (Exception e)
            {
                if (log.IsWarnEnabled)
                {
                    log.Warn(e);
                }
            }
        }
Esempio n. 2
0
 protected void OpenLoginWindow()
 {
     try
     {
         this.command.Enabled = false;
         LoginWindow loginWindow = viewLocator.LoadWindow <LoginWindow>(this.WindowManager, "UI/Logins/Login");
         loginWindow.OnLoginFinished += OnLoginFinished;
         loginWindow.Create();
         loginWindow.Show();
     }
     catch (Exception e)
     {
         if (log.IsWarnEnabled)
         {
             log.Warn(e.StackTrace);
         }
     }
 }