private void OKButton_Click(object sender, RoutedEventArgs e) { ViewModel.DyeingOrderHeader = dgDyeingOrderResults.SelectedItem as TblDyeingOrderHeaderViewModel; ViewModel.GetDyeingOrderMainDetail(); DialogResult = true; }