Material design in XAML custom mouse hover color WPF

37 views Asked by At

I can't set the mouse hover color, it's somehow always like black with opacity of a value (darkening hover effect), so in short term I would like to set the hover color to let's say "Azure" with an opacity of 0.5 on the controls.

I am trying to build my first WPF App and I am using MaterialDesignInXAml.

I have set all the resources and everything as it has to be, and I get the desired effects and themes.

In short term I would like to set the hover color to let's say "Azure" with an opacity of 0.5 on the controls.

I also noticed that all the controls (listview, Datagrid etc) have the same issue.

I would like to tweak the Menu too, I got the color to work by applying this in the MainWindow.xaml:

   <!-- Top Menu -->
    <Menu Grid.Row="0" Background="AliceBlue" IsMainMenu="True">
        <Menu.Resources>
            <Style TargetType="MenuItem" BasedOn="{StaticResource MaterialDesignMenuItem}">
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <!-- Set the hover color to #FFF2DDFF -->
                        <Setter Property="Background" Value="#FFF2DDFF" />
                    </Trigger>
                </Style.Triggers>
            </Style>
        </Menu.Resources>

But soon as I hover out, the menuitems backcolor turns back to greyish. I would also set custom colors for some states like selected, highlighted, onmouseout etc for a specific menu, but if I use a customcolor.xaml and merge it into the resources, then the animation is gone (MaterialDesign).

Thanks in advance

0

There are 0 answers