【发布时间】:2015-04-20 16:12:54
【问题描述】:
我正在构建一个 Windows Phone 8.1 项目,并且我正在使用仅 MVVM Light Libraries 库。 我创建了一个 PCL 项目来保存我的 ViewModel,以便以后可以将它们用于 Windows Store 项目。
但我在标题中遇到了错误?
我的 App.xaml
<Application
x:Class="Roadsmart.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Roadsmart"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="clr-namespace:Roadsmart.Lib.ViewModels;assembly=Roadsmart.Lib"
mc:Ignorable="d">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/RoadSmartWindowsPhoneStyle.xaml"/>
<ResourceDictionary Source="Resources/Dictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>
<viewModels:ViewModelLocator
x:Key="Locator"
d:IsDataSource="True"/>
</ResourceDictionary>
</Application.Resources>
</Application>
我在 Windows Phone 项目中引用了 Roadsmart.Lib。
我的 Lib 项目属性
但是 Blend 能够找到我的 ViewModel 吗?
但我无法构建、运行。 我也试过打扫。
有人知道我做错了什么吗?
提前致谢
【问题讨论】:
-
首先进行基本检查:您的第一个捕获显示您已将
Roadsmart.Lib项目添加到您的解决方案中,但您是否正确引用了它? (基本上,如果你展开Roadsmart项目中的引用,它就会列出?) -
感谢您的回复,已参考。查看更新的屏幕截图
标签: c# xaml windows-phone-8 mvvm viewmodellocator