我正在为 wp7 制作一个小应用程序,当我尝试从参考中获取时出现错误。
类似这样的代码:
private void refreshExistingShellTile()
{
using (IEnumerator<ShellTile> enumerator = ShellTile.get_ActiveTiles().GetEnumerator())
{
while (enumerator.MoveNext())
{
ShellTile current = enumerator.get_Current();
if (null != current.get_NavigationUri() && !current.get_NavigationUri().ToString().Equals("/"))
{
Black_n_Gold.Entities.Tile tile = App.CurrentApp.tileService.findById(App.CurrentApp.tileService.getTileId(current.get_NavigationUri().ToString()));
if (tile != null && tile.id == this.customizedTile.id)
{
current.Delete();
this.createShellTile(this.customizedTile);
}
}
}
}
}
我有这个错误:
'Microsoft.Phone.Shell.ShellTile.ActiveTiles.get': cannot explicitly call operator or accessor
'Microsoft.Phone.Shell.ShellTile.NavigationUri.get': cannot explicitly call operator or accessor
'System.Collections.Generic.IEnumerator<Microsoft.Phone.Shell.ShellTile>.Current.get': cannot explicitly call operator or accessor
当我尝试从属性添加或设置时,我遇到了同样的错误,我在网上查看,但找不到解决方案。