尝试在乐队上创建一个磁贴时,我遇到了错误。我似乎无法通过它。这是错误:
namespace Band_Test_3
{
#if !DISABLE_XAML_GENERATED_MAIN
public static class Program
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
static void Main(string[] args)
{
global::Windows.UI.Xaml.Application.Start((p) => new App());
}
}
#endif
partial class App : global::Windows.UI.Xaml.Application
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
private bool _contentLoaded;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void InitializeComponent()
{
if (_contentLoaded)
return;
_contentLoaded = true;
#if DEBUG && !DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT
DebugSettings.BindingFailed += (sender, args) =>
{
global::System.Diagnostics.Debug.WriteLine(args.Message);
};
#endif
#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
UnhandledException += (sender, e) =>
{
if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
};
#endif
}
}
}
使用此代码。错误发生在andClient.TileManager.AddTileAsync(tile)行:
private async void btnCreateTile_Click(object sender, RoutedEventArgs e)
{
txbMessage.Text = "";
// create a new Guid for the tile
// create a new tile with a new Guid
BandTile tile = new BandTile(tileGuid)
{
// enable badging (the count of unread messages)
IsBadgingEnabled = true,
// set the name
Name = "Band Test",
// set the icons
SmallIcon = await LoadIcon("ms-appx:///Assets/Certificate-WF Small.png"),
TileIcon = await LoadIcon("ms-appx:///Assets/Certificate-WF.png")
};
await bandClient.TileManager.AddTileAsync(tile);
}
答案 0 :(得分:0)
我未能添加磁贴的最常见错误是:
如果这些现在有帮助,那么请在您获得的例外中过去。