34 lines
906 B
C#
34 lines
906 B
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
|
|
namespace XLAB2
|
|
{
|
|
public partial class SpoiDirectoryWindow : Window
|
|
{
|
|
private readonly SpoiDirectoryWindowViewModel _viewModel;
|
|
|
|
public SpoiDirectoryWindow()
|
|
{
|
|
InitializeComponent();
|
|
_viewModel = new SpoiDirectoryWindowViewModel(new PsvDataService(), new DialogService(this));
|
|
DataContext = _viewModel;
|
|
}
|
|
|
|
private void DataGridRow_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();
|
|
}
|
|
}
|
|
}
|