XAML无法找到命名空间。有时

时间:2017-03-14 16:04:18

标签: c# wpf xaml namespaces

可能是一个Visual Studio错误,但它绝对令人愤怒,我无法找到解决方案,甚至找不到它的原因。

在我的应用程序中,我在可停靠面板的命名空间Static Content中有一个XAML文件列表。

程序运行正常,程序中的任何地方都没有任何错误,除了一些任意警告。

一些XAML

<Window x:Class="Shell" 
    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sc="clr-namespace:StaticContent"
    xmlns:ve="clr-namespace:View_Edit"
    Title="View" Width="1024" Height="800" Icon="/component/Images/View.png" 
    Loaded="OnLoaded" IsVisibleChanged="isVisibleChanged" Closing="OnClosing" Background="#E9ECFB"
    WindowStyle="None">

<Grid x:Name="DockingRegion" Margin="0,50,0,0">
        <ad:DockingManager x:Name="DockManager">
            <ad:ResizingPanel>
                <ad:DocumentPane Margin="0,0,10,0">
                    <sc:StartPage Title="Home Page" VerticalContentAlignment="Stretch" 
                        onProjectOpenFail="StartPage_onProjectOpenFail" 
                        onProjectOpenSuccess="StartPage_onProjectOpenSuccess"
                        onProjectCreateSuccess="StartPage_onProjectCreateSuccess"
                        onProjectCreateFail="StartPage_onProjectCreateFail"/>
                </ad:DocumentPane>
                <ad:DockablePane ad:ResizingPanel.ResizeWidth="300" x:Name="ExplorerPane" FontSize="14" FontWeight="Bold">
                    <sc:AboutTab x:Name="about" Title="About" FontSize="14" FontWeight="Bold"/>
                    <sc:ProcessExplorer x:Name="pxProcessExplorer" Title="Process Explorer" FontSize="14"/>
                    <sc:DataExplorer x:Name="adDataExplorer" Title="Data Explorer" FontSize="14"/>
                    <!--<sc:UREPExplorer x:Name="adUREPExplorer" Title="UREP Custom Navigation" FontSize="14" Visibility="Hidden"/>-->
                </ad:DockablePane>
            </ad:ResizingPanel>
        </ad:DockingManager>
    </Grid>

标记sc:是名称空间StaticContent。命名空间包括这些文件。今天早上打开项目时,它无法找到引用XAML页面的命名空间。在重新构建了多次并接收了一些&#34;重建失败&#34;之后,它才刚刚决定工作?

任何想法?

1 个答案:

答案 0 :(得分:0)

静态内容&#39;在另一个集会下定义?

如果是这样,请查看项目的属性,然后在“默认名称空间”下查看&#39; 如果它符合你的预期。

相关问题