Exemplo n.º 1
0
        public async void OnGridClick(object s, MouseButtonEventArgs e)
        {
            FriendSelectControl fsc = (FriendSelectControl)s;

            if (!isFriendList)
            {
                string id = (string)fsc.Grid.Tag;
                if (!DoesUserExists(id))
                {
                    var user = await KakaoRequestClass.GetProfile(id);

                    ProfileData profileData = new ProfileData()
                    {
                        id = id, name = user.profile.display_name
                    };
                    UserNameWithCloseButton control = new UserNameWithCloseButton();
                    control.TB_Name.Text = user.profile.display_name;
                    profileData.control  = control;
                    control.Margin       = new Thickness(0, 0, 5, 0);
                    control.IC_Close.MouseLeftButtonDown += profileData.Remove;
                    withProfiles.Add(profileData);
                    SP_WithFriends.Children.Add(control);
                    SV_WithFriends.ScrollToRightEnd();
                }
            }
            else
            {
                string         id  = (string)fsc.Grid.Tag;
                TimeLineWindow tlw = new TimeLineWindow(id);
                tlw.Show();
                tlw.Focus();
            }
            e.Handled = true;
        }
Exemplo n.º 2
0
        private void AddTarget(string id, string name)
        {
            reciver = id;
            var fc = new UserNameWithCloseButton();

            fc.TB_Name.Text = name;
            fc.IC_Close.PreviewMouseLeftButtonDown += (s, e2) =>
            {
                SP_Friends.Children.Remove(fc);
                reciver = null;
            };
            SP_Friends.Children.Add(fc);
        }