MicaWPF icon indicating copy to clipboard operation
MicaWPF copied to clipboard

[Bug]: Hovering over buttons crashes

Open leetftw opened this issue 9 months ago • 0 comments

Describe the bug

I tried creating a simple window like this:

<controls:MicaWindow x:Class="TestApp.TestWindow"  
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
        xmlns:local="clr-namespace:TestApp"  
        xmlns:controls="clr-namespace:MicaWPF.Controls;assembly=MicaWPF"  
        xmlns:mica="clr-namespace:MicaWPF.Styles;assembly=MicaWPF"  
        mc:Ignorable="d" Title="MicaWPF test" d:DesignHeight="471.664" d:DesignWidth="744.295">  
    <controls:MicaWindow.Resources>  
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <mica:ControlsDictionary />
                <mica:ThemeDictionary />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>  
    </controls:MicaWindow.Resources>
    <StackPanel>
        <controls:Button>Test1</controls:Button>
        <controls:Button>Test2</controls:Button>
        <controls:Button>Test3</controls:Button>
    </StackPanel>  
</controls:MicaWindow>

It works, but when hovering over any of the buttons with the mouse, the app crashes with the following exception:

System.Windows.Markup.XamlParseException: 'Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.'
Inner Exception: Cannot find resource named 'MicaWPF.Animations.Common.FasterAnimationDuration'. Resource names are case sensitive.
This exception was originally thrown at this call stack:
    System.Windows.StaticResourceExtension.ProvideValueInternal(System.IServiceProvider, bool)
    MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(System.Windows.Markup.MarkupExtension, System.IServiceProvider)

Steps to reproduce the bug

Create a new .NET 4.7.2 project (using newer csproj format). Install MicaWPF through NuGet. Add the test window as above Run the application and try hovering over the button.

Expected behavior

The application should not crash.

Screenshots

No response

Windows version

Other (Please add the version in additionnal context.)

.Net Version

.Net Framework 4.7.x

.MicaWPF Version

MicaWPF

Additional context

Windows 11 IoT Enterprise LTSC 24H2 (26100.4202)

leetftw avatar Jun 06 '25 12:06 leetftw