Visual Studio 2013无法正确加载XAML
问题描述:
我正在测试VS 2013并且有一个相当奇怪的错误:我正在加载一个使用命名空间来实现Valueconverter的XAML文件。此WORKS在运行时会发现,但在开发视图中,我收到一条错误消息,指出未找到Converter。 我试图清理解决方案,删除。用户名为.suo和文件,但无济于事Visual Studio 2013无法正确加载XAML
代码如下所示:
<RibbonWindow x:Class="bla.ShellView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cal="http://www.caliburnproject.org"
xmlns:Converter="clr-namespace:bla.Utils"
Title="bla" Width="1024" Height="768" Icon="/bla;component/Images/Table.ico" MinWidth="300" MinHeight="300">
<RibbonWindow.Resources>
<Converter:SpssVarTypeConverter x:Key="SpssVarTypeConverter"></Converter:SpssVarTypeConverter>
</RibbonWindow.Resources>
</RibbonWindow>
和转换器:
using bla.SPSS;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;
namespace bla.Utils
{
public class SpssVarTypeConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var type = (Types)value;
if (type == Types.numerisch)
{
return Brushes.LightBlue;
}
else
{
return Brushes.PaleVioletRed;
}
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
有谁有一个想法如何解决这个问题?
答
我认为他们的IDE有一些问题。 当我尝试使用Left(T,2)字符串函数时,我在Visual Basic中收到了类似的消息。 它引发错误“没有实现”,因为它与控制属性冲突,“左。 然后,它把原型为左字符串的新功能的代码结束。
Private Function Left(DB As String, p2 As Integer) As String
Throw New NotImplementedException
End Function
这是一个很好的微软在发布产品之前无法测试他们的产品的例子