示例#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;
        }
        public UserInfoWindow(List <string> ids)
        {
            InitializeComponent();

            if (!Properties.Settings.Default.HideScrollBar)
            {
                SV_Main.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            }

            Dispatcher.Invoke(async() =>
            {
                List <ProfileData.Profile> profiles = new List <ProfileData.Profile>();
                foreach (string id in ids)
                {
                    var user = await KakaoRequestClass.GetProfile(id);
                    profiles.Add(user.profile);
                }
                AddProfile(profiles);
            });
        }