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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:01:24+00:00 2026-06-02T03:01:24+00:00

I’m a Java developer whose inherited a web project from another team whose sole

  • 0

I’m a Java developer whose inherited a web project from another team whose sole developer upped and quit. The majority of the project is written in Spring, JSPs and jQuery, however there is one component that is a Silverlight XAP.

Of course, the project was just handed to me and we’re already having production issues with it. I’ve never written a lick of C# before, and am scrambling to try and fix this as fast as humanly possible.

This is a Microsoft VS 2010 (Pro Edition) C# solution project, with a presentation layer consisting of XAML and CS files. The component that needs to be fixed is a file uploader that allows users to choose 1+ files from their machine and place them in a “queue” (a listbox). Then, with the click of a single button, all the “queued” files get uploaded to our server.

I need to be able to tell when the listbox is empty (when there are 0 files queued/populating it). This feature is represented in the code by a XAML/CS pair of files named ListItemControl.xaml and ListItemControl.xaml.cs respectively.

Here is the beginning of the CS file:

namespace silv.Uploader
{
    public partial class ListItemControl : UserControl
    {
        private UserFile UserFile { get { return (UserFile)this.DataContext; } }

        public ListItemControl()
        {
            InitializeComponent();

            ...

Applying Java concepts to its C# cousin (as I’ve been told), this looks like my ListItemControl is an in-house class extending a Microsoft built-in type of System.Windows.Controls.UserControl. Furthermore, that it has a UserFile property (which I assume is another homegrown type) representing a file or set of files that needs to be uploaded.

So first, as a sanity check: can someone please confirm those assumptions above?!?

First off, in Java/Swing-land, you would instantiate or subclass a JList (listbox) type, which has built-in methods/models to determine the number of items populating it at any given time.

What is the ListItemControl/UserControl equivalent in C#-land?

In this CS file I don’t see any methods for determining size/length/counts of data. Same when I F12 (Go to Definition) UserControl.

Essentially, I’m asking here: how do I query this listbox component for the number of items it is populated with? Thanks in advance for any nudges in the right direction…

Edit: Below is a snippet of the XAML that I believe is responsible for initializing this listbox:

<ScrollViewer Grid.Row="1" x:Name="svFiles" IsEnabled="True"     ScrollViewer.VerticalScrollBarVisibility="Visible" Margin="0,1,18,252">
    <StackPanel x:Name="stkMain" Orientation="Vertical" VerticalAlignment="Stretch">
        <ItemsControl  x:Name="icFiles" KeyUp="ScrollViewer_KeyUp" >
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <local:ListItemControl ScrollViewer.VerticalScrollBarVisibility="Visible" />
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </StackPanel>
</ScrollViewer>
  • 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-02T03:01:25+00:00Added an answer on June 2, 2026 at 3:01 am

    The updated snippet seems to be the right piece of XAML – you have the ItemsControl, which is a generic repeater control for rendering a collection of items. What I still don’t see is where the items are added, but that might be somewhere else in the code.

    However, since the ItemsControl is given a name, so you can access that:

    ItemCollection items = icFiles.Items;
    int count = items.Count;
    

    Where exactly are you trying to access the queue length? This needs to be in the code-behind of the window that the ItemsControl is defined in.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from

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.