28 lines
783 B
C#
28 lines
783 B
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace XLAB2
|
|
{
|
|
public partial class SelectInstrumentsWindow : Window
|
|
{
|
|
internal SelectInstrumentsWindow(SelectInstrumentsWindowViewModel viewModel)
|
|
{
|
|
InitializeComponent();
|
|
DataContext = viewModel;
|
|
viewModel.CloseRequested += ViewModelOnCloseRequested;
|
|
}
|
|
|
|
private void ViewModelOnCloseRequested(object sender, bool? dialogResult)
|
|
{
|
|
if (dialogResult.GetValueOrDefault())
|
|
{
|
|
InstrumentsGrid.CommitEdit(DataGridEditingUnit.Cell, true);
|
|
InstrumentsGrid.CommitEdit(DataGridEditingUnit.Row, true);
|
|
}
|
|
|
|
DialogResult = dialogResult;
|
|
Close();
|
|
}
|
|
}
|
|
}
|