public void OnNavigatedTo(NavigationParameters parameters) { if (!parameters.ContainsKey("__NavigationMode")) { return; } NavigationMode navigationMode = parameters.GetValue <NavigationMode>("__NavigationMode"); // App was just started if (navigationMode == NavigationMode.New) { // Run the discovery command! // This shows and loads available servers in the network when starting the app Task.Run(() => ConnectionModeDiscoveryCommand.Execute()); } else if (navigationMode == NavigationMode.Back) { connection.Dispose(); // Make sure everything is clean SettingsService.Clean(); GC.Collect(); } }
public void OnNavigatedTo(NavigationParameters parameters) { MobileCenterService.TrackEvent(GetType().Name, "NavigatedTo"); try { NavigationMode navigationMode = parameters.GetValue <NavigationMode>("NavigationMode"); if (navigationMode == NavigationMode.Back) { connection.Dispose(); // Make sure everything is clean SettingsService.Clean(); //GC.Collect(); } } catch (Exception e) { Debug.WriteLine(e); } }