我有一個簡單的XAML頁面:XAML綁定Windows Phone中不起作用8.1
<Grid>
<Grid Margin="50">
<TextBlock Text="{Binding NowPlaying.tracktitle}" Foreground="White" FontSize="40"/>
<TextBlock Foreground="#dcdcdc" FontSize="20" Margin="0,50,0,0">
<Run Text="{Binding NowPlaying.artist}"/>
<Run Text=" - "/>
<Run Text="{Binding NowPlaying.album}"/>
</TextBlock>
</Grid>
</Grid>
與頁面的代碼看起來像這樣:
public sealed partial class test : Page
{
// artistdata
public now_playing NowPlaying { get { return App.nowplaying; } }
public test()
{
this.InitializeComponent();
this.DataContext = this;
}
}
每當App.nowplaying一個屬性更改該類將觸發notifychanged事件。當XAML收到我的應用程序崩潰的錯誤:
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in SYSTEM.NI.DLL
任何人都知道我可以解決這個問題嗎?
沒錯這就是我發現了什麼來解決這個問題,以及 –