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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:50:01+00:00 2026-05-27T06:50:01+00:00

this is my XAML of listbox <ListBox Height=100 Margin=12,12,8,0 Name=CategoriesList VerticalAlignment=Top> <ListBox.ItemTemplate> <DataTemplate> <StackPanel>

  • 0

this is my XAML of listbox

<ListBox Height="100" Margin="12,12,8,0" Name="CategoriesList" VerticalAlignment="Top">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel>
                    <TextBox Text="{Binding Id}" Visibility="Collapsed" />
                    <TextBox Text="{Binding Title}" FontSize="40" IsReadOnly="True"/>
                </StackPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>

this is my class

public class Categories 
{
    string Id { get; set; }
    string Title { get; set; }

    public Categories() { }

    public Categories(string value, string text) 
    {
        this.Id = value;
        this.Title = text;
    }
}

here is the assignment code with dummy data

        List<Categories> categoriesList = new List<Categories>();
        categoriesList.Add(new Categories("1", "One"));
        categoriesList.Add(new Categories("2", "Two"));
        categoriesList.Add(new Categories("3", "Three"));
        categoriesList.Add(new Categories("4", "Four"));
        categoriesList.Add(new Categories("5", "Five"));
        CategoriesList.ItemsSource = categoriesList;

the list is blank but items are 5, that means title is not displayed…can u please help me out

  • 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-27T06:50:01+00:00Added an answer on May 27, 2026 at 6:50 am

    as said by @Ku6opr making variables public made the list running…thanks to him

    public class Categories 
    {
        public string Id { get; set; }
        public string Title { get; set; }
    
        public Categories() { }
    
        public Categories(string value, string text) 
        {
            this.Id = value;
            this.Title = text;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this Xaml inside a ListBox Item Template: <ListBox.ItemTemplate> <DataTemplate> <Grid Height=22
Given this XAML: <StackPanel Orientation=Horizontal Grid.Row=1 Grid.Column=0 Margin=5> How can I assign the Grid.Row
I have a UserControl... XAML: <UserControl x:Name=ClientsListControl ....... > <Grid> <ListBox Margin=10 DisplayMemberPath=Name Name=profilesListBox
This is the xaml of listview <ListView Grid.Column=1 Height=auto Name=ListView1 Width=auto AllowDrop =True >
This XAML makes text fade in when it appears. I would like to put
I'm using this XAML: <Border x:Name=border1 Grid.Row=1> <toolkit:HeaderedContentControl Header=HeaderedContentControl HorizontalContentAlignment=Stretch VerticalContentAlignment=Stretch MaxWidth={Binding ActualWidth, ElementName=border1}
I have this XAML: <Window x:Class=WpfBindToCodeBehind.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=Window1 Height=300 Width=300 Loaded=Window_Loaded> <StackPanel Orientation=Vertical>
I have this Xaml <SolidColorBrush x:Key={x:Static SystemColors.HighlightBrushKey} Value=#123456/> <SolidColorBrush x:Key={x:Static SystemColors.HighlightTextBrushKey} Value=White/> THe first
I have this XAML from a sample: <chart:RadChart.SeriesMappings> <charting:SeriesMapping LegendLabel=Population> <charting:ItemMapping DataPointMember=YValue FieldName=Population />
I desined a button in Blend, which gave me this xaml in after the

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.