【发布时间】:2011-10-28 18:57:43
【问题描述】:
我想在子窗口中使用视图模型定位器。 问题是这不起作用:
<controls:ChildWindow x:Class="Views.PopupViews.AddAlert"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr namespace:System.Windows.Controls;assembly=System.Windows.Controls"
DataContext="{Binding AddAlert, Source={StaticResource Locator}}>
我得到错误: 找不到具有名称/密钥定位符的资源
【问题讨论】:
-
你最后错过了“”。我修好了,试试看:DataContext="{Binding AddAlert, Source={StaticResource Locator}}">
标签: silverlight-4.0 mvvm-light childwindow viewmodellocator