private void btnEditQuery_Click(object sender, RoutedEventArgs e) { QueryConfigPopup popup = new QueryConfigPopup(); popup.DataContext = new QueryPopupViewModel() { CurrentQuery = (Model.QueriesRow)((System.Data.DataRowView)QueriesGrid.SelectedValue).Row }; popup.ShowDialog(); }
private void btnEditQuery_Click(object sender, RoutedEventArgs e) { QueryConfigPopup popup = new QueryConfigPopup(); popup.DataContext = new QueryPopupViewModel() { CurrentQuery = vm.SelectedQuery }; popup.ShowDialog(); }
private void btnAddQuery_Click(object sender, RoutedEventArgs e) { QueryConfigPopup popup = new QueryConfigPopup(); var vm = this.DataContext as MainWindowViewModel; Model.QueriesRow NewRow = vm.ActiveModel.Queries.NewQueriesRow(); NewRow.Name = "New Query"; NewRow.MappingType = ""; NewRow.MaxRows = 1; NewRow.QueryText = ""; NewRow.QueryType = ""; NewRow.RefreshRate = 5000; vm.ActiveModel.Queries.AddQueriesRow(NewRow); popup.DataContext = new QueryPopupViewModel() { CurrentQuery = NewRow, }; popup.ShowDialog(); }