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

  • Home
  • SEARCH
  • 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 3605532
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:08:08+00:00 2026-05-18T21:08:08+00:00

I have an expander with a list box in it that displays image thumbnails.

  • 0

I have an expander with a list box in it that displays image thumbnails. I want the images to be sized according to the size of the listbox and the list box to be sized based on the width of the expander. When I expand the expander I want the list box and the images to resize also. Does anyone know how I can accomplish this?

   <Expander
            Style="{DynamicResource ExpanderStyle}"
            Name="pictureExpander"
            IsExpanded="True"                
            ExpandDirection="Left"
            Collapsed="pictureExpander_Collapsed"
            Expanded="pictureExpander_Expanded"
            Grid.Column="4">
            <ListBox 
                Name="photoList" 
                ItemsSource="{Binding Source={StaticResource PhotoBin}}"
                IsSynchronizedWithCurrentItem="True"
                HorizontalAlignment="Stretch"
                ScrollViewer.CanContentScroll="False">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="{x:Type ListBoxItem}">
                        <Style.Resources>
                            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Yellow" />
                        </Style.Resources>
                        <Style.Triggers>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter Property="BorderBrush" Value="Black"/>
                                <Setter Property="BorderThickness" Value="5"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </ListBox.ItemContainerStyle>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Image 
                            Source="{Binding FileLocation}"
                            Margin="0,5"
                            HorizontalAlignment="Stretch"
                            MouseLeftButtonDown="DragImage" />
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Expander>
  • 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-18T21:08:08+00:00Added an answer on May 18, 2026 at 9:08 pm

    by using the “Stretch” Property on your image:

    <Image 
         Source="{Binding FileLocation}"
         Margin="0,5"
         MouseLeftButtonDown="DragImage"
         Stretch="Uniform"
         StretchDirection="Both"/>
    

    you can play with the values to get the effect you want:

    http://msdn.microsoft.com/en-en/library/system.windows.controls.image.stretch.aspx

    http://msdn.microsoft.com/en-en/library/system.windows.controls.image.stretchdirection.aspx

    http://msdn.microsoft.com/en-us/library/system.windows.media.stretch.aspx

    http://msdn.microsoft.com/en-us/library/system.windows.controls.stretchdirection.aspx

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

Sidebar

Related Questions

I have an Expander that I want to have a ListBox in. When the
I have a list box in expander: <ListBox ItemsSource={Binding MySource> <ListBox.ItemTemplate> <DataTemplate> <RadioButton Content={Binding
Right now I have a Stackpanel, that contains a collapsed Expander, and a Listbox.
I have a ListBox containing a group of 'Expander' items, and what I would
I have a stack panel inside of an expander panel that I programaticaly adds
I have a custom template for an expander that is close to the code
I have a model window that contains expander control. This expander control when expanded
I have an Expander in the ItemTemplate of a ListBox. Renders fine. The issue
I have a ListBox, inside a Grid, inside an Expander. The ListBox is bound
I have a StackPanel with multiple Expander s: <StackPanel Margin=0,10,0,0> <Expander Header=Test 1> <ListBox>

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.