images does not display at run time

834 views Asked by At

i have come a cross weird problem in windows phone 8 as when i set the source of an image in Xaml it shows correctly in the designer view but when i run the application no image appears i have made a new empty application.

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
    <Image Visibility="Visible" Source="Assets\Tiles\FlipCycleTileMedium.png" HorizontalAlignment="Left" Height="321" Margin="61,192,0,0" VerticalAlignment="Top" Width="359"/>
</Grid>  
1

There are 1 answers

0
Mohamed Thaufeeq On

This is the XAML Code I have used now: Just replace your MainPage.xaml with this code and run you app. You will see the image in the app definitely. Here's the screenshot.

enter image description here

<phone:PhoneApplicationPage
x:Class="PhoneApp1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">

<Grid x:Name="LayoutRoot" Background="Transparent">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
        <TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
        <TextBlock Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
    </StackPanel>

    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <Image Visibility="Visible" Source="Assets\Tiles\FlipCycleTileMedium.png" HorizontalAlignment="Left" Height="321" Margin="61,192,0,0" VerticalAlignment="Top" Width="359"/>
    </Grid>
</Grid>