private void Select() { SQLiteKei.Views.Windows.SelectQueryWindow window; if (lastSelect == null) { window = new SQLiteKei.Views.Windows.SelectQueryWindow(new SelectQueryViewModel(tableName)); } else { window = new SQLiteKei.Views.Windows.SelectQueryWindow(lastSelect); } if (window.ShowDialog().Value) { StatusInfo = string.Empty; var windowViewModel = window.DataContext as SelectQueryViewModel; logger.Info("Executing Select command on table records tab:" + Environment.NewLine + windowViewModel.SelectQuery.Replace("\n", Environment.NewLine)); Execute(windowViewModel.SelectQuery); lastSelect = windowViewModel; } }
public SelectQueryWindow(SelectQueryViewModel viewModel) { InitializeComponent(); DataContext = viewModel; }