dinesh
dinesh

Reputation: 735

Setting image as Panorama Title for Panorama page in wp7

I need to set the Image for Panorama Page's Title, Can we able to do this ? Actually I have done this using TitleTemplate but it is not working.. can you guide me how to set the Image as Panorama Page Title.

The Code is

<controls:Panorama Background="{Binding PanoramaBackground}">
  <controls:Panorama.TitleTemplate>
    <DataTemplate>
      <StackPanel>
        <Image x:Name="HeaderImage" Source="/Resources/header_logo.png" />
      </StackPanel>
    </DataTemplate>
  </controls:Panorama.TitleTemplate> 
</controls:Panorama>

But This is not working..

Thanks and Regards,

dinesh

Upvotes: 2

Views: 8329

Answers (4)

Juan Pedro
Juan Pedro

Reputation: 269

I found the answer of my question outside of this forum:

The proper way for draw a big image for all the panorama view in the title position is this:

        <controls:Panorama.Title>
            <StackPanel Orientation="Vertical" Margin="0,80,0,0">
                <Image x:Name="icon" Source="/Resources/Drawables/header_landscape.png" Height="163" Width="1920"/>
                <!--<TextBlock Text="my application" FontStyle="Italic" FontSize="40" VerticalAlignment="Center" Margin="0,-40,0,0" />-->
            </StackPanel>
        </controls:Panorama.Title>

Upvotes: 11

GDM
GDM

Reputation: 61

To make the header visible you can also set a top margin for your template in this way:

<DataTemplate x:Key="PanoramaHeader">
     <Grid Height="72" Margin="0,72,0,0">
          <Image HorizontalAlignment="Left" Height="72" Margin="0" Source="/Assets/Images/header.png" Stretch="Fill" VerticalAlignment="Bottom" Width="72"/>
     </Grid>
</DataTemplate>

Upvotes: 6

Stefan Wick  MSFT
Stefan Wick MSFT

Reputation: 13850

to make this work, remove the leading slash from the image URI. It should be:

<Image x:Name="HeaderImage" Source="Resources/header_logo.png" />

Upvotes: 0

Matt Lacey
Matt Lacey

Reputation: 65564

To make this work you need to actually have some data so that your template is used.
As you don't want to use any passed value in your template you can get this to work by simply setting the Title to an empty string.

<controls:Panorama Title="">

Upvotes: 2

Related Questions