示例#1
0
        private void OnUserAuthenticated(object sender, AuthenticationEventArgs e)
        {
            UserDto user = e.User;

            ((App)Application.Current).User = user;
            NotesApi.SetToken(user.Token);

            //Label_LoginDebug.Content = string.Format("Logged in as {0}", user.Name);
            //Label_LoginDebug.Visibility = Visibility.Visible;

            //Button_Register.Visibility = Visibility.Collapsed;
            //Button_Login.Visibility = Visibility.Collapsed;

            DashboardViewModel dashboardModel = new DashboardViewModel
            {
                Organizations = new List <OrganizationDto>(),
                Projects      = new List <ProjectDto>(),
                UserNotes     = new List <NoteDto>()
            };

            Home.Grid_NoUser.Visibility   = Visibility.Collapsed;
            Home.Grid_WithUser.Visibility = Visibility.Visible;

            AccountMenu.Login.Visibility    = Visibility.Collapsed;
            AccountMenu.Register.Visibility = Visibility.Collapsed;

            AccountMenu.User.Visibility = Visibility.Visible;

            Dashboard = new DashboardView();
            //MainGrid.Children.Add(Dashboard);
            //MainWindowControls.Visibility = Visibility.Collapsed;
        }
示例#2
0
        private void OnUserLogout(object sender, EventArgs e)
        {
            ((App)Application.Current).User = null;
            NotesApi.SetToken(null);

            AccountMenu.Login.Visibility    = Visibility.Visible;
            AccountMenu.Register.Visibility = Visibility.Visible;

            AccountMenu.User.Visibility = Visibility.Collapsed;

            //MainGrid.Children.Add(Dashboard);
            //MainWindowControls.Visibility = Visibility.Collapsed;
        }