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; } }
public MainViewViewModel() { DefaultCommand = new Commands.DefaultCommand(MainViewCommands); DatabaseLocation = Settings.DbLocation; Tables = DatabaseActions.GetTableNames(Settings.DbLocation); }