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

  • Home
  • SEARCH
  • 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 6634017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:52:50+00:00 2026-05-25T22:52:50+00:00

I have a listbox which uses the following template to bind a list of

  • 0

I have a listbox which uses the following template to bind a list of clips. I would like to pull one of those clips at random and have it play. That is the easy part and is pretty straight forward. I would then like to make an associated image visible. I can’t seem to find out how to get the controls associated with the index in the listbox. Any ideas.

`

            <StackPanel Margin="0,0,0,12" Width="420">
                <Button Click="Button_Click" Background="{StaticResource PhoneAccentBrush}" 
                        Height="90" Width="420" x:Name="btn">
                    <StackPanel Orientation="Horizontal" >
                        <Image x:Name="Selected" Width="75" Source="Images/Playing.png" Visibility="Collapsed" />
                        <TextBlock Text="{Binding Name}" TextWrapping="NoWrap" Width="330" VerticalAlignment="Center"
                                   Style="{StaticResource PhoneTextLargeStyle}" />
                    </StackPanel>
                </Button>
            </StackPanel>
    </DataTemplate>

`

  • 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-25T22:52:51+00:00Added an answer on May 25, 2026 at 10:52 pm

    This is a ListBox so have a list of objects bound to its ItemsSource. Add a new “NowPlaying” property to the class of these objects. Bind this property to the Visibility property of the “Selected” Image via a BoolToValueConverter

    Now you just toggle that new property and need not delve in the Visual Tree to do what the binding system should be doing for you

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

Sidebar

Related Questions

I have a ListBox which uses a DataTemplate to render databound items. The XAML
I have a ListBox which is populated from a collection of ViewModels, which uses
I have a listbox which acts as a list of items. If you click
So, I have a ListBox which is bound to a list of business objects,
We have a function which accesses two types of controls like button and list
I have a listbox which has all the names for a list of Gesture
I have a Listbox which contain a list of files . can i access
I have one ListBox which has three Items in it. And also has one
I have a ListBox which is bound to an instance of a list of
I have a ListBox which hold a set of objects (linked via ItemsSource bind

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.