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 6356485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:58:19+00:00 2026-05-24T22:58:19+00:00

I have a stack panel with multiple text blocks which are bound to parsed

  • 0

I have a stack panel with multiple text blocks which are bound to parsed results from an XML file.

What I would like to is to make each results have an onlick event which would then link to more information or even a message.show box, but it must use a value from the results it displays.

This is the .Xaml section for the listbox which disaplys the results.)

<ListBox Height="435"
         HorizontalAlignment="Left"
         Name="TradeSearch1"
         VerticalAlignment="Top"
         Width="397"
         Grid.ColumnSpan="3"
         Margin="0,63,0,0">
<ListBox.ItemTemplate>
    <DataTemplate>
        <StackPanel Orientation="Horizontal"
                    Height="200">
            <Image Source="{Binding ImageSource}"
                   Height="150" Width="150"
                   VerticalAlignment="Top"
                   Margin="0,10,8,0"/>
            <StackPanel Width="370" >
                <TextBlock Text="{Binding Title}"
                           TextWrapping="Wrap"
                           Foreground="#FFE51A1A"
                           FontSize="16" />
                <TextBlock Text="{Binding PriceDisplay}" 
                           TextWrapping="Wrap" 
                           FontSize="20" 
                           Foreground="Black" />
                <TextBlock Text="{Binding ListingId}" 
                           TextWrapping="Wrap" 
                           FontSize="20" 
                           Foreground="Black" />
                <TextBlock Text="{Binding Region}" 
                           TextWrapping="Wrap" 
                           FontSize="18" 
                           Foreground="Black" />
            </StackPanel>
        </StackPanel>
    </DataTemplate>
</ListBox.ItemTemplate>

One of the text blocks returns a value for (ListingID). ideally when a user clicks this result they they will be taken to another page which will disaply more results based on the LIstingID form that results.

Listing ID is 400332970

Is there any way to carry that value to another page and use it in something like this? Where ListingID.XMl would be the listingId from the onClick result.

WebClient Trademe = new WebClient();
Trademe.DownloadStringCompleted += new DownloadStringCompletedEventHandler(Trademe_DownloadStringCompleted);
Trademe.DownloadStringAsync(new Uri("http://api.trademe.co.nz/v1/Listings/" + ListingID.xml));

I am sorry if this is confusing, I have tried to explain as best I can. Hopefully someone has an idea of what I am talking about.

  • 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-24T22:58:19+00:00Added an answer on May 24, 2026 at 10:58 pm

    If I understand it correctly, you could use a QueryString to pass the information along to the next page.

    //handle the selectionchanged event (replace 'myObject' with your object type)
    void ListBoxSelectionChanged(object sender, SelectionChangedEventArgs args)
    {
        var lbi = ((sender as ListBox).SelectedItem as myObject);
        if(lbi != null)
        {
            string id = lbi.ListingId.ToString();
            NavigationService.Navigate("/NewPage.xaml?listingid=" + id, UriKind.Relative));    
        }
    }
    

    Then, in your NewPage.xaml page, you can read the value of the query string. (You can add error checks, or use QueryString.TryGetValue instead to avoid exceptions).

    string id = NavigationContext.QueryString["listingid"];
    

    You can use id as part of the download code you posted.

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

Sidebar

Related Questions

I have a listbox that has a datatemplate which contains multiple text boxes. I
I have the following stack panel <StackPanel> <TextBlock Text={Binding AddressLine1} /> <TextBlock Text={Binding AddressLine2}
I have a menu in my WPF application with multiple options which act like
I have stack panel with custom controls in it. I attach standard MouseDragElementBehavior to
I have stack panel with custom controls in it. User can add or remove
I have a stack panel inside of an expander panel that I programaticaly adds
I have created a Treeview and used a stack panel to include a checkbox,
I have a button that is programatically created, it's content is a stack panel
In WPF 3.5 (with SP1), I have simply StackPanel that I would like to
I have ToggleButtons that are dynamically created based on my datasource. I would like

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.