优化RecipeEditor滚动方式,取消实时滚动以减缓卡顿。

This commit is contained in:
DESKTOP-GPE37UV\THINKAPD 2022-12-02 17:19:02 +08:00
parent ee614cc2e8
commit cf78fc0eb0
3 changed files with 4 additions and 3 deletions

View File

@ -55,7 +55,7 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="True">
<ScrollViewer Name="DG_ScrollViewer" Focusable="false">
<ScrollViewer Name="DG_ScrollViewer" Focusable="false" IsDeferredScrollingEnabled="True">
<ScrollViewer.Template>
<ControlTemplate TargetType="{x:Type ScrollViewer}">
<Grid>
@ -325,7 +325,7 @@
Storyboard.TargetProperty= "Opacity"
From="0"
To="1"
Duration="0:0:1.0" AutoReverse="False"/>
Duration="0:0:0.300" AutoReverse="False"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>

View File

@ -1529,6 +1529,7 @@
Width="{Binding ElementName=dgContainer, Path=Height}"
Height="{Binding ElementName=dgContainer, Path=Width}"
SelectedItemsList="{Binding SelectedRecipeSteps, Mode=OneWayToSource, Converter={StaticResource SelectedRecipeStepsToList}}"
ItemsSource="{Binding CurrentRecipe.Steps}"
LoadingRow="DgCustom_OnLoadingRow"
UnloadingRow="DgCustom_OnUnloadingRow"
BeginningEdit="DgCustom_OnBeginningEdit">

View File

@ -481,7 +481,7 @@ namespace SicUI.Models.RecipeEditors
});
u.dgCustom.ItemsSource = CurrentRecipe.Steps;
//u.dgCustom.ItemsSource = CurrentRecipe.Steps;
u.dgCustom.LostFocus += DgCustom_LostFocus;
u.dgCustom.CellEditEnding += DgCustomOnCellEditEnding;
u.dgCustom.LoadingRow += DgCustomOnLoadingRow;