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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:57:57+00:00 2026-05-18T20:57:57+00:00

I have an ItemsControl whose ItemsSource is bound to a list of ints IDs.

  • 0

I have an ItemsControl whose ItemsSource is bound to a list of ints IDs. A converter uses the IDs to look up the name that should be displayed to the user. How can I do this in XAML? Here is what I have so far, but it doesn’t work:

    <ItemsControl ItemsSource="{Binding Topics}">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding FallbackValue='topic name', Converter={StaticResource topicToStrConverter}}" Margin="0,10,0,0"/>
                    <Button>
                        <Image Source="/PlumPudding;component/Images/appbar.cancel.rest.png" />
                    </Button>
                </StackPanel>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>

Really, what I want as an argument to the converter is the entire item that is being displayed in the template – not a property of that item. What is the syntax for this?

I’m using Silverlight 4.

  • 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-18T20:57:58+00:00Added an answer on May 18, 2026 at 8:57 pm

    if Topics is List, then what you have is correct.

    However, if Topics is List, and Id is a property of the Topic class, you will need to use “Path=Id”. So: {Binding FallbakcValue=’Bla’, Path=Id, Converter={StaticResource yourConverter}

    To answer you second question:
    “what I want as an argument to the converter is the entire item that is being displayed in the template – not a property of that item”

    This syntax you are using will pass the entire object in the List, so in your case an int is passed to the converter. Again, if it is a list, then the Topic object is passed to the converter.

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

Sidebar

Related Questions

I have ObservableCollection<Foo> that is bound to an ItemsControl (basically displaying a list). Foo
I have an ItemsControl that is data bound to a list of decimal s.
I have an ItemsControl that is bound to a list of Objects. I have
I have an ItemsControl whose ItemsSource gets bound to an ObservableCollection<Component> at run time.
I have an ItemsControl that is bound to a collection of objects. Each object
I have a WPF ItemsControl who's ItemsSource is bound to an observable collection of
I have a WPF ItemsControl that is bound to an ObservableCollection. The XAML: <ItemsControl
I have an (non-virtualized) ItemsControl that binds its ItemsSource to a ObeservableCollection of ViewModel
I have an ItemsControl that uses a DataTemplate. The DataTemplate contains a TextBox, which
I have an ItemsControl containing a list of data that I would like to

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.