WPF: Force ListView to Update Once on Load for All DataRows
I have a ListView with bindings that cause either cell or row colors to change based on data in an attached DataTable.  The bindings work fine, but it only seems to update the visible range of rows.  So when I scroll through the table, it sets the bindings of each cell as it becomes visible, causing the program to slow down quite a bit.

Is there a way to force the ListView to update once when the page is loaded and then only if an item in the DataTable is changed?

Here is the code for styling ListViewItems in the ListView:

        <Style TargetType="ListViewItem">
            <Setter Property="Height" Value="{Binding ElementName=gridView, Path=ActualHeight, Converter={StaticResource heightConverter}}" />
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            <Setter Property="FocusVisualStyle" Value="{StaticResource ListViewItemFocusVisual}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Margin" Value="0,0,0,1"/>
            <Setter Property="Padding" Value="5,2,5,2"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListViewItem}">
                        <Grid>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2" SnapsToDevicePixels="true">
                                <Border x:Name="InnerBorder" BorderThickness="1" CornerRadius="1">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition MaxHeight="11"/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <Rectangle x:Name="UpperHighlight" Fill="#75FFFFFF" Visibility="Collapsed"/>
                                        <Rectangle Grid.RowSpan="2" Margin="0" Opacity="0.8">
                                            <Rectangle.Fill>
                                                <MultiBinding Converter="{StaticResource hasErrorsConverter}">
                                                    <Binding ElementName="nameLabel" Path="Text" />
                                                    <Binding Path="Errors" />
                                                    <Binding Path="Value" />
                                                </MultiBinding>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <GridViewRowPresenter Grid.RowSpan="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                    </Grid>
                                </Border>
                            </Border>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Background" Value="{StaticResource ListItemHoverFill}"/>
                                <Setter Property="BorderBrush" Value="#FFCCF0FF"/>
                                <Setter Property="Visibility" TargetName="UpperHighlight" Value="Visible"/>
                            </Trigger>
                            <Trigger Property="IsSelected" Value="true">
                                <Setter Property="Background" Value="{StaticResource ListItemSelectedFill}"/>
                                <Setter Property="BorderBrush" Value="#FF98DDFB"/>
                                <Setter Property="BorderBrush" TargetName="InnerBorder" Value="#80FFFFFF"/>
                                <Setter Property="Visibility" TargetName="UpperHighlight" Value="Visible"/>
                                <Setter Property="Fill" TargetName="UpperHighlight" Value="#40FFFFFF"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true"/>
                                    <Condition Property="Selector.IsSelectionActive" Value="false"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" Value="{StaticResource ListItemSelectedInactiveFill}"/>
                                <Setter Property="BorderBrush" Value="#FFCFCFCF"/>
                            </MultiTrigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true"/>
                                    <Condition Property="IsMouseOver" Value="true"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" Value="{StaticResource ListItemSelectedHoverFill}"/>
                                <Setter Property="BorderBrush" Value="#FF98DDFB"/>
                            </MultiTrigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

I have a binding on Height to change the height of the item based on the number of rows and height of the ListView.  I also have a MultiBinding on a Rectangle within the cell which is used to determine which color a particular cell will be.  Both these bindings use overloaded converters.

Thanks in advance for any help!
WPF: Force ListView to Update Once on Load for All DataRows
===

I have a ListView with bindings that cause either cell or row colors to change based on data in an attached DataTable.  The bindings work fine, but it only seems to update the visible range of rows.  So when I scroll through the table, it sets the bindings of each cell as it becomes visible, causing the program to slow down quite a bit.

Is there a way to force the ListView to update once when the page is loaded and then only if an item in the DataTable is changed?

Here is the code for styling ListViewItems in the ListView:

        <Style TargetType="ListViewItem">
            <Setter Property="Height" Value="{Binding ElementName=gridView, Path=ActualHeight, Converter={StaticResource heightConverter}}" />
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            <Setter Property="FocusVisualStyle" Value="{StaticResource ListViewItemFocusVisual}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Margin" Value="0,0,0,1"/>
            <Setter Property="Padding" Value="5,2,5,2"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListViewItem}">
                        <Grid>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2" SnapsToDevicePixels="true">
                                <Border x:Name="InnerBorder" BorderThickness="1" CornerRadius="1">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition MaxHeight="11"/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <Rectangle x:Name="UpperHighlight" Fill="#75FFFFFF" Visibility="Collapsed"/>
                                        <Rectangle Grid.RowSpan="2" Margin="0" Opacity="0.8">
                                            <Rectangle.Fill>
                                                <MultiBinding Converter="{StaticResource hasErrorsConverter}">
                                                    <Binding ElementName="nameLabel" Path="Text" />
                                                    <Binding Path="Errors" />
                                                    <Binding Path="Value" />
                                                </MultiBinding>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <GridViewRowPresenter Grid.RowSpan="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                    </Grid>
                                </Border>
                            </Border>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Background" Value="{StaticResource ListItemHoverFill}"/>
                                <Setter Property="BorderBrush" Value="#FFCCF0FF"/>
                                <Setter Property="Visibility" TargetName="UpperHighlight" Value="Visible"/>
                            </Trigger>
                            <Trigger Property="IsSelected" Value="true">
                                <Setter Property="Background" Value="{StaticResource ListItemSelectedFill}"/>
                                <Setter Property="BorderBrush" Value="#FF98DDFB"/>
                                <Setter Property="BorderBrush" TargetName="InnerBorder" Value="#80FFFFFF"/>
                                <Setter Property="Visibility" TargetName="UpperHighlight" Value="Visible"/>
                                <Setter Property="Fill" TargetName="UpperHighlight" Value="#40FFFFFF"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true"/>
                                    <Condition Property="Selector.IsSelectionActive" Value="false"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" Value="{StaticResource ListItemSelectedInactiveFill}"/>
                                <Setter Property="BorderBrush" Value="#FFCFCFCF"/>
                            </MultiTrigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true"/>
                                    <Condition Property="IsMouseOver" Value="true"/>
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" Value="{StaticResource ListItemSelectedHoverFill}"/>
                                <Setter Property="BorderBrush" Value="#FF98DDFB"/>
                            </MultiTrigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

I have a binding on Height to change the height of the item based on the number of rows and height of the ListView.  I also have a MultiBinding on a Rectangle within the cell which is used to determine which color a particular cell will be.  Both these bindings use overloaded converters.

Thanks in advance for any help!