AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
26.06k stars 2.25k forks source link

After upgrading to version 11.2.1, the usercontrol response speed has become very slow. #17585

Open nipeone opened 4 days ago

nipeone commented 4 days ago

Describe the bug

I designed a usercontrol to display search images and text content. Each page shows 20 records, and each record is wrapped in the usercontrol. With version 11.2.0, resizing the mainform was very smooth, but after upgrading to version 11.2.1, the response speed has significantly slowed down, and it feels very laggy.

To Reproduce

<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             x:Class="OmnipocketLiteAvalonia.SearchResultItem">
    <Border BorderBrush="{DynamicResource SystemControlForegroundBaseMediumBrush}" 
            BorderThickness="1" Margin="0,0,0,10" Padding="10" CornerRadius="15">
        <Grid ColumnDefinitions="Auto,*">
            <Image Grid.Column="0"
                   x:Name="DocTypeImage"
                   Width="64"
                   Height="64"
                   Margin="0,0,10,0" />
            <StackPanel Grid.Column="1">
                <TextBlock x:Name="TextContent"
                           TextWrapping="Wrap"
                           Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}"
                           Margin="0,0,0,5"/>
                <Separator Height="1"
                           Margin="0,5,0,5"
                           Background="{DynamicResource SystemControlForegroundBaseLowBrush}"/>
                <Button x:Name="FilePathButton" 
                        Foreground="{DynamicResource SystemControlForegroundBaseMediumBrush}" 
                        FontStyle="Italic"
                        Background="Transparent"
                        BorderThickness="0"
                        Padding="0"
                        HorizontalAlignment="Left"
                        Cursor="Hand"/>
            </StackPanel>
        </Grid>
    </Border>
</UserControl>

Expected behavior

No response

Avalonia version

11.2.1

OS

Windows

Additional context

No response

timunie commented 4 days ago

@nipeone please provide a full minimum sample to reproduce. Also I wonder how you set the data, are you doing it in code behind? Is the image loading async?

nipeone commented 2 days ago

@timunie thks for your reply, i upload code here example code after running, input anything in search box and then press enter. when search results showed, If you drag the border to change the width of the form, version 11.2.1 will be too laggy But this situation will not occur in version 11.2.0.

nipeone commented 2 days ago

i have found another problem.In 11.1.5, my settings button and theme button icon was displayed perfectly, but in versions 11.2.0 and 11.2.1, there were some missing. 11.1.5: 1732349771202 11.2.* 1732349846671

MrJul commented 2 days ago

The slowness in 11.2.1 is fixed by https://github.com/AvaloniaUI/Avalonia/pull/17519 - this fix will be part of 11.2.2.