You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
When the button is clicked, the LoadView function is called and the view is replaced.
The expected behavior occurs when the user clicks the button with the cursor.
But when the HotKey is used, the application crashes.
Unhandled exception. System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at Avalonia.Input.KeyboardDevice.ProcessRawEvent(RawInputEventArgs e) in /_/src/Avalonia.Input/KeyboardDevice.cs:line 224
at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e) in /_/src/Avalonia.Input/InputManager.cs:line 37
at Avalonia.Win32.WindowImpl.AppWndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs:line 468
at Avalonia.Win32.WindowImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/WindowImpl.WndProc.cs:line 33
at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 157
at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 61
at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 116
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 148
The text was updated successfully, but these errors were encountered:
Describe the bug
Avalonia crashes when a new View is loaded after using a HotKey.
To Reproduce
Create a new Project
Add a UserControl to MainWindowView
<UserControl Content="{Binding ViewModel}"></UserControl>
Add a ViewModel Property and a function to load a new View to MainWindowViewModel.
Create a View containing a Button with a HotKey, like this
<Button HotKey="f1" Command="{Binding ButtonClickCommand}" Content="{Binding SomeText}"/>
Create a ViewModel for the view
Expected behavior
When the button is clicked, the LoadView function is called and the view is replaced.
The expected behavior occurs when the user clicks the button with the cursor.
But when the HotKey is used, the application crashes.
Additional context
Related Issues and pull requests
#5054
#5055
Exception
The text was updated successfully, but these errors were encountered: