Windows phone 7 在wp7中将图像设置为全景页面的全景标题
我需要设置全景页面标题的图像,我们可以这样做吗?实际上,我已经使用TitleTemplate完成了这项工作,但它不起作用。。你能指导我如何将图像设置为全景页面标题吗 代码是Windows phone 7 在wp7中将图像设置为全景页面的全景标题,windows-phone-7,Windows Phone 7,我需要设置全景页面标题的图像,我们可以这样做吗?实际上,我已经使用TitleTemplate完成了这项工作,但它不起作用。。你能指导我如何将图像设置为全景页面标题吗 代码是 <controls:Panorama Background="{Binding PanoramaBackground}"> <controls:Panorama.TitleTemplate> <DataTemplate> <StackPanel>
<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>
但是这不起作用
感谢和问候
dinesh若要执行此操作,请从图像URI中删除前导斜杠。应该是:
<Image x:Name="HeaderImage" Source="Resources/header_logo.png" />
要实现这一点,您需要实际拥有一些数据,以便使用您的模板。
由于您不想在模板中使用任何传递的值,您可以通过简单地将
标题设置为空字符串来实现这一点
<controls:Panorama Title="">
要使页眉可见,还可以通过以下方式为模板设置上边距:
<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>
我在这个论坛之外找到了我问题的答案:
在标题位置为所有全景视图绘制大图像的正确方法如下:
<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>
这根本没用。正如GDM所提到的,问题实际上是关于需要设置的最高利润率。