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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:38:08+00:00 2026-05-22T16:38:08+00:00

I was trying to get it working for few days. What is wrong in

  • 0

I was trying to get it working for few days.
What is wrong in this code?

This is my window XAML:

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Rapideo_Client"
        x:Class="Rapideo_Client.MainWindow"     
        Title="NVM" SnapsToDevicePixels="True" Height="400" Width="625">
    <Window.Resources>
        <DataTemplate x:Key="linksTemplate" DataType="DownloadLink">
            <StackPanel Orientation="Vertical">
                <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"></TextBlock>
                <Label Content="{Binding Path=SizeInMB}"/>
                <Label Content="{Binding Path=Url}"/>
            </StackPanel>
        </DataTemplate>
    </Window.Resources> 
        <ListView   ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                    ScrollViewer.VerticalScrollBarVisibility="Visible"
                    x:Name="MainListBox"
                    ItemTemplate="{DynamicResource linksTemplate}">                
        </ListView>
</Window>

This is my class:

class Rapideo
    {
        (...)
        public List<DownloadLink> Links { get; private set; }
        (...)
    }

This is my item:

class DownloadLink
{
    public string Name { get; private set; }
    public string Url { get; private set; }
    public DateTime ExpiryDate { get; private set; }
    public float SizeInMB { get; private set; }
    public int Path { get; private set; }
    public string Value { get; private set; }
    public LinkState State { get; set; }
    public enum LinkState
    {
        Ready, Downloading, Prepering, Downloaded
    }

    public DownloadLink(string name, string url, DateTime expiryDate, float sizeInMB, int path, string value, LinkState state)
    {
        Name = name;
        Url = url;
        ExpiryDate = expiryDate;
        SizeInMB = sizeInMB;
        Path = path;
        Value = value;
        State = state;
    }
}

This is my binding:

RapideoAccount = new Rapideo();
MainListBox.ItemsSource = RapideoAccount.Links;

Later in the code I populate that list in RapideoAccount.Links.
But nothing is showing in ListView.
List View is always empty.

Where is mistake in that code?

  • 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-22T16:38:08+00:00Added an answer on May 22, 2026 at 4:38 pm

    Yes, it should be an ObservableCollection<DownloadLink> if you’re planning on adding to it AFTER you have setup the ItemsSource. If the list is preloaded and you won’t be changing it, List<T> would have worked.

    Now I do think that

    MainListBox.ItemsSource = RapideoAccount.Links;
    

    is still technically a binding. But what you are probably thinking of is binding via the DataContext rather than directly (al la MVVM style). So that’d be:

    RapideoAccount = new Rapideo();
    this.DataContext = RapideoAccount;
    

    Then in your window, you’d bind your ItemSource like this:

    <Window
        ...
        <ListView  ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                   ScrollViewer.VerticalScrollBarVisibility="Visible"
                   x:Name="MainListBox"
                   ItemsSource="{Binding Links}" 
                   ItemTemplate="{DynamicResource linksTemplate}">                
        </ListView>
    </Window>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am new in programming under linux and trying to get working this code:
Ok, I've been trying to get this working for a few now and thought
Im trying to get debugging working without an app.config. I have the following code:
I am trying to get a working regular expression to convert standard HTML code
I'm learning mysql and have been trying to get this working, but an error
I have been working on this for a few days. I never messed with
I am trying to get a ToggleButton working but am having a few problems.
I've been searching and trying to get this to work for the past few
I have a SOAP client in Ruby that I'm trying to get working with
I been trying to get sqlcachedependecy working, but it doesn't appear to work I

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.