C# XAML中的Caliburn.micro定义(cal:)错误
C# XAML中的Caliburn.micro定义(cal:)错误,c#,wpf,xaml,caliburn.micro,C#,Wpf,Xaml,Caliburn.micro,VS2012检测到我的命名空间定义中有错误“cal:,这是我的XAML: <Window x:Class="TOP.MainWindowView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.calibu
VS2012
检测到我的命名空间定义中有错误“cal:,这是我的XAML:
<Window x:Class="TOP.MainWindowView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cal="http://www.caliburnproject.org"
Title="MainWindow" Width="1024" Height="768">
<Grid>
<ContentControl x:Name="ActiveItem" Background="#FFCB8282" Margin="0,10,0,205"/>
<ItemsControl x:Name="Items" Margin="0,337,0,0" >
<ItemsControl.ItemTemplate>
<DataTemplate >
<Button Content="{Binding DisplayName}"
cal:Message.Attach="[Action ActivateItem($this)" Height="100" Width="100" Margin="20,0,0,0"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</Grid>
</Window>
我还尝试了xmlns:cal=“clr namespace:Caliburn.Micro;assembly=Caliburn.Micro”
,但结果是一样的
如果我执行应用程序,操作会很好地工作,但是错误的检测会特别干扰设计预览
有人知道如何修复此错误吗?提前谢谢 我曾经犯过同样的错误
如果您已将
Caliburn.Micro
作为项目添加到解决方案中,请从主项目中删除项目引用,并读取对Calibrun.Micro的引用我也有类似问题。将命名空间指向Caliburn.Micro.Platform
…
xmlns:cal=“clr命名空间:Caliburn.Micro;assembly=Caliburn.Micro.Platform”
…>我没有一个单独的项目“Caliburn.Micro”,在我的解决方案中只有一个项目(顶部)。我删除并重新阅读了引用,但错误仍然存在:-(@Charleh,很抱歉响应太晚。我通过NuGet添加了它。