Example #1
0
        public void SignIn()
        {
            signedIn        = true;
            currProfilePage = new ProfilePage(this, currUser);
            currProfilePage.SetParent(this);
            // DONE: Make logo go to following page.
            // DONE: Make visible the following and saved page.
            followingTab.Visibility = Visibility.Visible;
            savedTab.Visibility     = Visibility.Visible;
            // Post photo and post discussion work.
            // DONE: Show message icon.
            messageButton.Visibility = Visibility.Visible;
            // DONE: Show notification icon.
            notificationsButton.Visibility = Visibility.Visible;
            // DONE: Show your profile button.
            profileButton.Visibility = Visibility.Visible;
            // DONE: Show user settings button.
            userSettingButton.Visibility = Visibility.Visible;
            // DONE: logoutButton => logoutButton
            logoutButton.Content = "Logout";
            // DONE: Navigate user to FollowingPage:
            currFollowingPage      = new FollowingPage(this, followingSomeone);
            contentControl.Content = currFollowingPage;
            HighlightTab();

            // In other classes.
            // DONE: In PhotoPopup, interaction normal.
            // DONE: In DiscussionPopup, interaction normal.
            // DONE: In Photo, interaction normal.
            // DONE: In Discussion, interaction normal.
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            contentControl.Content = currPhotosPage;
            HighlightTab();
            //PhotosTab.Foreground = new SolidColorBrush(Color.FromRgb(116, 118, 119));

            FillNotificationMenu();
            FillMessageNotificationMenu();

            currDiscussionPage.SetParent(this);
            currPhotosPage.SetParent(this);
            currPhotosPage.SortByPopular();

            currFollowingPage = new FollowingPage(this, followingSomeone);
            currSavedPage     = new SavedPage(this);

            currMessagesPage = new MessagesPage(this);

            SignOut();
        }
Example #3
0
 protected void Button_Click(Object sender, EventArgs e)
 {
     if ((sender.Equals(followingTab)) || (sender.Equals(logoButton)))
     {
         if (signedIn)
         {
             currFollowingPage      = new FollowingPage(this, followingSomeone);
             contentControl.Content = currFollowingPage;
             HighlightTab();
         }
         else
         {
             contentControl.Content = currPhotosPage;
             HighlightTab();
         }
     }
     else if (sender.Equals(photosTab))
     {
         contentControl.Content = currPhotosPage;
         currPhotosPage.SortByPopular();
         HighlightTab();
     }
     else if (sender.Equals(discussionsTab))
     {
         contentControl.Content = currDiscussionPage;
         currDiscussionPage.SortByMostCommented();
         HighlightTab();
     }
     else if (sender.Equals(savedTab))
     {
         contentControl.Content = currSavedPage;
         HighlightTab();
     }
     else if (sender.Equals(postButton))
     {
         postButtonDropdown.IsOpen = !postButtonDropdown.IsOpen;
     }
     else if (sender.Equals(notificationsButton))
     {
         notificationsButtonDropdown.IsOpen = !notificationsButtonDropdown.IsOpen;
     }
     else if (sender.Equals(messageButton))
     {
         messagesButtonDropdown.IsOpen = !messagesButtonDropdown.IsOpen;
     }
     else if (sender.Equals(accountButton))
     {
         accountButtonDropdown.IsOpen = !accountButtonDropdown.IsOpen;
     }
     else if (sender.Equals(profileButton))
     {
         accountButtonDropdown.IsOpen = false;
         currProfilePage        = new ProfilePage(this, currUser);
         contentControl.Content = currProfilePage;
         HighlightTab();
     }
     else if (sender.Equals(userSettingButton))
     {
         accountButtonDropdown.IsOpen = false;
         contentControl.Content       = new UserSettings(this, currUser);
         HighlightTab();
     }
     else if (sender.Equals(logoutButton))
     {
         //LogoutPromptPopup popup = new LogoutPromptPopup(this);
         //popup.ShowDialog();
         //contentControl.Content = new LoginPage();
         //HighlightTab();
         if (!signedIn)
         {
             accountButtonDropdown.IsOpen = false;
             contentControl.Content       = new LoginPage(this);
             HighlightTab();
         }
         else if (signedIn)
         {
             accountButtonDropdown.IsOpen = false;
             LogoutPromptPopup popup = new LogoutPromptPopup(this);
             popup.ShowDialog();
         }
     }
     else if (sender.Equals(seeAllMessagesButton))
     {
         contentControl.Content        = currMessagesPage;
         messagesButtonDropdown.IsOpen = false;
         HighlightTab();
     }
     else if (sender.Equals(postPhotoButton))
     {
         if (signedIn)
         {
             postButtonDropdown.IsOpen = false;
             PostPhotoPopup photoPopup = new PostPhotoPopup(this);
             photoPopup.SetValue(Grid.RowProperty, 2);
             photoPopup.SetValue(Grid.ColumnSpanProperty, 3);
             mainGrid.Children.Add(photoPopup);
         }
         else if (!signedIn)
         {
             LoginPrompt prompt = new LoginPrompt(this);
             prompt.SetMessage("You must sign in to create posts.");
             prompt.ShowDialog();
             HighlightTab();
         }
     }
     else if (sender.Equals(postDiscussionButton))
     {
         if (signedIn)
         {
             postButtonDropdown.IsOpen = false;
             PostDiscussionPopup discussionPopup = new PostDiscussionPopup(this);
             discussionPopup.SetValue(Grid.RowProperty, 2);
             discussionPopup.SetValue(Grid.ColumnSpanProperty, 3);
             mainGrid.Children.Add(discussionPopup);
         }
         else if (!signedIn)
         {
             LoginPrompt prompt = new LoginPrompt(this);
             prompt.SetMessage("You must sign in to create posts.");
             prompt.ShowDialog();
             HighlightTab();
         }
     }
 }