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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:31:13+00:00 2026-06-05T02:31:13+00:00

I cannot find an answer I can work with for this problem. I have

  • 0

I cannot find an answer I can work with for this problem.
I have an ObservableCollection

this is myClass:

public class myClass
    {
      public string name;
      public int[] dimensions = new int[2];
    }

This is the code that sets ObservableCollection:

public class roomBuilder
{
  private ObservableCollection<myClass> rooms;

      public roomBuilder() //constructor
      {
        string roomName;
        int[] dimensions = new int[2];
        myClass newRoom = new myClass();
        rooms = new ObservableCollection<room>();
        roomName = "Hall";
        dimensions[0] = 10;
        dimensions[1] = 12;
        newRoom.name = roomName;
        newRoom.dimensions = dimensions;
        rooms.Add(newRoom);
        roomListBox.DataContext = rooms;
      }

the XAML for this is:

    <ListBox Canvas.Left="-1" Canvas.Top="47" Height="419" Name="roomListBox" Width="481"  BorderThickness="1" BorderBrush="GhostWhite" ItemsSource="{Binding}" DataContext="{Binding}"> 

        <ListBox.ItemTemplate  >
            <DataTemplate   >
                <StackPanel Orientation="Vertical" Margin="1" Name="verstack"   > 
                    <StackPanel Orientation="Horizontal" Margin="1" KeyDown="StackPanel_KeyDown" >
                        <TextBox Text="{Binding  Path=name}" IsReadOnly="False" FontFamily="Courier New" FontSize="22" Height="65" VerticalAlignment="Top" TextAlignment="Center"/>
                        <TextBox Name="xDimension" Text="{Binding Mode=TwoWay, Path=dimensions[0] }"  Width="70" Height="65" VerticalAlignment="Top" IsReadOnly="False" FontFamily="Courier New" Margin="2,0,1,0" FontSize="22" MaxLength="3" InputScope="TelephoneNumber" TextAlignment="Center"  />
                    <TextBlock Name="separator" Text=":" FontSize="32"  FontWeight="ExtraBold" Margin="1,4,1,0"  />
                        <TextBox Name="yDimension" Text="{Binding Mode=TwoWay, Path=dimensions[1] }" Width="70" Height="65" VerticalAlignment="Top"   IsReadOnly="False" FontFamily="Courier New" Margin="1,0,2,0" FontSize="22" MaxLength="3" InputScope="TelephoneNumber" TextAlignment="Center"/>

I havent closed the Xaml off here , there’s a load more underneath it, when I run this nothing is displayed and I just don’t know what the problem is, I’ve been hammering away at it for 2 days, please someone help

  • 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-05T02:31:15+00:00Added an answer on June 5, 2026 at 2:31 am

    Rooms needs to be a public property that you bind to.

    public ObservableCollection<myClass> rooms
    { 
       get { return ........
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked everywhere for this and just cannot find the answer. I have
i have read many posts but can not find my answer.my question is a
I think this is a simple question, but I can not find the answer
I've been searching quite a bit now but cannot find the answer to this.
This is a beginner's question but for some reason I cannot find the answer
OK, this must be a duplicate question, but I cannot find the answer: I
I would have another question I cannot find answer on. I know that the
I've searched google and cannot find any answers to the particular problem. I have
I definitely searched for this, but I can't find the answer, even though it
Maybe this isn't possible with ASP.NET MVC because I can not find an answer.

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.