wpfui
wpfui copied to clipboard
Cannot access Freezable 'System.Windows.Media.SolidColorBrush' across threads
Describe the bug
System.Windows.Markup.XamlParseException: 'Initialization of 'System.Windows.Controls.Primitives.StatusBar' threw an exception.' InvalidOperationException: Cannot access Freezable 'System.Windows.Media.SolidColorBrush' across threads because it cannot be frozen.
To Reproduce
use wpfui in a app which does not have any app.xaml, Add Resources in MainWindow:
Application.Current.Resources.MergedDictionaries.Add(new ThemesDictionary { Theme = Wpf.Ui.Appearance.ApplicationTheme.Dark });
Application.Current.Resources.MergedDictionaries.Add(new ControlsDictionary());
Try to Close Window and we get exception
Expected behavior
app should be closed without error
Screenshots
No response
OS version
Windows 11-22631
.NET version
472
WPF-UI NuGet version
latest-preview
Additional context
No response
This line should be DynamicResource
I guess.
https://github.com/lepoco/wpfui/blob/8afb0d93bfa2dfde04672707f2563ad1fd981658/src/Wpf.Ui/Resources/Theme/Dark.xaml#L321
https://github.com/lepoco/wpfui/blob/8afb0d93bfa2dfde04672707f2563ad1fd981658/src/Wpf.Ui/Resources/Theme/Light.xaml#L321