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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:23:24+00:00 2026-06-02T19:23:24+00:00

In my app I am building my own media player. When a user selects

  • 0

In my app I am building my own media player. When a user selects a song to play want to be able to pass the link to the sample media and the metadata associated with it (Artist, Track, Album Art, etc.) The part I’m stuck on is how to group all the data and pass it to the media player page. Here’s what i have so far.

Determine what item was selected and add data to query string.

UPDATED

    public void musicSampleSelectedHandler(object sender, RoutedEventArgs e)
    {
        Track selected = (sender as Image).DataContext as Track;
        ListBoxItem pressedItem = this.listReleaseMain.ItemContainerGenerator.ContainerFromItem(selected) as ListBoxItem;
        if (pressedItem != null)
        {
            string _rT = selected.title;
            string _rN = selected.release.name;
            //string _rA = selected.artists; ????
            string _rI = selected.images.large.url;
            string _rS = selected.sampleUrl;

            this.NavigationService.Navigate(new Uri("/Pages/MediaPage.xaml?releaseName=" + _rN + "&releaseTrack=" + _rT + "&releaseImage=" + _rI
                + "&releaseSample=" + _rS, UriKind.Relative));
        }
    }

OnNavigatedTo method to pull data out of the query string

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        base.OnNavigatedTo(e);

        string releaseName = String.Empty;
        string releaseImg = String.Empty;
        string releaseUrl = String.Empty;

        if (NavigationContext.QueryString.TryGetValue("releaseUrl", out releaseUrl))
        {
            sampleMedia.Source = new Uri(releaseUrl, UriKind.Absolute);
        }
    }

I’m not sure if I can use the query sting to pass multiple pieces to the media player, or if I to do something different to pass the data to the other page. All of my data comes from the web using a webclient. Thanks for the help.

  • 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-06-02T19:23:25+00:00Added an answer on June 2, 2026 at 7:23 pm

    QueryString is just a Dictionary of the parameters passed in via the Uri. The Uri uses the standard syntax of passing in parameters delimited by &. So in your example, if you had something like:

    this.NavigationService.Navigate(new Uri("/Pages/MediaPage.xaml?releaseUrl=" + releaseUrl + "&releaseImg=" + releaseImg , UriKind.Relative)); 
    

    then you can then parse this out using something like:

    if (NavigationContext.QueryString.TryGetValue("releaseUrl", out releaseUrl))   
    {   
        sampleMedia.Source = new Uri(releaseUrl, UriKind.Absolute);   
    } 
    
    if (NavigationContext.QueryString.TryGetValue("releaseImg", out releaseImg))   
    {   
        // do something with releaseImg
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building an app where people are able to create their own pages
I'm building an Android app with OpenGL.I created 2 squares, each with their own
I am building an app where I need to allow a user to add
I'm diving into iOS development and am building my own alarm clock app to
Im building my own android app, but im kinda stuck at the login part.
I am building my own web app, and there are open source code out
So I thought I'd have a go at building my own simple app. Please
I'm building a web app and want to enable logging/error tracking. After reading the
I'm building a Django app that will need SSL on all user-facing pages. On
I am building a Non-Document-based cocoa app that I want to behave as follows:

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.