域名出现两次错误

时间:2013-09-30 00:16:01

标签: c# .net wpf

我已经创建了一个这样的WPF窗口:

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ReVVed" x:Class="ReVVed.Merge_Text_Window"
    MinWidth="400" MinHeight="400" Width="600" Height="400" WindowStyle="ToolWindow" Title="Merge Text" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded">

我编译了代码并尝试了但是当我回去并添加了一个Window_Loaded事件处理程序时,我开始收到此错误:

  

“ReVVed.ReVVed”类型中不存在类型名称“Merge_Text_Window”

我不知道ReVVed.ReVVed正在研究什么。该错误引用第4行第22列,它是Minwidth声明。我的代码中没有任何ReVVed.ReVVed命名空间。我无法编译。

有什么想法吗?

2 个答案:

答案 0 :(得分:0)

您是否尝试过此操作,因为在类复制已指定的本地命名空间之前,消息意味着命名空间?

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ReVVed" x:Class="Merge_Text_Window"
    MinWidth="400" MinHeight="400" Width="600" Height="400" WindowStyle="ToolWindow" Title="Merge Text" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded">

答案 1 :(得分:0)

不确定它为什么会起作用,但是我将窗口和代码放在一个单独的命名空间中而不是在项目命名空间下,它现在编译得很好。

相关问题