edit
This commit is contained in:
35
XLAB2/AccountingBookDirectoryWindow.xaml.cs
Normal file
35
XLAB2/AccountingBookDirectoryWindow.xaml.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user