0
我已经创建了一个usercontrol并在第二个usercontrol中传递了它的程序集。我已经在Xaml文件中编写了正确的命名空间,但它仍然在说CLR clr-namespace is not defined in assembly
如何解决此问题?谁能帮我。我的代码是:如何在WPF中包含程序集?
首先用户控件XAML文件:
<xmlns:local="clr-namespace:DesktopApplication.Roles"> <UserControl.Resources> <local:StringToColorConverter x:Key="StringToColorConverter"/> </UserControl.Resources>
二用户控件.CS文件:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
namespace DesktopApplication.Admin_Roles
{
public partial classCategoryTab : UserControl
{
public CategoryTab()
{
InitializeComponent();
}
public class Data
{
public string Name { get; set; }
public string LastName { get; set; }
public string Color { get; set; }
public bool isactive { get; set; }
}
public class StringToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return (Color)ColorConverter.ConvertFromString((string)value);
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return ((Color)value).ToString();
}
}
}