Files
XLAB/XLAB2/SelectInstrumentsWindow.xaml.cs
Курнат Андрей d46172beb9 edit
2026-03-24 22:31:05 +03:00

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();
}
}
}