使用 MVVM,Images 文件夹应该在 Project 文件夹下还是在 View as 子文件夹下?
我最初在 Project 文件夹下有 Images 文件夹:
ImageBrush ImageSource="/DataTransfer;component/Images/image1.png"
一切正常。
然后我将图像文件夹移动到视图文件夹下并指定:
ImageBrush ImageSource="/DataTransfer/View/Images/image1.png"
它抛出:
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
......
我需要做什么来修复它?