-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
- Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
Problem description:
While setting the visual states for the content control, the performance issue occurs even though the application is idle. Please refer the below image. I have created the following visualstategroup and have used the animation to increase the border thickness. Please find the code snippet below.
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="BorderStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Bold">
<Storyboard BeginTime="0">
<ThicknessAnimationUsingKeyFrames BeginTime="0"
Duration="1"
Storyboard.TargetName="Border1"
Storyboard.TargetProperty="BorderThickness">
<EasingThicknessKeyFrame KeyTime="0" Value="5" />
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
And have set the visualstates in the code behind as follows.
VisualStateManager.GoToState(this, "Bold", true);
While running the application, I have found that the continuous memory allocation occurs even when the application is idle. Please find the image below.
Actual behavior:
Cpu performance issue occurs and memory allocation of 1% or 2% occurs even when the application is idle
Expected behavior:
This performance issue should not occurs and memory allocation while application is idle is not acceptable.
Minimal repro:
Please find the attached sample.
Run sample using the performance profiler (Enable the Cpu usage).