protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            string url   = e.Uri.ToString();
            int    index = url.IndexOf('?');

            _connection = App.Context.Connections.FirstOrDefault(c => c.Id == url.Substring(index + 1));

            if (_connection != null)
            {
                if (_connection.Xbmc.IsMocked)
                {
                    ButtonMovies.Visibility    = Visibility.Collapsed;
                    ButtonMusic.Visibility     = Visibility.Collapsed;
                    ButtonAddons.Visibility    = Visibility.Collapsed;
                    ButtonPlaylists.Visibility = Visibility.Collapsed;
                }
                else
                {
                    ButtonMovies.Visibility    = Visibility.Visible;
                    ButtonMusic.Visibility     = Visibility.Visible;
                    ButtonAddons.Visibility    = Visibility.Visible;
                    ButtonPlaylists.Visibility = Visibility.Visible;
                }

                BtActions.DataContext = _connection;
                App.Context.SetDefaultConnection(_connection);
                App.Context.Save();

                await _connection.TestConnectionAsync();

                return;
            }

            if (NavigationService.CanGoBack)
            {
                NavigationService.GoBack();
            }
        }
        private async void TestButtonClick(object sender, RoutedEventArgs e)
        {
            if (!AreInformationValid())
            {
                return;
            }

            IsLoading = true;

            try
            {
                var result = await _connection.TestConnectionAsync();

                string message = result ? AppResources.Page_Settings_Test_Good : AppResources.Page_Settings_Test_Bad;
                MessageBox.Show(message, AppResources.Page_Settings_Connectivity_Test, MessageBoxButton.OK);

                App.Context.Save();
            }
            finally
            {
                IsLoading = false;
            }
        }