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

How to set adonisExtensions:xyz in Style #175

Open
modmanx opened this issue Nov 19, 2021 · 1 comment
Open

How to set adonisExtensions:xyz in Style #175

modmanx opened this issue Nov 19, 2021 · 1 comment
Labels
question Further information is requested

Comments

@modmanx
Copy link

modmanx commented Nov 19, 2021

Hello, we would like to use for example adonisExtensions:CursorSpotlightExtension.BackgroundBrush in Style, but while program compiles, Button doesnt get CursorSpotlightExtension. If we move this directly to Button, it works as it should. Is there any specific thing we forgot to do?


    <Window.Resources>
        <Style x:Key="ControlsButtonStyle"
           TargetType="Button"
           BasedOn="{StaticResource {x:Type Button}}">
            <!-- does not apply-->
            <Setter Property="adonisExtensions:CursorSpotlightExtension.BackgroundBrush" Value="Red"/>
            <Setter Property="adonisExtensions:CursorSpotlightExtension.BorderBrush" Value="Red"/>

            <!-- this one works fine -->
            <Setter Property="Foreground" Value="{DynamicResource {x:Static adonisUi:Brushes.AccentForegroundBrush}}"/>
            <Setter Property="Background" Value="{DynamicResource {x:Static adonisUi:Brushes.AccentHighlightBrush}}"/>
            <Setter Property="BorderBrush" Value="{DynamicResource {x:Static adonisUi:Brushes.AccentHighlightBrush}}"/>
        </Style>
        </Window.Resources>
@modmanx modmanx added the question Further information is requested label Nov 19, 2021
@irusanov
Copy link

@modmanx
You can see the defined properties in the source, which will give you and idea what to override.
The styles for default buttons can be found here: https://github.com/benruehl/adonis-ui/blob/master/src/AdonisUI.ClassicTheme/DefaultStyles/Button.xaml

I think you need to override the Style Triggers for each state if you're interested in the CursorSpotlightExtension
Otherwise, if you want to override them "globally" for the Button, use these instead:

<Setter Property="adonisExtensions:RippleExtension.BackgroundBrush" Value="Red"/>
<Setter Property="adonisExtensions:RippleExtension.BorderBrush" Value="Red"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants