示例#1
0
        async void Main_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (Main.SelectedIndex)
            {
            case 1:      // друзья
                friendProgress.IsIndeterminate = true;
                friends = await client.userGetFriends(auth.UserName);

                friendsList.ItemsSource = friends;
                if (friends.Count == 0)
                {
                    MessageBox.Show("У тебя нет друзей :(");
                }
                friendProgress.IsIndeterminate = false;
                break;

            case 2:      // рупор
                ruporProgress.IsIndeterminate = true;
                try
                {
                    shouts = await client.userGetShouts(auth.UserName);

                    ruporList.ItemsSource = shouts;
                }
                catch (NullReferenceException err)
                {
                    MessageBox.Show("Empty!");
                    Console.Write(err.StackTrace);
                }
                //if (shouts.Count == 0) MessageBox.Show("Empty!");
                ruporProgress.IsIndeterminate = false;
                break;
            }
        }
示例#2
0
        async void Friend_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (FriendPanorama.SelectedIndex)
            {
            case 0:
                profileProgress.IsIndeterminate = true;
                NameBlock.Text     = friend.Name;
                RealNameBlock.Text = friend.RealName;
                UserImg.Source     = new BitmapImage(new Uri(friend.ImgMedium, UriKind.RelativeOrAbsolute));
                friends            = await client.userGetFriends(friend.Name);

                profileProgress.IsIndeterminate = false;
                FriendBlock.Content             = "Друзей: " + friends.Count;
                break;

            case 1:      // рупор
                ruporProgress.IsIndeterminate = true;
                try
                {
                    shouts = await client.userGetShouts(friend.Name);

                    ruporList.ItemsSource = shouts;
                }
                catch (NullReferenceException err)
                {
                    Console.Write(err.StackTrace);
                }
                if (shouts.Count == 0)
                {
                    MessageBox.Show("Этому пользователю никто не пишет :(");
                }
                ruporProgress.IsIndeterminate = false;
                break;

            case 2:      // друзья
                friendProgress.IsIndeterminate = true;
                friends = await client.userGetFriends(friend.Name);

                friendsList.ItemsSource = friends;
                if (friends.Count == 0)
                {
                    MessageBox.Show("У этого пользователя нет друзей :(");
                }
                friendProgress.IsIndeterminate = false;
                break;
            }
        }