コード例 #1
0
        private void PersonsWhoDislike(object sender, RoutedEventArgs e)
        {
            ListOfPersonsWindow main = new ListOfPersonsWindow(postServices.GetPersonsWhoDisLiked(currentPost.Id))
            {
                WindowStartupLocation = WindowStartupLocation.CenterScreen
            };

            main.ShowDialog();
        }
コード例 #2
0
        private void ViewFollowers(object sender, RoutedEventArgs e)
        {
            ListOfPersonsWindow main = new ListOfPersonsWindow(services.GetFollowers())
            {
                WindowStartupLocation = WindowStartupLocation.CenterScreen
            };

            main.ShowDialog();
        }
コード例 #3
0
        private void ViewFollowers(object sender, RoutedEventArgs e)
        {
            ListOfPersonsWindow main = new ListOfPersonsWindow(repository.GetFollowers(user.NickName))
            {
                WindowStartupLocation = WindowStartupLocation.CenterScreen
            };

            main.ShowDialog();
        }
コード例 #4
0
        private void ViewConnection(object sender, RoutedEventArgs e)
        {
            var temp = services.GetConnectingPaths(PersonNickName);

            if (temp != null && temp.Count > 0)
            {
                ListOfPersonsWindow window = new ListOfPersonsWindow(services.GetConnectingPaths(PersonNickName));
                window.Show();
            }
        }
コード例 #5
0
        private void CommonFriends(object sender, RoutedEventArgs e)
        {
            var temp = services.GetCommonFriends(PersonNickName);

            if (temp != null && temp.Count > 0)
            {
                ListOfPersonsWindow window = new ListOfPersonsWindow(temp);
                window.Show();
            }
            else
            {
                MessageWindow window = new MessageWindow("No comon friends");
                window.Show();
            }
        }
コード例 #6
0
        public ucFriendConection()
        {
            InitializeComponent();
            services = new UserServices();
            List <Person> users = new List <Person>();

            users = services.GetFriendsOfFriend();
            if (users != null && users.Count > 0)
            {
                foreach (var user in users)
                {
                    Grid grid = new Grid();
                    grid.Margin = new Thickness(0, 5, 0, 5);
                    Label lblInformation = new Label();
                    lblInformation.Content    = user.Name + "  " + user.Surname + "\n" + user.Mail + "\n" + user.NickName;
                    lblInformation.Background = Brushes.White;
                    lblInformation.FontFamily = new FontFamily("Nirmala UI Semilight");
                    lblInformation.FontSize   = 16;
                    lblInformation.FontWeight = FontWeights.Normal;
                    lblInformation.Padding    = new Thickness(5, 10, 5, 10);


                    Button btnFollow = new Button();
                    //btnEdit.Content = MaterialDesignThemes.Wpf.PackIconKind.EditOff;
                    btnFollow.Content = "Follow";
                    btnFollow.Click  += btnFollow_Click;
                    btnFollow.Width   = 150;
                    btnFollow.Margin  = new Thickness(150, 40, 0, 0);

                    Button btnViewProfile = new Button();
                    btnViewProfile.Content = "View profile";
                    btnViewProfile.Click  += btnViewProfile_Click;
                    btnViewProfile.Width   = 150;
                    btnViewProfile.Margin  = new Thickness(150, 0, 0, 40);


                    Button btnPath = new Button();
                    btnPath.Content = "View path";
                    btnPath.Click  += btnPath_Click;
                    btnPath.Width   = 150;
                    btnPath.Margin  = new Thickness(500, 0, 0, 0);

                    grid.Children.Add(lblInformation);
                    grid.Children.Add(btnFollow);
                    grid.Children.Add(btnViewProfile);

                    grid.Children.Add(btnPath);

                    this.stackpanel.Children.Add(grid);


                    void btnFollow_Click(object sender, RoutedEventArgs e)
                    {
                        services.AddFollowing(services.NickNameRead(), user.NickName);
                    }

                    void btnViewProfile_Click(object sender, RoutedEventArgs e)
                    {
                        PersonInfo info = new PersonInfo(user.NickName);

                        info.Show();
                    }

                    void btnPath_Click(object sender, RoutedEventArgs e)
                    {
                        ListOfPersonsWindow window = new ListOfPersonsWindow(services.GetConnectingPaths(user.NickName));

                        window.Show();
                    }
                }
            }
            else
            {
                Label lblInformation = new Label();
                lblInformation.Content             = "No Recomendation";
                lblInformation.FontSize            = 44;
                lblInformation.VerticalAlignment   = VerticalAlignment.Center;
                lblInformation.HorizontalAlignment = HorizontalAlignment.Center;
                this.stackpanel.Children.Add(lblInformation);
            }
        }