Пример #1
0
        private void image_Icon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            DirectMessageItem target = ((sender as Image).TemplatedParent as ContentPresenter).Content as DirectMessageItem;

            if (target == null)
            {
                return;
            }

            long           id = (long)target.UserData.Id;
            UserInfoWindow w  = new UserInfoWindow(this.account, id);

            w.Owner = this.main;
            w.Show();
        }
Пример #2
0
        private void listBox_UserList_Item_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            ListBoxItem selectedItem = sender as ListBoxItem;

            if (selectedItem == null)
            {
                return;
            }

            UserListItem target = selectedItem.Content as UserListItem;

            if (target == null)
            {
                return;
            }

            if (this.mode == UserListMode.Account)
            {
                if (e.ClickCount != 2)
                {
                    return;
                }

                AccountManager am = AccountManager.GetInstance();
                am.SetCurrentIndexFromScreenName(target.ScreenName);

                this.main.ChangeAccount();
                this.parent.Close();
                e.Handled = true;
                return;
            }

            long           id = (long)target.Id;
            UserInfoWindow w  = new UserInfoWindow(this.account, id);

            w.Owner = this.main;
            w.Show();

            e.Handled = true;
        }