using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace eSuite.WorkBench
{
    public partial class MainWindow : Window, IMainWindow
    {
        public MainWindow(IMainWindowViewModel mainWindowViewModel)
        {
            InitializeComponent();
            DataContext = mainWindowViewModel;
        }

        private void TreeViewItem_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (sender is TreeViewItem treeViewItem)
            {
                if (!treeViewItem.HasItems)
                    treeViewItem.IsSelected = true;
            }
        }
    }
}
