0

I saw a few posts, which do a lot of additional stuff. I only want to remove that pesky hover effect thats all. Here is the Page:

<Page x:Class="Athena.Home"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
      xmlns:local="clr-namespace:Athena"
      xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
      mc:Ignorable="d"
      Title="Athena | Main" Height="450" Width="800"
      TextElement.Foreground="{DynamicResource MaterialDesignBody}"
      Background="{x:Null}">
    <Grid Background="{DynamicResource MaterialDesignPaper}">
        <Grid.RowDefinitions>
            <RowDefinition Height="101*"/>
            <RowDefinition Height="124*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="216.6"/>
            <ColumnDefinition Width="216.6"/>
            <ColumnDefinition Width="216.6"/>
        </Grid.ColumnDefinitions>

        <ContentControl Grid.RowSpan="2">
            <Button Style="{x:Null}"  Width="30" Height="30"  x:Name="ThemeToggle" Click="toggleTheme" BorderBrush="Transparent" Margin="10,10,105,408" Foreground="Transparent">
                <Button.Background>
                    <ImageBrush x:Name="BrightSwitch" ImageSource="/Images/BootstrapIcons-MoonFill.png"/>
                </Button.Background>
            </Button>

        </ContentControl>

        <ContentControl Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3">
            <!-- Main -->

        </ContentControl>

        <ContentControl Grid.Column="1" Grid.Row="1">
            <!-- Password Manager -->

        </ContentControl>

        <ContentControl Grid.Column="2" Grid.Row="1">
            <!-- Anti Virus -->

        </ContentControl>

        <ContentControl Grid.Column="3" Grid.Row="1">
            <!-- Backup system -->

        </ContentControl>
    </Grid>
</Page>

This shows my problem. Mouseover default WPF

I have not tried much yet. A lot of research but nothing that lead me to the simple solution I was hoping for. I found this: How do you disable MouseOver effects on a Button in WPF? but it seems a bit more than needed.

  • Re templating the button is the way to go. Cut and paste into a resource dictionary. Merge the resource dictionary in app.xaml. Done. – Andy Feb 09 '23 at 09:24

0 Answers0