Reputation: 149
I am working on Panorama App for Windows Phone 8 and I have to add Foreground image with the background image.I have successfully added the background image but i don't know how to add foreground image in the same layout.Please help.
<phone:Panorama Title="My_app">
<phone:Panorama.Background>
<ImageBrush ImageSource="/My_app;component/Assets/texture.png"/>
</phone:Panorama.Background>
Using this code i am adding background image but don't know how to add foreground image.
I want to add image in the place of title "My_App" .
Upvotes: 0
Views: 539
Reputation: 2844
To set an image instead of a text as title on a panorama control, just add a style to the panorama with a custom title template. For example you can do this by adding the following to the xaml of the page containing the panorama (note: the dots represent any other code):
<phone:PhoneApplicationPage>
...
<phone:PhoneApplicationPage.Resources>
...
<Style TargetType="phone:Panorama" >
<Setter Property="TitleTemplate">
<Setter.Value>
<DataTemplate>
<Grid>
<Image Source="Assets/logo.png" Stretch="None" />
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</phone:PhoneApplicationPage.Resources>
...
</phone:PhoneApplicationPage>
Hope this helps!
Upvotes: 1
Reputation: 1539
First, add a PanoromaItem, then add an image to that item:
<phone:PanoramaItem>
<Grid>
<Image x:Name="MyImage" />
</Grid>
<phone:PanoramaItem>
Upvotes: 0