<UserControl
    x:Class="MECF.Framework.UI.Client.CenterViews.Maintain.ViewModels.MaintainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:OpenSEMI.Ctrlib.Controls"
    xmlns:converter="clr-namespace:MECF.Framework.UI.Client.Ctrlib.Converter"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:micro="clr-namespace:Caliburn.Micro"
    xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
    xmlns:cv="clr-namespace:MECF.Framework.UI.Core.Converters;assembly=MECF.Framework.UI.Core"
    xmlns:behavior="clr-namespace:MECF.Framework.UI.Client.CenterViews.Maintain.Behavior"
    xmlns:local="clr-namespace:MECF.Framework.UI.Client.CenterViews.Maintain"
    xmlns:rtinfo="clr-namespace:MECF.Framework.Common.Aitex.Core.RT.EMS;assembly=MECF.Framework.Common"
    xmlns:core="clr-namespace:System;assembly=mscorlib"
    d:DesignHeight="1024"
    d:DesignWidth="1900"
    mc:Ignorable="d">
    <UserControl.Resources>
        <local:BooleanToUIColorConverter x:Key="maintainTimeOutToUIColorConverter" FalseColor="black" TrueColor="Red"/>
        <local:BooleanToUIColorConverter x:Key="maintainSelectedToUIColorConverter" FalseColor="DarkGray" TrueColor="Orange"/>
        <local:BooleanToUIColorConverter x:Key="IsShowAllItemToUIColorConverter" FalseColor="LightGray" TrueColor="LightGreen"/>
        <local:BooleanToUIColorConverter x:Key="IsShowAllItemToUIColorConverter2" FalseColor="LightGreen" TrueColor="LightGray"/>
        <local:StringNullToUIVisibilityConverter x:Key="stringNullToUIVisibilityConverter"/>
        <local:Booleans2MaintainStatusConverter x:Key="booleans2MaintainStatusConverter"
                                                MaintainImage="/MECF.Framework.UI.Client;component/Resources/Images/done.png"
                                                UnMaintainImage="/MECF.Framework.UI.Client;component/Resources/Images/undone.png"
                                                UnMaintainButTimeOutImage="/MECF.Framework.UI.Client;component/Resources/Images/undonered.png"/>

        <Style x:Key="listboxitem" TargetType="{x:Type ListBoxItem}">
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="Margin" Value="0" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="Rectangle.StrokeThickness" Value="3" />
            <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
            <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        </Style>
        
        <core:Double x:Key="text_fontsize_min">20</core:Double>
        <core:Double x:Key="text_fontsize_max">25</core:Double>

        <Storyboard x:Key="highlightItem">
            <DoubleAnimation By="30" Duration="0:0:0.4" Storyboard.TargetName="border" Storyboard.TargetProperty="Width" />
            <DoubleAnimation From="{StaticResource text_fontsize_min}" To="{StaticResource text_fontsize_max}" Duration="0:0:0.4" Storyboard.TargetName="text" Storyboard.TargetProperty="FontSize" />
            <ColorAnimation From="LightGray" To="#FF57A3D4" Duration="0:0:0.4" Storyboard.TargetName="border" Storyboard.TargetProperty="Background.(Color)"/>
        </Storyboard>
        <Storyboard x:Key="dishighlightItem">
            <DoubleAnimation By="-30" Duration="0:0:0.4" Storyboard.TargetName="border" Storyboard.TargetProperty="Width" />
            <DoubleAnimation From="{StaticResource text_fontsize_max}" To="{StaticResource text_fontsize_min}" Duration="0:0:0.4" Storyboard.TargetName="text" Storyboard.TargetProperty="FontSize" />
            <ColorAnimation From="#FF57A3D4" To="LightGray" Duration="0:0:0.4" Storyboard.TargetName="border" Storyboard.TargetProperty="Background.(Color)"/>
        </Storyboard>

        <Style x:Key="border_style" TargetType="Border">
            <Setter Property="Width" Value="360"/>
            <Setter Property="CornerRadius" Value="4"/>
            <Setter Property="BorderThickness" Value="2"/>
            <Setter Property="Margin" Value="10"/>
            <Setter Property="Background" Value="LightGray"/>
        </Style>
        
        <DataTemplate x:Key="plantemplate" DataType="{x:Type rtinfo:MaintainerInfo}">
            <DataTemplate.Triggers>
                <DataTrigger Value="True" Binding="{Binding IsSelected}">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard Storyboard="{StaticResource highlightItem}" />
                    </DataTrigger.EnterActions>
                    <DataTrigger.ExitActions>
                        <BeginStoryboard Storyboard="{StaticResource dishighlightItem}" />
                    </DataTrigger.ExitActions>
                </DataTrigger>
            </DataTemplate.Triggers>
            <Border x:Name="border" Style="{StaticResource border_style}" BorderBrush="{Binding IsSelected,Converter={StaticResource maintainSelectedToUIColorConverter}}">
                <StackPanel Orientation="Vertical" MinWidth="330">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" x:Name="text" Text="{Binding Module}" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,5,5,0"/>
                        <TextBlock Grid.Column="1" FontSize="16" Text="{Binding ShortType,StringFormat=Type:{0}}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5,5,5,0" Opacity="0.5"/>
                        <deviceControl:AITSensor Grid.Column="2" Width="20" Height="20" IsCustomRender ="True" HorizontalAlignment="Center" VerticalAlignment="Top" EnableToolTip="False" CustomColorOn="LawnGreen" CustomColorOff="Gray" LightOnValue="{Binding IsProcessing}" />
                    </Grid>
                    <TextBlock Text="{Binding Description}" Margin="10" FontSize="15" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"/>
                    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,5,0">
                        <!--不要换行否则文本会有间距-->
                        <Run Text="{Binding Value,StringFormat={}{0:F2}}" FontSize="18" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/><Run Text="{Binding Threshold,StringFormat=/{0:F2}}" FontSize="18" Typography.Variants="Subscript"/><Run Text="{Binding TimeDisplayUnit}" FontSize="15" BaselineAlignment="Bottom"/>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,0">
            <!--不要换行否则文本会有间距-->
            <Run Text="DeadLine:   " FontSize="15" Typography.Variants="Subscript"/><Run Text="{Binding TrigDate}" FontSize="15" Typography.Variants="Subscript"/>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,0">
            <!--不要换行否则文本会有间距-->
            <Run Text="Expired:   " FontSize="15" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/><Run Text="{Binding TimeExceed,StringFormat={}{0:F2}}" FontSize="15" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/>
            <Run Text="{Binding TimeDisplayUnit}" FontSize="15" BaselineAlignment="Bottom"/>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,5">
            <!--不要换行否则文本会有间距-->
            <Run Text="UnMaintained:   " FontSize="15" Typography.Variants="Subscript"/><Run Text="{Binding UnMaintainedCount}" FontSize="15" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/><Run Text="{Binding TotalCount,StringFormat=/{0}}" FontSize="15" Typography.Variants="Subscript"/>
                    </TextBlock>
                </StackPanel>
            </Border>
        </DataTemplate>
        <DataTemplate x:Key="pmtemplate" DataType="{x:Type rtinfo:MaintainerInfo}">
            <DataTemplate.Triggers>
                <DataTrigger Value="True" Binding="{Binding IsSelected}">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard Storyboard="{StaticResource highlightItem}" />
                    </DataTrigger.EnterActions>
                    <DataTrigger.ExitActions>
                        <BeginStoryboard Storyboard="{StaticResource dishighlightItem}" />
                    </DataTrigger.ExitActions>
                </DataTrigger>
            </DataTemplate.Triggers>
            <Border x:Name="border" Style="{StaticResource border_style}" BorderBrush="{Binding IsSelected,Converter={StaticResource maintainSelectedToUIColorConverter}}">
                <StackPanel Orientation="Vertical" MinWidth="330">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" x:Name="text" Text="{Binding Module}" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,5,5,0"/>
                        <TextBlock Grid.Column="1" FontSize="16" Text="{Binding ShortType,StringFormat=Type:{0}}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5,5,5,0" Opacity="0.5"/>
                        <deviceControl:AITSensor Grid.Column="2" Width="20" Height="20" IsCustomRender ="True" HorizontalAlignment="Center" VerticalAlignment="Top" EnableToolTip="False" CustomColorOn="LawnGreen" CustomColorOff="Gray" LightOnValue="{Binding IsProcessing}" />
                    </Grid>
                    <TextBlock Text="{Binding Description}" Margin="10" FontSize="15" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"/>
                    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,5,0">
    <!--不要换行否则文本会有间距-->
    <Run Text="{Binding Value,StringFormat={}{0:F2}}" FontSize="18" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/><Run Text="{Binding Threshold,StringFormat=/{0:F2}}" FontSize="18" Typography.Variants="Subscript"/><Run Text="{Binding TimeDisplayUnit}" FontSize="15" BaselineAlignment="Bottom"/>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,0">
    <Run Text="StartDate:   " FontSize="15" Typography.Variants="Subscript"/><Run Text="{Binding StartDate}" FontSize="15" Typography.Variants="Subscript"/>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,0">
                        <Run Text="TrigDate:   " FontSize="15" Typography.Variants="Subscript"/><Run Text="{Binding TrigDate}" FontSize="15" Typography.Variants="Subscript"/>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,0">
    <!--不要换行否则文本会有间距-->
    <Run Text="Expired:   " FontSize="15" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/><Run Text="{Binding ValueExceed,StringFormat={}{0:F2}}" FontSize="15" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/>
    <Run Text="{Binding TimeDisplayUnit}" FontSize="15" BaselineAlignment="Bottom"/>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,5">
    <!--不要换行否则文本会有间距-->
    <Run Text="UnMaintained:   " FontSize="15" Typography.Variants="Subscript"/><Run Text="{Binding UnMaintainedCount}" FontSize="15" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/><Run Text="{Binding TotalCount,StringFormat=/{0}}" FontSize="15" Typography.Variants="Subscript"/>
                    </TextBlock>
                </StackPanel>
            </Border>
        </DataTemplate>
        <DataTemplate x:Key="pmcoatingtemplate" DataType="{x:Type rtinfo:MaintainerInfo}">
            <DataTemplate.Triggers>
                <DataTrigger Value="True" Binding="{Binding IsSelected}">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard Storyboard="{StaticResource highlightItem}" />
                    </DataTrigger.EnterActions>
                    <DataTrigger.ExitActions>
                        <BeginStoryboard Storyboard="{StaticResource dishighlightItem}" />
                    </DataTrigger.ExitActions>
                </DataTrigger>
            </DataTemplate.Triggers>
            <Border x:Name="border" Style="{StaticResource border_style}" BorderBrush="{Binding IsSelected,Converter={StaticResource maintainSelectedToUIColorConverter}}">
                <StackPanel Orientation="Vertical" MinWidth="330">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" x:Name="text" Text="{Binding Module}" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,5,5,0"/>
                        <TextBlock Grid.Column="1" FontSize="16" Text="{Binding ShortType,StringFormat=Type:{0}}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5,5,5,0" Opacity="0.5"/>
                        <deviceControl:AITSensor Grid.Column="2" Width="20" Height="20" IsCustomRender ="True" HorizontalAlignment="Center" VerticalAlignment="Top" EnableToolTip="False" CustomColorOn="LawnGreen" CustomColorOff="Gray" LightOnValue="{Binding IsProcessing}" />
                    </Grid>
                    <TextBlock Text="{Binding Description}" Margin="10" FontSize="15" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"/>
                    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,5,0">
                        <Run Text="{Binding Value,StringFormat={}{0:F2}}" FontSize="18" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/><Run Text="{Binding Threshold,StringFormat=/{0:F2}mm}" FontSize="18" Typography.Variants="Subscript"/>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,0">
    <Run Text="StartDate:   " FontSize="15" Typography.Variants="Subscript"/><Run Text="{Binding StartDate}" FontSize="15" Typography.Variants="Subscript"/>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,0">
