【问题标题】:Data binding on Windows phone 8 live tilesWindows phone 8 动态磁贴上的数据绑定
【发布时间】:2014-11-25 21:06:22
【问题描述】:

我正在尝试在我的 Windows Phone 8 应用程序的动态磁贴的“背景内容”中绑定一些字符串,以根据智能手机的语言更改文本,但我找不到方法。带有静态字符串的瓷砖工作正常。 这是我的“WMAppManifest.xml”的“令牌”块:

<Tokens>
  <PrimaryToken TokenID="PhoMod_VToken" TaskName="_default">
    <TemplateFlip >
      <SmallImageURI IsRelative="true" IsResource="false">Assets\Tiles\IconicTileSmall.png</SmallImageURI>
      <Count>0</Count>
      <BackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\IconicTileMedium.png</BackgroundImageURI>
      <Title>PhoMod 3D
      </Title>
      <BackContent>Capture, view and share your world in 3D</BackContent>
      <BackBackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\IconicTileMedium_Back.png</BackBackgroundImageURI>
      <BackTitle>PhoMod 3D
      </BackTitle>
      <LargeBackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\IconicTileLarge.png</LargeBackgroundImageURI>
      <LargeBackContent>Capture, view and share your world in 3D</LargeBackContent>
      <LargeBackBackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\IconicTileLarge_Back.png</LargeBackBackgroundImageURI>
      <DeviceLockImageURI IsRelative="true" IsResource="false">
      </DeviceLockImageURI>
      <HasLarge>True</HasLarge>
    </TemplateFlip>
  </PrimaryToken>
</Tokens>

请提出一种方法。提前致谢。

【问题讨论】:

    标签: c# xml windows-phone live-tile


    【解决方案1】:

    无法将值绑定到 WMAppManifest.xml。您需要以编程方式创建带有所需文本的新图块并更新默认图块。

    检查这些链接: http://msdn.microsoft.com/en-us/library/windows/apps/jj206971%28v=vs.105%29.aspx

    http://developer.nokia.com/community/wiki/Live_Tile_Templates_in_Windows_Phone_8

    【讨论】:

    • 谢谢@Parad1s3。我试过了,它可以工作,但是,当用户在应用程序列表中长按应用程序时,在显示的上下文菜单上触摸“pin to start”时,如何启动代码以生成磁贴?
    • 这是不可能的。不过没关系。即使应用未固定在用户的开始屏幕上,您也可以更新主磁贴,并且下次固定时,系统将使用更新的版本。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-22
    • 1970-01-01
    • 1970-01-01
    • 2011-09-20
    • 2013-04-19
    相关资源
    最近更新 更多