An Image view cant be inserted into Shell : Pls help

Topics: Prism v2 - Silverlight 3
May 4, 2010 at 1:58 PM

Hi,

I ve a view called Home.xaml, inside which i want to have a image. When i include an image on this page and show it in the shell.xaml , I am getting an error "Image Error" and the error msg is AG_E_NETWORK_ERROR.

Please help me how to include my home.xaml (which has an image in it) into my shell window.
Thanks
Devasena


Here is my home.xaml which has an image inside ..
-------------------------------------Home.xaml---------------------------------------------
<navigation:Page x:Class="HospLight.Views.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"
mc:Ignorable="d"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
d:DesignWidth="640" d:DesignHeight="480"
Title="Login">
<Grid x:Name="LayoutRoot">

<StackPanel x:Name="ContentStackPanel" VerticalAlignment="Top" Orientation="Horizontal" >
<TextBlock x:Name="LblWltxt" Text="Welcome To XYZ Hospitals" FontSize ="18" >

</TextBlock>
<Grid x:Name="Imggrid" Height="400" Width="600" VerticalAlignment="Bottom" >
<Image Source="watermark.png" Stretch="UniformToFill" />
</Grid>
</StackPanel>
</Grid>
</navigation:Page>
--------------------------------------Here below my shell.xaml------------------------------
<UserControl
x:Class="HospLight.Shell"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">

<Grid x:Name="LayoutRoot" >


<Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}">

<Border x:Name="LinksBorder" Style="{StaticResource LinksBorderStyle}">
<StackPanel x:Name="LinksStackPanel" VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Right" >
<HyperlinkButton x:Name="Link1" NavigateUri="/Home" TargetName="ContentFrame" Content="Home" Style="{StaticResource LinkStyle}" />

</StackPanel>
</Border>

</Grid>

<Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}">

<navigation:Frame x:Name="ContentFrame" Source="/Home" VerticalAlignment="Center">
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/>
<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
</Border>
</Grid>
</UserControl>
---------------------------------------------------------------------

May 5, 2010 at 7:44 PM

Hi,

I have tried to reproduce your issue with no success. However, this does not seem to be an issue related to Prism. You might find a more specific answer to this question in the Silverlight forums, where there are also many related questions that have already been answered by community members there.

Although this is not related to your issue, regarding navigation with Prism, you should take into account that in some scenarios might not work correctly (although this is not related to your issue).

Please let me know if this helps.

Damian Schenkelman
http://blogs.southworks.net/dschenkelman

May 6, 2010 at 1:43 PM

 Try setting like Source as /;Component/

 

e.g. Source="/MySLControl;Component/Images/myimg.png" Where MySLControl is assembly name in which there is Images folder containing myimg.png image

May 7, 2010 at 5:11 AM

Hi,

     Thanks to all for the reply. Lavanyaready, it works as you suggested.

Regards

Devasena