-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ShadowContainer on wasm wasn't repainting when unloaded then loaded #1183
Conversation
Not sure who to ping, maybe @kazo0. Is there a way to add a UI test in Toolkit? RenderTargetBitmap isn't available on WASm, so adding runtime tests that do image comparisons is not feasible. For reference, here's a small repro as a diff that can be converted to a test. When the rectangle unloads and loads again, the shadow disappears, which shouldn't happen. Index: samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/App.xaml.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/App.xaml.cs b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/App.xaml.cs
--- a/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/App.xaml.cs (revision e07a955a412551c1357ec6c55cf3c4b761c5111a)
+++ b/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/App.xaml.cs (date 1720649215271)
@@ -1,7 +1,10 @@
using Microsoft.Extensions.Logging;
+using Microsoft.UI.Dispatching;
+using Microsoft.UI.Xaml.Shapes;
using System;
using System.Globalization;
using System.Threading.Tasks;
+using Uno.Extensions;
using Uno.Toolkit.UI;
using Uno.UI;
using Windows.ApplicationModel;
@@ -117,7 +120,29 @@
// This is to allow the splash/loading view to start to render, before we finishing building shell etc
await Task.Yield();
- splash.Content = _shell = BuildShell();
+ var sc = new ShadowContainer()
+ {
+ Shadows = new ShadowCollection().Apply(sc => sc.Add(new Uno.Toolkit.UI.Shadow() { BlurRadius = 50, Color = Microsoft.UI.Colors.FromARGB("#928F99"), Opacity = 0.5 })),
+ Content = new Rectangle()
+ {
+ Width = 100,
+ Height = 100,
+ Fill = new SolidColorBrush(Microsoft.UI.Colors.Red)
+ }
+ };
+ splash.Content = sc;
+
+ DispatcherQueue.GetForCurrentThread().TryEnqueue(DispatcherQueuePriority.Low, async () =>
+ {
+ await Task.Delay(1000);
+ splash.Content = null;
+ DispatcherQueue.GetForCurrentThread().TryEnqueue(DispatcherQueuePriority.Low, async () =>
+ {
+ await Task.Delay(1000);
+ splash.Content = sc;
+ });
+ });
+
loadable.IsExecuting = false;
}
|
@ramezgerges You should be able add UI Tests here: https://github.com/unoplatform/uno.toolkit.ui/blob/main/src/Uno.Toolkit.UITest/Controls/ShadowContainer/Given_ShadowContainer.cs |
88621e3
to
14299d6
Compare
14299d6
to
f938b3f
Compare
@ramezgerges it looks like the test you added is failing. I believe because its failing to navigate to your test page. We have to do some funky hacks for the ShadowContainer tests since it is only available in WinUI and not UWP. you may need to add the ShadowContainerTestPage2 page here: Line 152 in b7fc5f5
and here: Lines 239 to 242 in b7fc5f5
|
@ramezgerges Any chance this may fix any of these ShadowContainer related issues? |
@kazo0 Most likely not, but it's an invalidation issue, so anything with a "this thing should show but it doesn't" problem could be affected. |
GitHub Issue (If applicable): closes unoplatform/uno#17366
PR Type
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements:
Other information
Internal Issue (If applicable):