0

The images are displayed in the XAML but when I run the program the images aren't displayed in the list boxes. It just shows the boxes but without the images.

here is the code:

<ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Hidden" Margin="103,156,67.6,65">
            <ListBox>
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBoxItem>
                    <Image Margin="0,0,20,0" Width="225" Source="pictures/gw1.jpg"></Image>
                </ListBoxItem>
                <ListBoxItem>
                    <Image Margin="0,0,20,0" Width="225" Source="pictures/ja2.jpg"></Image>
                </ListBoxItem>
                <ListBoxItem>
                    <Image Margin="0,0,20,0" Width="225" Source="pictures/tj3.jpg"></Image>
                </ListBoxItem>
            </ListBox>
        </ScrollViewer>
LarsTech
  • 80,625
  • 14
  • 153
  • 225
  • What's the exact path of that file in your project and the exact path of your images? – Pietro Nadalini Jul 26 '18 at 19:16
  • The post says the following: Change the build action to 'Resource'. Also your pack url is wrong. Either use: Source="pack://application:,,,/Resource/UserCost2013Open16.png" or simply Source="/Resource/UserCost2013Open16.png" But i can't find anything about build action, where is it located? –  Jul 27 '18 at 10:35

0 Answers0