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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:49:35+00:00 2026-05-30T05:49:35+00:00

I have a listbox with images inside it. I want a horizontal row of

  • 0

I have a listbox with images inside it. I want a horizontal row of images with no gap between them, with the selected item being larger than the rest.
I’ve tried playing with transforms to makes all the other images smaller but this seemed to keep the item container the same size so I ended up with large gaps inbetween the images.
My source code without any transforms or triggers is below.

<ListBox ItemsSource="{Binding Images}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
        <ListBox.ItemsPanel>
            <ItemsPanelTemplate>
                <VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal" />
            </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
        <ListBox.Template>
            <ControlTemplate>
                <Grid>
                    <ScrollViewer VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden">
                        <ItemsPresenter />
                    </ScrollViewer>
                </Grid>
            </ControlTemplate>
        </ListBox.Template>            
        <ListBox.ItemTemplate>
            <DataTemplate>
                <Image Source="{Binding Poster}" Stretch="Uniform" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBox}}, Path=ActualHeight}"/>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
  • 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-30T05:49:36+00:00Added an answer on May 30, 2026 at 5:49 am

    Maybe you applied the transform as RenderTransform which does not affect layout, apply it as LayoutTransform instead and it should work.


    e.g.

    <ListBox.ItemTemplate>
        <DataTemplate>
            <Image Source="{Binding Poster}">
                <Image.LayoutTransform>
                    <ScaleTransform x:Name="st" ScaleY="{Binding ScaleX, RelativeSource={RelativeSource Self}}"/>
                </Image.LayoutTransform>
            </Image>
            <DataTemplate.Resources>
                <CubicEase x:Key="ease" EasingMode="EaseOut"/>
            </DataTemplate.Resources>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    Duration="0:0:0.3"
                                    EasingFunction="{StaticResource ease}"
                                    Storyboard.TargetName="st"
                                    Storyboard.TargetProperty="ScaleX"
                                    To="1.5"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>
                    <DataTrigger.ExitActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    Duration="0:0:0.3"
                                    EasingFunction="{StaticResource ease}"
                                    Storyboard.TargetName="st"
                                    Storyboard.TargetProperty="ScaleX"
                                    To="1"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.ExitActions>
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
    </ListBox.ItemTemplate>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a listbox that uses a UserControl as the item template. Inside the
I have a ListBox with horizontal scrolling, and each item consists of a two
I have lots of images stored in isolated storage and want to display them
I have an Image inside an ItemTemplate for a ListBox. Is there a way
I have a fair few images that I'm loading into a ListBox in my
The listbox contain images and the object assigned to the listbox have corresponding wmv
I need to have selection changed event inside a listbox itemtemplate. My listbox consists
I have a ListBox containing a set of images in a C# WPF application.
I have a listbox contains a datatemplate with Image and TextBlock control inside. I
I have a listbox inside of a stack panel inside of a border in

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.