2017-10-12 2 views
0

現時点では、私はUWPを使ってビデオゲームアプリを開発しています。また、メディアトランスポートコントロールは常に自動的に消滅します。そして私はその問題をなくすために努力していますが、結果はありません。画面にメディアトランスポートコントロールを保存しますか?

誰にもアイデアはありますか?ご協力いただきありがとうございます。

答えて

0

は、私は解決策をちょうど見つけた:
は、時間間隔(100,200..etc)の後に、私のアプリはちょうどのみ、メディアトランスポートコントロールが続行されます、再びをMediaElementにの位置値を設定し、タイマーを作成します。画面。このようなコード例:

private void MainPage_Loaded(object sender, RoutedEventArgs e) 
    { 
     KeepTransportControlsVisibleTimer = new DispatcherTimer(); 
     KeepTransportControlsVisibleTimer.Interval = TimeSpan.FromMilliseconds(200); 
     KeepTransportControlsVisibleTimer.Tick += KeepTransportControlsVisibleTimer_Tick; 

     KeepTransportControlsVisibleTimer.Start(); 
    } 

    private void KeepTransportControlsVisibleTimer_Tick(object sender, object e) 
    { 
     // just only set the Position value again 
     MediaElementControl.Position = MediaElementControl.Position; 
    } 

誰もがよりよい解決策を持っている場合は、感謝を共有してください。

関連する問題