This question is locked. New answers and comments are not allowed.
I cam accross a strange error
I am using this piece of xaml
<
Border
Grid.Column
=
"5"
Grid.Row
=
"0"
Grid.RowSpan
=
"6"
HorizontalAlignment
=
"Stretch"
MinWidth
=
"300"
Style
=
"{StaticResource LeftBorderStyle}"
Margin
=
"0,10,0,0"
>
<
ribbon:DropShadow
ShadowSize
=
"15"
>
<
telerikNavigation:RadTreeView
ItemsSource
=
"{Binding TreeItems,Converter={StaticResource HierarchyConverter}}"
ItemTemplate
=
"{StaticResource TreeTemplate}"
SelectedItem
=
"{Binding SelectedTreeViewItem,Mode=TwoWay}"
ExpanderStyle
=
"{StaticResource ExpanderStyle}"
Background
=
"White"
/>
</
ribbon:DropShadow
>
</
Border
>
and everything worked fine until I added another radtreeview with the same Hierarchy converter then i got the message mention in the title. I fixed it by registrating the converter twice
<
converter:HierarchyConverter
x:Name
=
"HierarchyConverter"
/>
<
converter:HierarchyConverter
x:Name
=
"HierarchyConverter2"
/>
and referencing one from one treeview and the other from the other treeview
the converter looks like this
namespace
Converters
{
using
System;
using
System.Collections.ObjectModel;
using
System.Globalization;
using
System.Windows.Data;
using
CoreServiceReference;
public
class
HierarchyConverter : IValueConverter
{
public
object
Convert(
object
value, Type targetType,
object
parameter, CultureInfo culture)
{
Item item = value
as
Item;
if
(item !=
null
)
{
return
item.Children;
}
ObservableCollection<Item> items = value
as
ObservableCollection<Item>;
if
(items !=
null
)
{
return
items;
}
return
null
;
}
public
object
ConvertBack(
object
value, Type targetType,
object
parameter, CultureInfo culture)
{
throw
new
NotImplementedException();
}
}
}
As I have fixed this problem this is not that of a issue for me but I still wanted to let you know about this.