<!--不要换行否则文本会有间距-->
<Run Text="TrigDate:   " FontSize="15" Typography.Variants="Subscript"/><Run Text="{Binding TrigDate}" FontSize="15" Typography.Variants="Subscript"/>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,0">
<Run Text="Expired:   " FontSize="15" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/><Run Text="{Binding ValueExceed,StringFormat={}{0}mm}" FontSize="15" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,5">
<Run Text="UnMaintained:   " FontSize="15" Typography.Variants="Subscript"/><Run Text="{Binding UnMaintainedCount}" FontSize="15" Typography.Variants="Subscript" Foreground="{Binding IsTrigger,Converter={StaticResource maintainTimeOutToUIColorConverter}}"/><Run Text="{Binding TotalCount,StringFormat=/{0}}" FontSize="15" Typography.Variants="Subscript"/>
                    </TextBlock>
                </StackPanel>
            </Border>
        </DataTemplate>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <GroupBox Grid.Column="0" Width="450" Header="Maintenance Group" FontSize="24" BorderThickness="2">
            <ListBox x:Name="listbox" ItemsSource="{Binding InfoList}" SelectedItem="{Binding SelectedItem}" ItemContainerStyle="{StaticResource listboxitem}">
                <i:Interaction.Behaviors>
                    <behavior:ItemChangedTargetItemChangedBehavior TargetListBox="{Binding ElementName=listbox}"/>
                </i:Interaction.Behaviors>
                <ListBox.ItemTemplateSelector>
                    <local:MaintainerDataTemplateSelector PlanMaintainerTemplate ="{StaticResource plantemplate}" PMMaintainerTemplate ="{StaticResource pmtemplate}" PMCoatingMaintainerTemplate="{StaticResource pmcoatingtemplate}"/>
                </ListBox.ItemTemplateSelector>
            </ListBox>
        </GroupBox>
        <GroupBox Grid.Column="1" Header="{Binding SelectedItem.Module}" HeaderStringFormat="{}{0} CheckingList" FontSize="24" BorderThickness="2">
            <DataGrid Margin="5" HorizontalAlignment="Stretch" AutoGenerateColumns="False" CanUserAddRows="False" HorizontalScrollBarVisibility="Auto" ItemsSource="{Binding SelectedMaintainerItemCollection}" RowHeaderWidth="0" SelectionMode="Single" VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling">
                <DataGrid.Columns>
                    <DataGridTemplateColumn Width="Auto" MinWidth="50" Header="UID">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="{x:Type rtinfo:MaintainerItemInfo}">
                                <TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" Text="{Binding UID}" TextWrapping="Wrap"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Width="Auto" MinWidth="180" Header="Item">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="{x:Type rtinfo:MaintainerItemInfo}">
                                <TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center" FontFamily="Arial" 
                    FontSize="14" Foreground="{DynamicResource FG_Black}" Text="{Binding Config.ParentName}" TextWrapping="Wrap"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Width="Auto" MinWidth="200" Header="Name">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="{x:Type rtinfo:MaintainerItemInfo}">
                                <TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center" FontFamily="Arial" 
             FontSize="14" Foreground="{DynamicResource FG_Black}" Text="{Binding Config.Name}" TextWrapping="Wrap"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Width="Auto" MinWidth="450" Header="Description">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="{x:Type rtinfo:MaintainerItemInfo}">
                                <TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center" FontFamily="Arial" Height="auto" Width="auto"
             FontSize="14" Foreground="{DynamicResource FG_Black}" Text="{Binding Config.Description}" TextWrapping="Wrap"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Width="Auto" MinWidth="60" Header="File">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="{x:Type rtinfo:MaintainerItemInfo}">
                                <Image Source="/MECF.Framework.UI.Client;component/Resources/Images/file.png" 
                        Stretch="Uniform" Height="20" Width="20" VerticalAlignment="Center" HorizontalAlignment="Center"
                        Visibility="{Binding Config.FilePath,Converter={StaticResource stringNullToUIVisibilityConverter}}">
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="MouseLeftButtonUp">
                                            <micro:ActionMessage MethodName="FileOpen">
                                                <micro:Parameter Value="{Binding Config.FilePath}" />
                                            </micro:ActionMessage>
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </Image>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Width="Auto" MinWidth="200" Header="Latest Maintain Date">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="{x:Type rtinfo:MaintainerItemInfo}">
                                <TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center" FontFamily="Arial" 
             FontSize="14" Foreground="{DynamicResource FG_Black}" Text="{Binding MaintainedDate}" TextWrapping="Wrap"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Width="Auto" MinWidth="60">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="{x:Type rtinfo:MaintainerItemInfo}">
                                <Image Stretch="Uniform" Height="20" Width="20" VerticalAlignment="Center" HorizontalAlignment="Center">
                                    <Image.Source>
                                        <MultiBinding Converter="{StaticResource booleans2MaintainStatusConverter}">
                                            <Binding Path="IsMaintained"/>
                                            <Binding Path="SelectedItem.IsTrigger" ElementName="listbox"/>
                                        </MultiBinding>
                                    </Image.Source>
                                </Image>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Width="Auto" MinWidth="120" Header="">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="{x:Type rtinfo:MaintainerItemInfo}">
                                <Button Content="Maintain" Width="80" Height="25">
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Click">
                                            <micro:ActionMessage MethodName="SetMaintain">
                                                <micro:Parameter Value="{Binding }" />
                                                <micro:Parameter Value="{Binding ElementName=listbox,Path=SelectedItem}" />
                                            </micro:ActionMessage>
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </Button>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </DataGrid>
        </GroupBox>
        
    </Grid>
</UserControl>
