【发布时间】:2012-11-10 11:08:25
【问题描述】:
我想知道在使用图像作为全景标题时是否可以绑定图像路径,我需要为源绑定的原因是当用户将手机背景设置为“白色”时,徽标将是黑色,反之亦然。
这是我正在使用的代码:
<controls:Panorama.TitleTemplate>
<DataTemplate>
<Image Source="/PanoramaApp5;component/Images/logo.png" Margin="14,105,0,10" HorizontalAlignment="Left" Name="logo" Stretch="Fill" VerticalAlignment="Top" Width="700" Height="70"/>
<!--<TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" FontSize="100" Margin="10,50,0,0" />-->
</DataTemplate>
</controls:Panorama.TitleTemplate>
如果我让默认标题(即文本),它会正常工作,但我需要它作为图像。
【问题讨论】:
-
我无法以编程方式设置图像源,我确实尝试过但根本没有定义,例如我不能使用 logo.Source。你有什么建议吗?
标签: xaml windows-phone