Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 284079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:25:40+00:00 2026-05-12T05:25:40+00:00

I have worked through the answer provided here . I have been able to

  • 0

I have worked through the answer provided here. I have been able to create a list of automatically generated Hyperlink buttons in a ListBox. The goal is that, when a different user is typed into the box and the button is clicked, they old artists are removed (assuming it’s a valid username) and replaced with the artists from the new last.fm user. However, now this line does not work:

ArtistsList.Items.Clear();

Is this only for text? If so, does anybody know another way to remove the hyperlink buttons once the Go! button has been clicked again? I’ll provide what I believe to be the pertinent page.xaml.cs code if that will help.

            if (uname.Text != String.Empty && uname.Text != "Try Another One!")
            {
                App app = (App)Application.Current;
                app.UserName = uname.Text;
                String getTopArtists = "http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=" + app.UserName + "&api_key=d2d620af554a60f228faed8d502c4936";
                WebClient web = new WebClient();
                WebClient client = new WebClient();
                client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(DownloadStringCompleted);
                client.DownloadStringAsync(new Uri(getTopArtists));
            }

This is what the HyperlinkButton looks like in the page.xaml code:

<ListBox FontFamily="Calibri" HorizontalAlignment="Center" VerticalAlignment="Center" Width="200" Height="200" Margin="50,140,50,50" x:Name="ArtistsList" Foreground="Crimson">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <StackPanel>
                <HyperlinkButton Content="{Binding Name}" NavigateUri="{Binding Amazon}" TargetName="_blank" Width="173.5" Foreground="Crimson"></HyperlinkButton>
            </StackPanel>
         </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

I believe this is all of the necessary code to answer the question. If not, I can provide more.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:25:40+00:00Added an answer on May 12, 2026 at 5:25 am

    instead of using ArtistsList.Items.Clear();
    just try
    ArtistsList.ItemsSource=null;
    ArtistsList.ItemsSource = [newlistsource].
    If you do not understand please reply

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched through similar questions on here, and cannot find an exact answer.
I have an Java applet that loads native code through JNI. Everything worked just
First, my question might sound like a duplicate, but I have been going through
I've started using Project Euler to improve my objective-c coding and have worked through
I have been looking for an answer for how to execute a java jar
I have been trying to create a Class for my OpenGL ES 2.0 +
I'm newer to Objective-C though I have worked in Java, C, and C++ and
I have worked on generating PDF about 3 years ago and used FPDF lib
i have worked for a year now , on server side applications and everytime
I have worked with Apache before, so I am aware that the default public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.