我在XAML的顶部定义了以下内容:
<controls:ChildWindow
x:Class="MyProject.SilverlightUI.Views.CharacterGenerator"
xmlns:my="clr-namespace:MyProject.SilverlightUI.ViewModels"
>
<controls:ChildWindow.Resources>
<my:AlignmentsViewModel x:Key="AlignmentsVM" ></my:AlignmentsViewModel>
<CollectionViewSource x:Key="AlignmentListViewSource" Source="{Binding Path=Alignments, Source={StaticResource AlignmentsVM}}"></CollectionViewSource>
</controls:ChildWindow.Resources>
然后稍后我将AlignmentListViewSource用作绑定到组合框的ItemSource。除了设计师不喜欢AlignmentsVM资源外,其他一切似乎都正常工作。它抱怨如下:
[Xml_CannotFindFileInXapPackage]
Arguments: ServiceReferences.ClientConfig
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See [broken hyperlink]
at System.Xml.XmlXapResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
at System.ServiceModel.Configuration.ServiceModelSectionGroup.GetSectionGroup()
我证实了ServiceReferences.ClientConfig文件是SilverlightUI项目的一部分,并标记为“Content”。
AlignmentsViewModel在它的构造函数中调用一个webservice,但是我很确定这是VS设计器的问题,而不是类的问题。我可以编译和运行这个项目,它的运行完全像我希望它从卡西尼号,填充组合框。只是VS设计师不配合。
有谁能告诉我怎样才能让设计师认识到ServiceReferences.ClientConfig有空吗?