locked
Images are not displaying during runtime. RRS feed

  • Question

  • Hello,

    I am developing one application on Silverlight Business Application. I have to load image in the slideshow view. I have sucessfully tried it out in Silverlight application before using in my real application. Later on , when I use that same code in my SL Business Application, the slideshow, timer everythings are working but Images are not loading.

    Is there any issue that I have to done in SL Business Application.

    Here is my code:

    In XAML

    <navigation:Page
      x:Class="finalversion1.Home" 
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
      mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"  
      Style="{StaticResource PageStyle}">
      <Grid x:Name="LayoutRoot">
        <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}" >
          <StackPanel x:Name="ContentStackPanel" Style="{StaticResource ContentStackPanelStyle}">
            <TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}" 
                               Text="{Binding Path=ApplicationStrings.HomePageTitle, Source={StaticResource ResourceWrapper}}"/>
            <TextBlock x:Name="ContentText" Style="{StaticResource ContentTextStyle}" 
                               Text="Home page content"/>
                    <Grid Name="Gallery">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="370"/>
                            <RowDefinition Height="250"/>
                        </Grid.RowDefinitions>
                        <Border BorderBrush="AntiqueWhite" Width="500" CornerRadius="5" BorderThickness="2"
                        Background="Black" Margin="10,30,20,10" Padding="6,6,6,6">
                            <Image Grid.Row="0" Grid.Column="0" Height="360" x:Name="imgPreview"/>
                        </Border>
                        <ListBox x:Name="lbScrollGallery" Grid.Row="1" Grid.Column="0" Padding="0"
                         VerticalAlignment="Top" Width="500" SelectionChanged="ScrollerSelectionChanged"
                         d:LayoutOverrides="HorizontalAlignment">
                            <ListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </ListBox.ItemsPanel>
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Image Width="100" Height="100" Name="imgSource"
                                   VerticalAlignment="Center"
                                   Source="{Binding Path=Url}"/>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </Grid>
                </StackPanel>
        </ScrollViewer>
      </Grid>
    </navigation:Page>

    <navigation:Page

      x:Class="finalversion1.Home" 

      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 

      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 

      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

      xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"

      mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"  

      Style="{StaticResource PageStyle}">


      <Grid x:Name="LayoutRoot">

        <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}" >


          <StackPanel x:Name="ContentStackPanel" Style="{StaticResource ContentStackPanelStyle}">


            <TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}" 

                               Text="{Binding Path=ApplicationStrings.HomePageTitle, Source={StaticResource ResourceWrapper}}"/>

            <TextBlock x:Name="ContentText" Style="{StaticResource ContentTextStyle}" 

                               Text="Home page content"/>


                    <Grid Name="Gallery">

                        <Grid.RowDefinitions>

                            <RowDefinition Height="370"/>

                            <RowDefinition Height="250"/>

                        </Grid.RowDefinitions>

                        <Border BorderBrush="AntiqueWhite" Width="500" CornerRadius="5" BorderThickness="2"

                        Background="Black" Margin="10,30,20,10" Padding="6,6,6,6">

                            <Image Grid.Row="0" Grid.Column="0" Height="360" x:Name="imgPreview"/>

                        </Border>

                        <ListBox x:Name="lbScrollGallery" Grid.Row="1" Grid.Column="0" Padding="0"

                         VerticalAlignment="Top" Width="500" SelectionChanged="ScrollerSelectionChanged"

                         d:LayoutOverrides="HorizontalAlignment">

                            <ListBox.ItemsPanel>

                                <ItemsPanelTemplate>

                                    <StackPanel Orientation="Horizontal"/>

                                </ItemsPanelTemplate>

                            </ListBox.ItemsPanel>

                            <ListBox.ItemTemplate>

                                <DataTemplate>

                                    <Image Width="100" Height="100" Name="imgSource"

                                   VerticalAlignment="Center"

                                   Source="{Binding Path=Url}"/>


                                </DataTemplate>

                            </ListBox.ItemTemplate>

                        </ListBox>

                    </Grid>

                </StackPanel>


        </ScrollViewer>

      </Grid>


    </navigation:Page>


    Friday, April 15, 2011 11:13 PM

Answers