質問

At my server side I send tile notifications via this uri:

<?xml version='1.0' encoding='utf-8'?>
<tile>
    <visual lang=""en-US"">
        <binding template=""TileWideSmallImageAndText02"">
            <image id=""1"" src=""{0}""/>
            <text id=""1"">{1}</text>
            <text id=""2"">{2}</text>
        </binding>
    </visual>
</tile>

{0} is a uri to image e.g. ms-appdata:///local/Folder/{id}.jpg the problem is that server doesn't know if specific image exists or not and in case if not - tile notification won't work (tile won't be updated) so are there any solutions e.g. is to specify default image or default binding (without image).

役に立ちましたか?

解決

A tile notification will only be shown if all of the image resources referenced are present and valid. Fallback to a different image is not possible. It isn't possible to have a tile notification always shown if the server is referencing local images that may or may not be present on the client.

There are two possible alternatives that may be of use in your situation:

  1. Host the images on your server, so that they are always available to all clients.

  2. Omit image nodes in the XML template that may or may not be present on all clients. Any of the nodes in the XML template can be removed. Taking your tile notification XML as an example, the tile notification will always be shown if the image node is removed:

    <?xml version='1.0' encoding='utf-8'?>
    <tile>
        <visual lang="en-US">
            <binding template="TileWideSmallImageAndText02">
                <text id="1">First text</text>
                <text id="2">Second text</text>
            </binding>
        </visual>
    </tile>
    
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top