Files
XLAB/XLAB2/AccountingBookDirectoryWindow.xaml.cs
Курнат Андрей a2b4762702 edit
2026-04-03 21:06:10 +03:00

36 lines
1.0 KiB
C#

using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace XLAB2
{
public partial class AccountingBookDirectoryWindow : Window
{
private readonly AccountingBookDirectoryWindowViewModel _viewModel;
internal AccountingBookDirectoryWindow(DocumentNumberDirectoryService documentNumberDirectoryService)
{
InitializeComponent();
_viewModel = new AccountingBookDirectoryWindowViewModel(
documentNumberDirectoryService,
new DialogService(this, documentNumberDirectoryService));
DataContext = _viewModel;
}
private void DataGridRow_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
var row = sender as DataGridRow;
if (row != null)
{
row.IsSelected = true;
row.Focus();
}
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
_viewModel.Initialize();
}
}
}