Assets/ComponentsListView.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
 
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Theme.xaml" />
        <ResourceDictionary Source="Style.xaml" />
    </ResourceDictionary.MergedDictionaries>
 
    <DataTemplate x:Key="ComponentsListViewItemDataTemplate">
        <Border BorderBrush="{StaticResource ControlChromeBorderBrush}" BorderThickness="1" Background="{StaticResource ControlChromeBackgroundBrush}" CornerRadius="3" SnapsToDevicePixels="true" Padding="20,18">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" MinWidth="300" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Column="0">
                    <TextBlock Text="{Binding DisplayName}" />
                    <TextBlock Text="{Binding Reason}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
                    <TextBlock Text="{Binding Status}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
                </StackPanel>
                <MenuItem Grid.Column="1" x:Name="ItemCheckBox" IsChecked="{Binding IsSelected, Mode=TwoWay}" IsEnabled="{Binding Enabled}" Command="{Binding OptionComponentCheckBox}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" ContextMenuService.IsEnabled="False" Style="{DynamicResource CheckBoxStyleMenuItem}" VerticalAlignment="Center" Tag="{Binding Type}">
                    <MenuItem.InputBindings>
                        <KeyBinding Key="Space" Command="{Binding InverseIsChecked}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=MenuItem}}"/>
                    </MenuItem.InputBindings>
                </MenuItem>
            </Grid>
            <Border.ContextMenu>
                <ContextMenu>
                    <MenuItem x:Name="DetailsButton" Header="詳細" Command="{Binding DetailsButton}" CommandParameter="{Binding}"/>
                </ContextMenu>
            </Border.ContextMenu>
        </Border>
    </DataTemplate>
 
    <Style x:Key="CheckBoxStyleMenuItem" TargetType="{x:Type MenuItem}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource CheckBoxFocusVisual}"/>
        <Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="IsCheckable" Value="True" />
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Grid x:Name="templateRoot" Background="Transparent" SnapsToDevicePixels="True">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Border x:Name="checkBoxBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" CornerRadius="{StaticResource CornerRadius}" Height="{Binding ElementName=markBackground, Path=ActualHeight}" Width="{Binding ElementName=markBackground, Path=ActualWidth}" />
                        <Border x:Name="markBackground" Background="{StaticResource ControlSelectedBackgroundBrush}" BorderBrush="{StaticResource ControlSelectedBorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" CornerRadius="{StaticResource CornerRadius}" Opacity="0" Padding="2">
                            <Grid>
                                <Path Height="12" Width="12" x:Name="optionMark" Data="F1 M 8.67721,13.8647C 8.75363,13.8647 8.83127,13.8493 8.91013,13.8184C 8.98899,13.7875 9.05607,13.7444 9.11135,13.6891L 14.965,7.83544C 15.0821,7.71838 15.1406,7.57366 15.1406,7.4013C 15.1406,7.22894 15.0821,7.08422 14.965,6.96716C 14.8479,6.85008 14.7032,6.79154 14.5309,6.79154C 14.3585,6.79154 14.2138,6.85008 14.0967,6.96716L 8.67721,12.394L 6.18452,9.89399C 6.06745,9.77691 5.92273,9.71837 5.75038,9.71837C 5.57802,9.71837 5.4333,9.77691 5.31623,9.89399C 5.19916,10.0111 5.14062,10.1558 5.14062,10.3281C 5.14062,10.4045 5.15607,10.4822 5.18696,10.561C 5.21785,10.6399 5.26095,10.707 5.31623,10.7623L 8.24306,13.6891C 8.29834,13.7444 8.36542,13.7875 8.44428,13.8184C 8.52314,13.8493 8.60078,13.8647 8.67721,13.8647 Z " Fill="{StaticResource WindowBackgroundBrush}" Margin="1" Opacity="0" Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                <Rectangle x:Name="indeterminateMark" Fill="{StaticResource WindowBackgroundBrush}" VerticalAlignment="Center" Height="1" Margin="3" Opacity="0"/>
                            </Grid>
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" Grid.Column="1" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasHeader" Value="true">
                            <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}"/>
                            <Setter Property="Padding" Value="5,2"/>
                            <Setter Property="Margin" Value="5"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" TargetName="checkBoxBorder" Value="{StaticResource ControlBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="{StaticResource ControlBorderPointerOverBrush}"/>
                            <Setter Property="Background" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPointerOverBrush}"/>
                            <Setter Property="BorderBrush" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPointerOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="checkBoxBorder" Value="{StaticResource ControlBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="{StaticResource ControlBorderDisabledBrush}"/>
                            <Setter Property="Fill" TargetName="optionMark" Value="{StaticResource ControlForegroundDisabledBrush}"/>
                            <Setter Property="Fill" TargetName="indeterminateMark" Value="{StaticResource ControlForegroundDisabledBrush}"/>
                            <Setter Property="Background" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundDisabledBrush}"/>
                            <Setter Property="BorderBrush" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundDisabledBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" TargetName="checkBoxBorder" Value="{StaticResource ControlBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="checkBoxBorder" Value="{StaticResource ControlBorderPressedBrush}"/>
                            <Setter Property="Fill" TargetName="optionMark" Value="{StaticResource WindowBackgroundBrush}"/>
                            <Setter Property="Fill" TargetName="indeterminateMark" Value="{StaticResource WindowBackgroundBrush}"/>
                            <Setter Property="Background" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPressedBrush}"/>
                            <Setter Property="BorderBrush" TargetName="markBackground" Value="{StaticResource ControlSelectedBackgroundPressedBrush}"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Opacity" TargetName="checkBoxBorder" Value="0"/>
                            <Setter Property="Opacity" TargetName="markBackground" Value="1"/>
                            <Setter Property="Opacity" TargetName="optionMark" Value="1"/>
                            <Setter Property="Opacity" TargetName="indeterminateMark" Value="0"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
</ResourceDictionary>