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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:32:58+00:00 2026-06-13T07:32:58+00:00

I want to load multiple images inside a wrappanel, for each image I show

  • 0

I want to load multiple images inside a wrappanel, for each image I show a thumbnail and some image details with this code

<Border BorderThickness="1" BorderBrush="#FFD0D1D7" Padding="5" Margin="10,10,0,0">
    <StackPanel Orientation="Horizontal">
        <!--image and dimensions-->
        <Grid Width="88" Height="55">
            <Image Source="C:\img1.jpg" Width="88" Height="55"/>
            <TextBlock Background="#B2000000" Foreground="White" Height="16" TextAlignment="Center" VerticalAlignment="Bottom">1280x1024</TextBlock>
        </Grid>
        <!--name, type and size-->
        <StackPanel Orientation="Vertical" Margin="5,0,0,0" VerticalAlignment="Center">
            <TextBlock Margin="1" Foreground="#FF787878">img13.jpg</TextBlock>
            <TextBlock Margin="1" Foreground="#FF787878">Type: JPEG</TextBlock>
            <TextBlock Margin="1" Foreground="#FF787878">Size: 321 KB</TextBlock>
        </StackPanel>
    </StackPanel>
</Border>

But the images are loaded at runtime, and I need some way to create instances of the above code to show the image, dimensions, name, type and size

I tried this solution https://stackoverflow.com/a/4991028/962284

StringBuilder sb = new StringBuilder();
// use xaml to declare a button as string containing xaml
sb.Append(@"<Border BorderThickness='1' BorderBrush='#FFD0D1D7' Padding='5' Margin='10,10,0,0'>
            <StackPanel Orientation='Horizontal'>
                <!--image and dimensions-->
                <Grid Width='88' Height='55'>
                    <Image Source='C:\img1.jpg' Width='88' Height='55'/>
                    <TextBlock Background='#B2000000' Foreground='White' Height='16' TextAlignment='Center' VerticalAlignment='Bottom'>1280x1024</TextBlock>
                </Grid>
                <!--name, type and size-->
                <StackPanel Orientation='Vertical' Margin='5,0,0,0' VerticalAlignment='Center'>
                    <TextBlock Margin='1' Foreground='#FF787878'>img13.jpg</TextBlock>
                    <TextBlock Margin='1' Foreground='#FF787878'>Type: JPEG</TextBlock>
                    <TextBlock Margin='1' Foreground='#FF787878'>Size: 321 KB</TextBlock>
                </StackPanel>
            </StackPanel>
        </Border>");

FrameworkElement thumb = (FrameworkElement)System.Windows.Markup.XamlReader.Parse(sb.ToString());
ThumbnailContainer.Children.Add(thumb);

but I get the following error
System.Windows.Markup.XamlParseException

I also tried with styles, but styles doesnt support multiple parameters (to specify the textblocks: dimensions, size, name, type and size) just “TemplateBinding Tag” for 1 value

What can I do to create instances of the first code to show multiple images at runtime?

  • 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-13T07:32:59+00:00Added an answer on June 13, 2026 at 7:32 am

    Wow. That so looks like the hard way to do things. Time to embrace WPF and XAML.

    I had a post about this exact same thing that wasn’t quite finished. I took time to finish it for you. I even used your XAML snippet (well, a modified version of it) in the example, just for you.

    http://www.wpfsharp.com/2012/10/23/displaying-images-from-a-folder-with-details-in-wpf/

    Clemens is correct in his comment to use an ItemsControl.

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

Sidebar

Related Questions

My problem is, I have multiple images and want to load like pre-loader, but
i want to draw multiple images on canvas (background, on background another image, and
I want to load multiple images when my app starts from a website (i.e.
I want to load multiple images in table view.and it should be loaded asynchronously
I use codeigniter. I want multiple upload image, for this work, i use library
I want to load multiple languages to use IVONA SDK with SSML for iPhone.
I want to load multiple variables into one .mat file at the end of
I want to load an image via css that stretches to the entire screen.
I want to load up a random image while a page it is loading
I want to load multiple pictures to UIImageView from the Library. However, the size

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.