Noobie WPF namespace and converter problem

Please forgive the noob question, but I'm going in circles and need answers ...

Anyway, I looked at this WPF article : how to link RadioButtons to an enumeration? but I just can't get the converter to be recognized inside the XAML file.

<Window x:Class="Widget.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit"
    Title="Widget" Height="366" Width="588" WindowStyle="SingleBorderWindow">
    <Window.Resources>
        <EnumBooleanConverter x:Key="enumBooleanConverter" />
    </Window.Resources>
...

I have a separate file containing the EnumBooleanConverter class, but the link above gives me the following error:

Error 1 The tag 'EnumBooleanConverter' does not exist in the XML namespace http://schemas.microsoft.com/winfx/2006/xaml/presentation '.

I tried to add assembly links and then add the tag in XAML, but to no avail.

<Window x:Class="Widget.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit"
    xmlns:local="clr-namespace:Widget;assembly=Widget"
    Title="Widget" Height="366" Width="588" WindowStyle="SingleBorderWindow">
    <Window.Resources>
        <local:EnumBooleanConverter x:Key="enumBooleanConverter" />
    </Window.Resources>
...

Any help would be greatly appreciated.

+3
2

( ) .

, .

xmlns:local="clr-namespace:Widget;assembly=Widget"

...

xmlns:local="clr-namespace:Widget"
+6

, EnumBooleanConverter .

0

Source: https://habr.com/ru/post/1730186/


All Articles