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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:15:36+00:00 2026-05-24T12:15:36+00:00

I was trying to add thumbnail to list view but the problem is that

  • 0

I was trying to add thumbnail to list view but the problem is that nothing gets displayed.here is the code

System.Windows.Forms.OpenFileDialog open = new System.Windows.Forms.OpenFileDialog();
open.Filter = "Images (*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|" + "All files (*.*)|*.*";
open.Title = "Add Slide Show Image";
open.ShowDialog();

BitmapImage logo = new BitmapImage();
logo.BeginInit();
logo.CacheOption = BitmapCacheOption.OnLoad;
logo.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
logo.UriSource = new Uri(open.FileName);
logo.EndInit();


image.Add(logo);

listView1.ItemsSource = image;

listView1.Items.Refresh();

<ListView.ItemTemplate>
    <HierarchicalDataTemplate>
        <Border Padding="5,2,0,2">
            <StackPanel Width="289" Orientation="Horizontal"  >
                <Border CornerRadius="6" BorderThickness="4" Margin="0,0,4,0" Height="80" Width="80" Background="{x:Null}">
                    <Image  Stretch="Fill"  Source="{Binding image}" />
                    <Border.BorderBrush>
                        <LinearGradientBrush EndPoint="0.9,1" StartPoint="0.5,0">
                            <GradientStop Color="#FF00C4FF" Offset="1" />
                            <GradientStop Color="#FF093D5C" Offset="0.089" />
                        </LinearGradientBrush>
                    </Border.BorderBrush>
                </Border>
                <Border CornerRadius="6" BorderThickness="4" Margin="-85,0,4,0" Height="80" Width="80">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.9,1.2" StartPoint="0.1,0">
                            <GradientStop Color="#4EFFFFFF" Offset="0" />
                            <GradientStop Color="#49FFFFFF" Offset="0.163" />
                            <GradientStop Color="Transparent" Offset="0.472" />
                            <GradientStop Color="#3DFFFFFF" Offset="0.457" />
                        </LinearGradientBrush>
                    </Border.Background>
                </Border>
                <CheckBox Content="{Binding Name}" IsChecked="{Binding IsChecked}" VerticalAlignment="Center" />
            </StackPanel>
        </Border>
    </HierarchicalDataTemplate>
</ListView.ItemTemplate>

A screenshot

  • 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-24T12:15:37+00:00Added an answer on May 24, 2026 at 12:15 pm

    create a class

     class MyImages
        {
            public BitmapImage image {get;set;}
            public  String Name {get;set;}
            public bool IsChecked  {get;set;}
        }
    

    Now create a List<MyImages> myImages = new List<MyImages>();

    BitmapImage logo = new BitmapImage();
    logo.BeginInit();
    logo.CacheOption = BitmapCacheOption.OnLoad;
    logo.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
    logo.UriSource = new Uri(open.FileName);
    logo.EndInit();
    
    myImages.Add(new MyImage(){image = logo, Name = "SomeName", IsChecked = true });
    
    listView1.ItemsSource = myImages;
    listView1.Items.Refresh();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to add a class object into a List using reflection, but when invoking
Im trying to add a little code to an already made thumbnail plugin. Basically
I want to add a thumbnail picture viewer to my application.I have been trying
Im trying to add a directory foo to my repo, but there are some
i am trying to add a thumbnail dynamically to my relative layout. This is
I'm trying to create a simple youtube player that should show thumbnail of videos
im trying to make an image gallery. the container class that adds the thumbnail
I'm trying to create a function which will add an overlay to a thumbnail
I'm trying to add videos to my WPF project, but I can't find a
im trying add item with ajax, all work, except the view doesnt refresh, when

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.