0

I have this GridView definition in my wpf app, also I'm using ComponentArt

<my1:GridView Name="gridView1" Theme="ArcticWhite" Indent="40" RowClicked="gridView1_RowClicked_1" AllowColumnFreezing="False" AllowRowFreezing="False" ColumnResizingMode="Normal" AllowColumnReordering="False" AutoGenerateColumns="False" IsHitTestVisible="True" ThemeVariant="Standard" Foreground="#FFDBDBCD">
    <my1:GridView.Columns>
        <my1:GridViewTemplateColumn Binding="{Binding}"  Header="Local">
            <my1:GridViewTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Grid Margin="-7,-3,-2,-3" Name="grid1">
                        <Grid.Background>
                            <MultiBinding Converter="{StaticResource BackgroundBrushConverter}">
                                <Binding ElementName="r1" Path="Fill"></Binding>
                                <Binding ElementName="cbColores" Path="IsChecked"></Binding>
                            </MultiBinding>
                        </Grid.Background>
                        <Rectangle Name="r1" Fill="{Binding Converter={StaticResource BrushConverter}}" Width="1" Height="1"></Rectangle>
                        <TextBlock Margin="3" Foreground="Black" Text="{Binding Local}" FontFamily="Calibri" FontWeight="Bold" FontSize="13">
                    <TextBlock.Effect>
                        <DropShadowEffect Color="White" BlurRadius="3" ShadowDepth="0" Opacity="5" />
                    </TextBlock.Effect>
                        </TextBlock>
                    </Grid>
                </DataTemplate>
            </my1:GridViewTemplateColumn.CellTemplate>
        </my1:GridViewTemplateColumn>
        <my1:GridViewTemplateColumn Binding="{Binding}"  Header="Linea">
            <my1:GridViewTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Grid  Margin="-7,-3,-2,-3" Name="grid2">
                        <Grid.Background>
                            <MultiBinding Converter="{StaticResource BackgroundBrushConverter}">
                                <Binding ElementName="r2" Path="Fill"></Binding>
                                <Binding ElementName="cbColores" Path="IsChecked"></Binding>
                            </MultiBinding>
                        </Grid.Background>
                        <Rectangle Name="r2" Fill="{Binding Converter={StaticResource BrushConverter}}" Width="1" Height="1"></Rectangle>
                        <TextBlock Margin="3" Foreground="Black" Text="{Binding Linea}"  FontFamily="Calibri" FontWeight="Bold" FontSize="13">
                    <TextBlock.Effect>
                        <DropShadowEffect Color="White" BlurRadius="3" ShadowDepth="0" Opacity="5" />
                    </TextBlock.Effect>
                        </TextBlock>
                    </Grid>
                </DataTemplate>
            </my1:GridViewTemplateColumn.CellTemplate>
        </my1:GridViewTemplateColumn>
    </my1:GridView.Columns>
</my1:GridView>

When I open the application, the cpu increases to 50-60%, without doing anything; and keeps at that rate until I close the app

Is there something I can do to improve the performance?

Thanks in advance

Naty Bizz
  • 2,262
  • 6
  • 33
  • 52

1 Answers1

0

You could try removing the DropShadowEffects from your cell templates - especially if you have a lot of cells in this grid and virtualization isn't enabled. As I understand it, you should try to avoid using DropShadowEffect and BlurEffect on lots of targets at once.

Dave Cluderay
  • 7,268
  • 1
  • 29
  • 28
  • In addition, if you have many rows try enabling virtualizing stackpanel. If you need dropshadow effect it's more efficient to use 2 textblocks on top of eachother where the bottom one has a slight render offset. – Just another metaprogrammer Aug 09 '12 at 19:18