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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:34:49+00:00 2026-05-26T16:34:49+00:00

I want to bind the data of the listbox from the two lists collection,

  • 0

I want to bind the data of the listbox from the two lists collection, Here’s my scnerio

I have two list as give below

public List<TipSync.TipCategories> tipCategories;

    public List<TipSync.TipCategories> TipCategories
    {
        get
        {
            return tipCategories;
        }
        set
        {
            tipCategories = value;
            NotifyPropertyChanged("TipCategories");
        }
    }

    public List<TipSync.CategorySubscribed> categorySubscribed;

    public List<TipSync.CategorySunscribed> CategorySubscribed
    {
        get
        {
            return tips;
        }
        set
        {
            categorySubscribed = value;
            NotifyPropertyChanged("Tips");
        }
    }

and I have a listbox with a textblock and a button, listbox.itemsource is set to Tipcategories

<ListBox x:Name="TipCategoriesLB" Height="449" HorizontalAlignment="Left" Margin="5,49,0,0" VerticalAlignment="Top" Width="410" SelectionChanged="TipCategoriesLB_SelectionChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding CategoryName}"/>
                                <Button Name="SubscribeBtn" Content="" Tap="Subscribe_Tap"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>

Now if the CategorySubscribed list contains an item with the value of TipCategory.CategoryID, I want to display “Subscribed” in the content of the button, otherwise Unsubscribed. How do I do this?

  • 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-26T16:34:49+00:00Added an answer on May 26, 2026 at 4:34 pm

    Nawaz,

    Not exactly the answer you were looking for; but lemme ask you this .. Why not just add a flag to each object in the TipCategories list, that indicates whether it is subscribed or not? This could be manipulated in code for each category as the subscription/unsubscription happens. The advantage of such a technique is going to be easier data binding .. you could have the Button’s Content property be bound to this flag to make the button say one thing vs other & take appropriate action if the user clicks on it.

    How do you feel about this?

    Thanks!

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

Sidebar

Related Questions

I have ListBox data bind to list of users (collection): usersListBox.DataSource = null; usersListBox.DataSource
I have one Listbox and a List of data I want to bind the
I have an ObservableCollection<Object> that contains two different types. I want to bind this
I have this code I want to bind data to grid view without using
I want to selectively bind data in a collection to different UI elements. For
I have a public property in my code-behind that I want to bind it
I have a project where we are loading a multi-select listbox from a collection
How to bind data to two columns listbox like this: | Item1 | Item2
I have two controls: list box text box The list box binds its data
I would like to bind data of my listbox. Imagine I have something 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.