protected override void OnNavigatedFrom(NavigationEventArgs e) { base.OnNavigatedFrom(e); ReleaseMouse(); StopMediaPlayer(); MoonlightCommonRuntimeComponent.StopConnection(); }
/// <summary> /// Connection terminated callback /// </summary> /// <param name="errorCode">Error code for connection terminated</param> public void ClConnectionTerminated(int errorCode) { Debug.WriteLine("Connection terminated: " + errorCode); if (controllers != null) { // Stop controller code controllers.Stop(); } var unused = Task.Run(() => { // This needs to be done on a separate thread MoonlightCommonRuntimeComponent.StopConnection(); }); DialogUtils.DisplayDialog(this.Dispatcher, "Connection terminated unexpectedly", "Connection Terminated", (command) => { this.Frame.Navigate(typeof(MainPage), null); }); }
/// <summary> /// Clean up resources /// </summary> private void Cleanup() { MoonlightCommonRuntimeComponent.StopConnection(); hasMoved = false; }