public bool CanLoad(Uri targetUri, Uri currentUri) { if (!WebContext.Current.User.IsAuthenticated) { if (System.IO.Path.GetDirectoryName(targetUri.ToString()).Trim('\\') == SecuredFolder) { var winLogin = new LoginRegistrationWindow(); winLogin.targetUri = targetUri; winLogin.Show(); return(false); } } return(loader.CanLoad(targetUri, currentUri)); }
/// <summary> /// This method forces the user to login if she has not already logged in /// </summary> /// <param name="uri"></param> public void LoginAndGoHome() { if (WebContext.Current.User.IsAuthenticated == false) { LoginRegistrationWindow loginRegistrationWindow = new LoginRegistrationWindow(); loginRegistrationWindow.Closed += (s, e) => { if (WebContext.Current.User.IsAuthenticated) { SetMenu(); GoHome(); } }; loginRegistrationWindow.Show(); } }