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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:55:53+00:00 2026-06-17T15:55:53+00:00

I want to bind my TextBlock.Text to ListBox.SelectedItems.Count, but I find that when I

  • 0

I want to bind my TextBlock.Text to ListBox.SelectedItems.Count, but I find that when I multi-select items in my listBox, my TextBlock doesn’t show anything.

I remember this way works in WPF, but it doesn’t work in Windows Store App anymore.

Is there any alternative way to solve the simple problem ?

   <StackPanel>
        <StackPanel.Resources>
            <local:NumberToTextConverter x:Key="NumToText" />
        </StackPanel.Resources>
        <TextBlock Text="{Binding SelectedItems.Count, ElementName=listBox, Mode=TwoWay, Converter={StaticResource NumToText}}"
                   Height="80" />
        <ListBox x:Name="listBox"
                 SelectionMode="Multiple" />
    </StackPanel>

Here is the converter, but it’s not necessary in this case.

internal class NumberToTextConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, string culture)
    {
        if(value != null)
            return ((int)value).ToString();

        return null;
    }

    public object ConvertBack(object value, Type targetType, object parameter, string culture)
    {
        throw new NotImplementedException();
    }

}

I load some data at the entry main of the program.

        List<string> gogoString = new List<string>();

        for (int i = 0; i < 4; i++)
            gogoString.Add(i.ToString());

        listBox.ItemsSource = gogoString;
  • 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-17T15:55:54+00:00Added an answer on June 17, 2026 at 3:55 pm

    Ok, I am late to find the answer.

    The ListBox implements INotifyPropertyChanged in WPF but not in Windows Store app. That’s why I can’t get notified from ListBox.Items.Count or ListBox.SelectedItems.Count in Windows Store app.

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

Sidebar

Related Questions

I want to bind a string value to a text box but only if
I want to bind a textblock text to a property of a static class.
How can I bind a WPF TextBlock to a text file? I want for
It's easy to bind something to the SelectedIndex of the ListBox, but I want
I have a metro app and want to bind a <TextBlock> element to a
I want to bind a function to an event but I want to change
I want to bind the user score to a text box on the windows
I want to bind the titles of the Views to static text's from our
I want to bind the data of the listbox from the two lists collection,
How can I bind 2 properties to a single TextBlock.Text (eg. first name and

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.