使用MVVM,Images文件夹应位于Project文件夹下或View as as sub folder?
下我最初在Project文件夹下有Images文件夹:
ImageBrush ImageSource="/DataTransfer;component/Images/image1.png"
一切正常。
然后我将Images文件夹移到View文件夹下,并指定:
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)
......
我需要做些什么来解决它?
答案 0 :(得分:0)
解决。
ImageBrush ImageSource="/DataTransfer;component/View/Images/image2.jpg"
但是这个问题还没有回答。
使用MVVM,Images文件夹应位于Project文件夹下或View as a subfolder?
下