Open mslukebo opened 7 months ago
Update: I don't know what changed, but the VisualBrush
workaround I shared stopped working, and the bug repros with that now. @Kuldeep-MS and @dipeshmsft can I get an update on this bug? There are now no workarounds to this issue.
We just upgraded our application to .NET 8 from .NET 6 and now we have this problem too. The difference for us is, we were using a second UI thread and a HostVisual to run the progress bar on a second thread, so long running tasks don't make it stutter. Would love for this to get fixed, or to have a workaround.
Description
When using a
BitmapCacheBrush
whoseTarget
is aProgressBar
withIndeterminate="True"
, the rendered control does not animate.Reproduction Steps
Create a new WPF project that targets either .NET 7 (
net7.0-windows
) or .NET 8 (net8.0-windows
).Add the following code to
MainWindow.xaml
:Run the application.
Expected behavior
An animated, indeterminate progress bar should be rendered. This is the behavior on .NET 6.
Actual behavior
A static, completely filled progress bar is rendered:
Regression?
This is a regression; it used to work in .NET 6.
Known Workarounds
Instead of using a
BitmapCacheBrush
, you can use aVisualBrush
and assign itsVisual
property to the progress bar (instead of theBitmapCacheBrush.Target
property). This fixes the UI, but obviously is less ideal than using aBitmapCacheBrush
.Impact
My application uses many progress bars that we synchronize and reduce their overhead with by using the bitmap cache. This bug breaks all of those bars.
Configuration
No response
Other information
No response