예제 #1
0
        private void MainViewCommands(object obj)
        {
            switch (obj.ToString())
            {
            case "fetchData":
                ListViewContent = DatabaseActions.GetTableContent(Settings.DbLocation, SelectedTable);
                break;

            case "changeDatasource":
                OpenFileDialog fDialog = new OpenFileDialog();
                if (fDialog.ShowDialog() == true)
                {
                    DatabaseLocation    = fDialog.FileName;
                    Settings.DbLocation = fDialog.FileName;
                    Tables = DatabaseActions.GetTableNames(Settings.DbLocation);
                }
                break;
            }
        }
예제 #2
0
 public MainViewViewModel()
 {
     DefaultCommand   = new Commands.DefaultCommand(MainViewCommands);
     DatabaseLocation = Settings.DbLocation;
     Tables           = DatabaseActions.GetTableNames(Settings.DbLocation);
 }