名称空间中不存在名称“StatConverter”

时间:2015-10-12 13:45:18

标签: c# .net wpf

enter image description here

 <Window
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid" xmlns:LiteTreeView="clr-namespace:LiteTreeView;assembly=LiteTreeView" x:Class="test.date_changes"
            Title="date_changes" Height="600" Width="1200"
            xmlns:local="clr-namespace:test">

        <Window.Resources>

            <local:StatConverter x:Key="Converter"></local:StatConverter>
        </Window.Resources>
    </window>


    namespace test
    {
        public class StatConverter : IValueConverter
        {
            #region IValueConverter Members

            public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                if (value is int)
                {
                    return (int)value == 1;
                }

                return false;
            }

            public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                throw new NotImplementedException();
            }

            #endregion
        }
    }

获取错误The name “StatConverter” does not exist in the namespace。搜索了类似的问题,尝试了不同的解决方案(比如更改调试以发布)。但无法修复它。请帮我解决这个问题。提前谢谢。

0 个答案:

没有答案