Skip to content
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

RadialGradientBrush doesn't respond to the change of ThemeResource. #2733

Closed
Berrysoft opened this issue Jan 9, 2019 · 5 comments
Closed
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior

Comments

@Berrysoft
Copy link

I'm submitting a bug of RadialGradientBrush

I set the Color of the GradientStop of a RadialGradientBrush to a ThemeResource color like SystemAccentColor.

Current behavior

The color doesn't change after I change the system accent color.

Expected behavior

It should change correctly just like LinearGradientBrush.

Minimal reproduction of the problem with instructions

<Page
    x:Class="RadialGradientBrushTest.MainPage"
    ...
    xmlns:media="using:Microsoft.Toolkit.Uwp.UI.Media"
    ...>
    <Page.Resources>
        <media:RadialGradientBrush x:Key="MyRadialGradientBrush">
            <GradientStop Offset="0" Color="{ThemeResource SystemAccentColorLight3}"/>
            <GradientStop Offset="1" Color="{ThemeResource SystemAccentColorDark3}"/>
        </media:RadialGradientBrush>
        <LinearGradientBrush x:Key="MyLinearGradientBrush">
            <GradientStop Offset="0" Color="{ThemeResource SystemAccentColorLight3}"/>
            <GradientStop Offset="1" Color="{ThemeResource SystemAccentColorDark3}"/>
        </LinearGradientBrush>
    </Page.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Ellipse Grid.Column="0" Grid.Row="0" Width="400" Height="400" Fill="{StaticResource MyRadialGradientBrush}"/>
        <Rectangle Grid.Column="1" Grid.Row="0" Width="400" Height="400" Fill="{StaticResource MyLinearGradientBrush}"/>
        <TextBlock Grid.Column="0" Grid.Row="1" Style="{ThemeResource TitleTextBlockStyle}" HorizontalAlignment="Center">RadialGradientBrush</TextBlock>
        <TextBlock Grid.Column="1" Grid.Row="1" Style="{ThemeResource TitleTextBlockStyle}" HorizontalAlignment="Center">LinearGradientBrush</TextBlock>
    </Grid>
</Page>

Run the app and change the system accent color. The rectangle changes correctly while the ellipse doesn't.

Environment

Nuget Package(s): 
Microsoft.Toolkit.Uwp.UI
Package Version(s): 
v5.0.0
Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [x] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ ] 2017 Preview (version: )
- [x] 2019 Preview 1.1
@windowstoolkitbot
Copy link

No response from the community. ping @nmetulev @Odonno @IbraheemOsama

@windowstoolkitbot
Copy link

This issue seems inactive. It will automatically be closed in 14 days if there is no activity.

@Berrysoft
Copy link
Author

So maybe I should say something to keep it active?

@windowstoolkitbot
Copy link

This issue seems inactive. It will automatically be closed in 14 days if there is no activity.

@Bmartin2013 Bmartin2013 added the bug 🐛 An unexpected issue that highlights incorrect behavior label Feb 22, 2019
@michael-hawker michael-hawker added this to the 6.0 milestone Mar 6, 2019
@Kyaa-dost Kyaa-dost added the no-recent-activity 📉 Open Issues that require attention label Oct 2, 2019
@michael-hawker michael-hawker modified the milestones: 6.0, 6.1 Oct 24, 2019
@michael-hawker michael-hawker removed this from the 6.1 milestone May 26, 2020
@michael-hawker
Copy link
Member

@Berrysoft the RadialGradientBrush has been added to the most recent release of WinUI. Can you check their implementation out, I believe it should handle these scenarios. If not, can you open an issue on their repo. Thanks!

@ghost ghost removed the no-recent-activity 📉 Open Issues that require attention label May 26, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jul 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior
Projects
None yet
Development

No branches or pull requests

6 participants