AppBarButton更改了Label
和Icon
后,该函数丢失了功能(不执行它的代码)(该代码仅适用于第一次单击按钮,而不再起作用(更改后) ),例如:
在此代码中,mediaPlayer.Pause();
有效
private async void AppBarButton_Click_1(object sender, RoutedEventArgs e)
{
//PPB.Icon = new SymbolIcon(Symbol.Play);
//PPB.Label = "Preview";
mediaPlayer.Pause(); //(i tested many other codes also)
}
但在此代码mediaPlayer.Pause();
中不是
private async void AppBarButton_Click_1(object sender, RoutedEventArgs e)
{
PPB.Icon = new SymbolIcon(Symbol.Play);
PPB.Label = "Preview";
mediaPlayer.Pause();
}