我一直有一个非常奇怪的问题,我无法解决这个问题.
我创建了非常简单的WP 8.1 App来显示问题:
MainPage.xaml中:
<Page
x:Class="App6.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App6"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<MediaElement x:Name="MediaElement1" Source="/Assets/Audio/clap_01.mp3"
Visibility="Collapsed" AutoPlay="False" />
<MediaElement x:Name="MediaElement2" Source="/Assets/Audio/click_01.mp3"
Visibility="Collapsed" AutoPlay="False" />
<MediaElement x:Name="MediaElement3" Source="/Assets/Audio/cowbell_01.mp3"
Visibility="Collapsed" AutoPlay="False" />
<MediaElement x:Name="MediaElement4" Source="/Assets/Audio/kick_01.mp3"
Visibility="Collapsed" AutoPlay="False" />
<Button Content="Button" HorizontalAlignment="Left" Margin="125,118,0,0" VerticalAlignment="Top" Height="147"
Width="150" Click="ButtonBase_OnClick" />
</Grid>
</Page>
Run Code Online (Sandbox Code Playgroud)
MainPage.xaml.cs中:
namespace App6
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
this.NavigationCacheMode = NavigationCacheMode.Required;
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
}
private void …Run Code Online (Sandbox Code Playgroud)