【发布时间】:2014-08-05 07:21:21
【问题描述】:
我正在创建一个我想要验证文本框的项目,因此为此使用 prism 并实现如下示例
http://msdn.microsoft.com/en-us/library/windows/apps/xx130660.aspx
我实现的一切工作正常,但是当我更改 Page 的 xaml 中的代码时,它找不到我实现的类等。
举例
<prism:VisualStateAwarePage
xmlns:prism="using:Microsoft.Practices.Prism.StoreApps"
xmlns:vm="using:PrismExample.ViewModels"
xmlns:Behaviors="using:PrismExample.Behaviors"
x:Class="PrismExample.Views.UserInfoView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
<Page.DataContext>
**<vm:UserInfoViewModel/>**
</Page.DataContext>
<TextBox x:Name="FirstNameValue" Grid.Row="2"
Text="{Binding UserInfo.FirstName, Mode=TwoWay}">
<interactivity:Interaction.Behaviors>
<!--<Behaviors:HighlightFormFieldOnErrors PropertyErrors="{Binding UserInfo.Errors[FirstName]}">-->
**<quickstartBehaviors:HighlightFormFieldOnErrors** PropertyErrors="{Binding UserInfo.Errors[FirstName]}" />
</interactivity:Interaction.Behaviors>
</prism:VisualStateAwarePage>
现在在这里,粗体文本给出了它在命名空间中不存在的错误。 任何人都可以帮我解决这个问题。我怎样才能摆脱这个。
【问题讨论】:
-
这是全部一个组件吗?还是您的视图模型在不同的程序集中?如果您的视图模型位于不同的程序集中,请确保您引用的是该程序集。
标签: windows-store-apps winrt-xaml prism