You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm coming from a WPF background. I was trying to use a semi-transparent complex element by setting Opacity to < 1. While this worked, the result is not expected since setting Opacity on the root of a complex element seems to make each descendent element get the opacity applied instead of rendering the final result of the complex element at a certain opacity.
See screens below for a very basic example, but keep in mind that in my case, I have a much more complex element that looks awful when all of its parts are showing through each other.
To Reproduce
My test code in both WPF and Avalonia is this where the top half is a fully opaque set of ellipses and the bottom half is the same, but has the containing StackPanel set to 50% opacity:
You can clearly see how the individual Ellipse shapes are all partially transparent, which is very bad when you have a complex element and set opacity on it.
Expected behavior
The expected result as in WPF is:
You can see here the partially transparent StackPanel has its final rendering in tact, but just faded into the background. This is what I would expect in Avalonia too.
Is there any way to achieve this? Otherwise, Opacity is not practical for use.
Even if there is a workaround, I would have expected the WPF-like behavior out of the box.
Desktop (please complete the following information):
OS: Windows
Version 11.0.0-preview2
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm coming from a WPF background. I was trying to use a semi-transparent complex element by setting
Opacity
to <1
. While this worked, the result is not expected since settingOpacity
on the root of a complex element seems to make each descendent element get the opacity applied instead of rendering the final result of the complex element at a certain opacity.See screens below for a very basic example, but keep in mind that in my case, I have a much more complex element that looks awful when all of its parts are showing through each other.
To Reproduce
My test code in both WPF and Avalonia is this where the top half is a fully opaque set of ellipses and the bottom half is the same, but has the containing
StackPanel
set to 50% opacity:The unexpected result in Avalonia is:
You can clearly see how the individual
Ellipse
shapes are all partially transparent, which is very bad when you have a complex element and set opacity on it.Expected behavior
The expected result as in WPF is:
You can see here the partially transparent
StackPanel
has its final rendering in tact, but just faded into the background. This is what I would expect in Avalonia too.Is there any way to achieve this? Otherwise,
Opacity
is not practical for use.Even if there is a workaround, I would have expected the WPF-like behavior out of the box.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: