@ 在 WP7 磁贴标题开头替换为路径:已知问题?
我正在使用 ShellTile.Create 方法创建辅助图块。我开发的应用程序的用户注意到,如果他们固定的实体的名称以“@”开头(然后用于磁贴的标题),则手机显示的标题为“ @\Applications\" ....
在我看来,手机似乎以某种方式将名称开头的“@”视为特殊的,并将其替换为路径...
这里我设置 ShellTileData。标题为“@Test”。这就是被固定的内容:
我已经尝试过对标题进行 UrlEncoding - 没有运气。
以前有人遇到过这个吗?这是一个已知问题吗?
达米安
我已经接受了下面科林的回答。这是我现在根据他的建议使用的代码:
...
if(initialData.Title.StartsWith("@")) {
initialData.Title = '\uff20' + initialData.Title.Substring(1);
}
ShellTile.Create(uri, initialData);
I'm using the ShellTile.Create method to create a secondary tile. Users of the app I've developed have noticed that if the entity they are pinning has a name that starts with "@" (which is then used for the title of the tile), then the title that is displayed by the phone is "@\Applications\" ....
It looks to me as though the phone treats an "@" at the start of the name as special somehow, and replaces it with a path ...
Here I'm setting the ShellTileData.Title to "@Test". This is what gets pinned:
I've tried UrlEncoding the title - no luck.
Has anyone come across this before? Is it a known issue?
Damian
I've accepted Colin's answer below. This is the code I'm now using based on his suggestion:
...
if(initialData.Title.StartsWith("@")) {
initialData.Title = '\uff20' + initialData.Title.Substring(1);
}
ShellTile.Create(uri, initialData);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据我的评论...尝试一下
\uFF20
,我怀疑有人会注意到@和@之间的区别。As per my comment ... give
\uFF20
a go, I doubt anyone will notice the difference between @ and @.Microsoft 的 Eric Fleck 在这里回复:http://forums.create。 msdn.com/forums/p/100059/598687.aspx#598687
下面提到了该问题Peter Torr 博客上的“谨防‘@’符号”:http://blogs.msdn.com/b/ptorr/archive/2011/07/12/background-agents-part-3-of-3.aspx
Peter 建议添加零-Width-Space unicode char (8203) 到以 @ 开头的图块名称的开头。
Eric Fleck from Microsoft responded here: http://forums.create.msdn.com/forums/p/100059/598687.aspx#598687
There is a mention of the issue under "Beware of the '@' Sign" on Peter Torr's blog here: http://blogs.msdn.com/b/ptorr/archive/2011/07/12/background-agents-part-3-of-3.aspx
Peter recommends adding a Zero-Width-Space unicode char (8203) to the start of tile names that begin with an @.
好吧,当你们谈论“代码”时,我只知道“@”符号是由普通欧盟输入“shift+2”提供的,这是非常常见的。这是 GTD 的“把事情做好”实践,已经存在多年了。因此,它可能比一般开发人员/编码人员想象的更常见。
同时,感谢您对达米安的调查。
Well while you guys talk "code," all I know is the "@" symbol as supplied by typing "shift+2" by your average EU, is extremely common. This is a GTD "Getting Things Done" practice that has been around for a number of years. So it may be more common than the average dev/coder may think.
In the meantime, thanks for looking into this Damian.