Esempio n. 1
0
        private void connectTaskComplete(object sender, TaskWorkerEventArgs e)
        {
            ProgressBarVisibility = System.Windows.Visibility.Hidden;
            ProgressBarIsEnabled  = false;

            bool success = false;

            if (e.Results != null && e.Results is bool)
            {
                success = (bool)e.Results;
            }

            if (success == false)
            {
                ConnectButtonContent = "Connect to Database";
                return;
            }

            ConnectIsEnabled = false;
            string searchDefault = Config.Read("default_search").ToLower();;

            switch (searchDefault)
            {
            case "detailed":
                ChangeContent.Select(MainContent.Detailed);
                break;

            case "quick":
            default:
                ChangeContent.Select(MainContent.Quick);
                break;
            }

            // We are done with this control.
        }
        private void settingsCommand(object parameter)
        {
            DialogData settingsData = new DialogData();

            settingsData.WindowTitle = "Settings...";
            settingsData.Topmost     = false;
            settingsData.Background  = ColorSets.HexConverter("#FF1E1E1E");

            DialogBaseWindowViewModel viewmodel      = new SettingsViewModel(settingsData);
            WindowMessageResult       settingsResult = DialogService.OpenDialog(viewmodel, parameter as Window, ShutdownMode.OnLastWindowClose);

            if (settingsResult == WindowMessageResult.Yes)
            {
                ChangeContent.Select(MainContent.Connect);
            }
        }
 private void toggleSearchCommand(object parameter)
 {
     ChangeContent.Select(MainContent.Toggle);
 }