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

namespace WPF控件_15_ListBox2;

/// <summary>
///     Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }

    private void ListBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
    {
    }

    private void ListBox_OnClick(object sender, RoutedEventArgs e)
    {
        if (ListBox.SelectedItem == null) return;

        Console.WriteLine($"已选中：{((CheckBox)ListBox.SelectedItem).IsChecked}");
    }
}