<ItemsControl Margin="0,10,0,0" ItemsSource="{Binding SpotCheckData}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel
Orientation="Vertical"
IsVirtualizing="True"
VirtualizationMode="Recycling"
VirtualizingPanel.CacheLength="25"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type Models:SpotCheckItemData}">
<Grid Margin="55,0,0,0" Width="1110">
<Border
Name="flickerBorder"
Margin="0,0,0,0"
Height="40"
Width="1015"
CornerRadius="8"
BorderThickness="1"
HorizontalAlignment="Left"
VerticalAlignment="Top"
BorderBrush="Transparent"
Background="#FFD700"
Opacity="0">
</Border>
<StackPanel
Margin="5,0,67,0"
Orientation="Horizontal"
Height="40">
<TextBlock
Width="45"
Margin="0,8,0,0"
TextAlignment="Center"
Text="{Binding PLCPointPosition}">
</TextBlock>
<ToggleButton
Margin="26,10,0,0"
IsChecked="{Binding Result}"
IsEnabled="False"
<TextBlock
Margin="30,9,0,0"
Width="260"
Text="{Binding Name}">
</TextBlock>
<TextBox
Width="100"
Height="30"
Margin="25,5,0,0"
IsEnabled="False"
Text="{Binding TheoryCount}" />
<TextBox
Width="100"
Height="30"
Margin="25,5,0,0"
IsEnabled="False"
Text="{Binding RealCount}" />
<TextBox
Width="100"
Height="30"
Margin="25,5,0,0"
IsEnabled="False"
Text="{Binding TheoryHourCount}" />
<TextBox
Width="100"
Height="30"
Margin="25,5,0,0"
IsEnabled="False"
Text="{Binding RealHourCount}" />
<TextBox
Name="ThresholdValueTextBox"
Width="100"
Height="30"
Margin="25,5,0,0"
IsEnabled="False"
Foreground="{Binding ForegroundText,Mode=TwoWay}"
Text="{Binding ThresholdValue}" />
</StackPanel>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=ThresholdValue,Converter={StaticResource ThresholdValueConverter}}">
<DataTrigger.Value>true</DataTrigger.Value>
<DataTrigger.EnterActions>
<BeginStoryboard Name="flickerStoryboard">
<Storyboard Storyboard.TargetName="flickerBorder" RepeatBehavior="Forever" AutoReverse="True" Timeline.DesiredFrameRate="20">
<DoubleAnimation
Storyboard.TargetProperty="Opacity"
From="0" To="0.5" Duration="0:0:1.5"/>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
<DataTrigger Binding="{Binding Path=ThresholdValue,Converter={StaticResource ThresholdValueConverter}}">
<DataTrigger.Value>false</DataTrigger.Value>
<DataTrigger.EnterActions>
<RemoveStoryboard BeginStoryboardName="flickerStoryboard"></RemoveStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
<!--<DataTrigger Binding="{Binding Path=ThresholdValue,Converter={StaticResource ThresholdValueConverter}}" Value="False">
<Setter TargetName="ThresholdValueTextBox" Property="Foreground" Value="Red"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=ThresholdValue,Converter={StaticResource ThresholdValueConverter}}" Value="True">
<Setter TargetName="ThresholdValueTextBox" Property="Foreground" Value="#01E9FA"/>
</DataTrigger>-->
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.Template>
<ControlTemplate TargetType="ItemsControl">
<ScrollViewer
Margin="0,0,0,0"
Width="1130"
Height="700"
VerticalScrollBarVisibility="Auto"
CanContentScroll="True"
SnapsToDevicePixels="True"
Style="{DynamicResource ParameterBorderScrollViewer}">
<ItemsPresenter />
</ScrollViewer>
</ControlTemplate>
</ItemsControl.Template>
</ItemsControl>