44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
|
|
namespace XLAB
|
|
{
|
|
public partial class MainWindow : Window
|
|
{
|
|
private readonly MainWindowViewModel _viewModel;
|
|
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
_viewModel = new MainWindowViewModel(new PsvDataService(), new DialogService(this));
|
|
DataContext = _viewModel;
|
|
}
|
|
|
|
private void DocumentListItem_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
|
{
|
|
var item = sender as ListBoxItem;
|
|
if (item != null)
|
|
{
|
|
item.IsSelected = true;
|
|
item.Focus();
|
|
}
|
|
}
|
|
|
|
private void DocumentLineRow_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
|
{
|
|
var row = sender as DataGridRow;
|
|
if (row != null)
|
|
{
|
|
row.IsSelected = true;
|
|
row.Focus();
|
|
}
|
|
}
|
|
|
|
private async void Window_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
await _viewModel.InitializeAsync();
|
|
}
|
|
}
|
|
}
|