简体   繁体   English

XAML(cal :)中的Caliburn.micro定义错误

[英]Caliburn.micro definition in XAML (cal:) error

VS2012 detects an error with my definition of the namespace "cal:" , this is my XAML: 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>

I also tried with xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" but the result is the same. 我也尝试了xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"但结果是相同的。

If I execute the application, the Action works well, but the detection of the error disturbs specially with the design preview... 如果我执行应用程序,则Action可以很好地运行,但是错误的检测会特别受设计预览的干扰...

Anybody knows how to fix this error? 有人知道如何解决此错误吗?
Thanks in advance! 提前致谢!

I once got the same kind of error. 我曾经遇到过同样的错误。

If you have added Caliburn.Micro as a project to your solution, then please remove the project reference from your main Project and readd the reference to Calibrun.Micro 如果您已将Caliburn.Micro作为项目添加到解决方案中,请从主项目中删除项目引用,并阅读对Calibrun.Micro的引用。

I had similar problem. 我有类似的问题。 Point your namespace to Caliburn.Micro.Platform 将您的名称空间指向Caliburn.Micro.Platform

... ...
xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro.Platform" ...> xmlns:cal =“ clr-namespace:Caliburn.Micro; assembly = Caliburn.Micro.Platform” ...>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM