Closed rushdrive closed 5 years ago
If I understood you correctly, the error appears only at design time and does not lead to failed builds or runtime errors. I created a fresh project myself and can verify that the error shows up when I activate the XAML designer. I had it permanently disabled because in my opinion it brings more problems than it solves especially in large applications. I will try to find the reason for the error message though.
Instead of using the ResourceLocator
syntax here, you can also replace the two lines with the following ones:
<ResourceDictionary Source="pack://application:,,,/AdonisUI;component/ColorSchemes/Dark.xaml" />
<ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/Resources.xaml" />
They have the completely identical effect. I just prefer the ResourceLocator syntax as it is more readable.
Adding the resources like you've suggested solves all the issues for me. Thank you!
And yeah, it does not cause any build/run-time errors. I use the Designer for visual feedback, and styles not applying there was confusing. This seems like a false positive from Visual Studio with a pretty bad error message.
If the error is indeed due to a VS bug, do you think the alternative syntax you suggested should be mentioned in the readme/docs?
Glad it helped you.
Unfortunately, I cannot spot what produces the error. I mean, it is only a static property containing a Uri
. Not much I can play around with.
I agree that it might be better to mention this behavior in the readme or maybe replace the two lines with the working ones. Too bad the XAML designer failes here. I was glad I found a way to hide the pack syntax, but it's not much worth if it does not work correctly.
Changed it in the readme and the demo application as I think there are many people using the XAML designer. Thanks for spotting and reporting it!
This seems to be related to #25 and it's still present in VS2019 (16.4).
Using
.NET Framework 4.6.1
and I have installedAdonisUI
andAdonisUI.ClassicTheme
latest versions via NuGet and they are referenced correctly in the project.App.xaml
MainWindow.xaml
Issues:
Both lines in
App.xaml
are getting the following error:Value cannot be null. Parameter name: item
.I have tried multiple fresh projects, building and rebuilding and I keep getting this error. I am able to build the project and I can see the styles (DarkColorScheme) correctly applied on
MainWindow
. However the styles don't appear on the designer window, I'm not sure if it's related to the error I'm getting or not.Any ideas what could cause this?