-
Notifications
You must be signed in to change notification settings - Fork 773
Open
Open
Copy link
Labels
bugSomething isn't workingSomething isn't workingneeds-triageIssue needs to be triaged by the area ownersIssue needs to be triaged by the area owners
Description
Describe the bug
If I have a Border painted with ImageBrush
<Border
x:Name="MyImage"
Width="100"
Height="100"
CornerRadius="96"
Opacity="0">
<Border.Background>
<ImageBrush ImageSource="ms-appx:///Assets/Owl.jpg" />
</Border.Background>
</Border>It no longer shows after I set its Opacity to 1 in code-behind
MyImage().Opacity(1);If you give Opacity an initial value to something non-zero, like 0.5, it behaves as expected.
Why is this important?
This is blocking my project
Steps to reproduce the bug
- Create a winui3 C++ project
- In
MainWindow.xaml
<StackPanel HorizontalAlignment="Stretch">
<Border
x:Name="MyImage"
Width="100"
Height="100"
CornerRadius="96"
Opacity="0">
<Border.Background>
<ImageBrush ImageSource="ms-appx:///Assets/Owl.jpg" />
</Border.Background>
</Border>
<Button Click="Button_Click">Opacity set</Button>
</StackPanel>- In code-behind
void winrt::WinUI3Cpp::implementation::MainWindow::Button_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Microsoft::UI::Xaml::RoutedEventArgs const& e)
{
MyImage().Opacity(1);
}- Run project, click the button, the image is not shown
Actual behavior
No response
Expected behavior
The image should show after setting its opacity to non-zero
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.7.3: 1.7.250606001
Windows version
Windows 11 (23H2): Build 22631
Additional context
This issue does NOT happen with a regular Image control
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds-triageIssue needs to be triaged by the area ownersIssue needs to be triaged by the area owners