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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:16:07+00:00 2026-05-28T08:16:07+00:00

i got a listbox with items and i use datatemplate to display the items

  • 0

i got a listbox with items and i use datatemplate to display the items

i want to make a download button, once the user select an item and click the button a progress bar will be added to the selected item datatemplate and will display the download progress, is it possible ?

any pointers will help

 <ListBox Name="List" Grid.Row="2" 
                 ScrollViewer.HorizontalScrollBarVisibility="Visible" 
                 ScrollViewer.VerticalScrollBarVisibility="Disabled"  
                 ItemTemplate="{StaticResource ListTemplate}" 
                 ItemsSource="{Binding Path=Items}" 
                 SelectedItem="{Binding Path=SelectedItem}"
                 ItemContainerStyle="{StaticResource RoundedItem}" 
                 BorderBrush="{x:Null}" BorderThickness="0" 
                 Background="{x:Null}">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel Margin="10" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>

thanks

  • 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-28T08:16:08+00:00Added an answer on May 28, 2026 at 8:16 am

    Yes, it is possible. You can create and <ItemTemplate> that contains both the “normal” representation of the item as well as the progress bar. Initially you set the Visibility of the progress bar to Collapsed. When the download starts you change the Visibility to Visible (you may also want to collapse other parts of the item).

    You can databind the Visibility property to a property of the view-model of the item. You could use a boolean property like IsDownloading and then bind through a converter that converts true to Visible and false to Collapsed.

    To show the progress bar you simply set IsDownloading to true and fire the PropertyChanged event. When download is complete you set IsDownloading to false and fire the PropertyChanged event again.

    Here is a rough sketch on how you can do it. You need a view-model class for your item in the ListView that you can databind to:

    class Item : INotifyPropertyChanged {
    
      public String Name { ... }
    
      public Double Progress { ... }
    
      public Boolean IsDownloading { ... }
    
      ...
    
    }
    

    You also need an IValueConverter that can convert Boolean to Visibility:

    class VisibilityConverter : IValueConverter {
    
      public Boolean Invert { get; set; }
    
      Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture) {
        var visible = Convert.ToBoolean(value) ^ Invert;
        return visible ? Visibility.Visible : Visibility.Collapsed;
      }
    
      Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture) {
        throw NotImplementedException();
      }
    
    }
    

    Your view should be based on something like this:

    <ListBox
      <ListBox.Resources>
        <local:VisibilityConverter x:Key="VisibilityConverter"/>
        <local:VisibilityConverter x:Key="InverseVisibilityConverter" Invert="True"/>
      </ListBox.Resources>
      <ListBox.ItemTemplate>
        <DataTemplate>
          <Grid>
            <TextBlock
              Text="{Binding Name}"
              Visibility="{Binding IsDownloading, Converter={StaticResource InverseVisibilityConverter}}"/>
            <ProgressBar
              Value="{Binding Progress}"
              Visibility="{Binding IsDownloading, Converter={StaticResource VisbilityConverter}}"/>
          </Grid>
        <DataTemplate>
      </ListBox.ItemTemplate>
    </ListBox>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got a Listbox and i want to add some Items. There are
I have a ListBox that contains a number of User items that are DataTemplate
I've got listbox that employs an item template. Within each item in the list,
Hy. I have got a ListBox with a scrollviewer in it. Each item (40++
I've got a collection of ViewModels and want to bind a ListBox to them.
I've got an administrative page with a listbox filled with values. A user can
I've got a ListBox which is getting new items added to it through Databinding
I want to display data with level of detail, so i use a TreeView,
I've got a listbox with a simple list of items. On my xaml page,
I've got a user control that I'm using as my DataTemplate for all 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.