Files
CodeContextGenerator/CodeContextGenerator/Views/MainWindow.xaml.cs
2025-12-10 22:25:30 +05:00

33 lines
922 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using CodeContextGenerator.Models;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace CodeContextGenerator.Views;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void ScrollViewer_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
if (sender is ScrollViewer scrollViewer)
{
scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - e.Delta / 3);
e.Handled = true;
}
}
private void CheckBox_Click(object sender, RoutedEventArgs e)
{
if (sender is CheckBox checkBox && checkBox.DataContext is FileItem fileItem)
{
// Синхронизируем состояние чекбокса с ViewModel
fileItem.IsSelected = checkBox.IsChecked;
e.Handled = true;
}
}
}