I'm currently working on enabling drag-and-drop support for our company app.
The error I keep getting seems weird to me.
What this says is that
The property 'DragDropHelper.IsDragSource' does not exist in XML namespace 'clr-namespace:DragAndDrop;assembly=DragAndDrop'. Line 61 Position 83
The property is an attached property in the class I found in the Internet in the samples and modified it a bit. Here is property declaration:
namespace DragAndDrop {
public class DragDropHelper
{
public static readonly DependencyProperty IsDragSourceProperty =
DependencyProperty.RegisterAttached("IsDragSource", typeof (bool), typeof (DragDropHelper),
new UIPropertyMetadata(false, IsDragSourceChanged));
public static bool GetIsDragSource(DependencyObject obj)
{
return (bool) obj.GetValue(IsDragSourceProperty);
}
public static void SetIsDragSource(DependencyObject obj, bool value)
{
obj.SetValue(IsDragSourceProperty, value);
}
It seems to me that attached property is completely valid, isn't it? This DragDropHelper is included into a class library, that I reference from the main client app. When I try to set the value of the property in a client app:
<ListView x:Uid="list" x:Name="CurrentFolderItemsControl" drag:DragDropHelper.IsDragSource="true" />
VS2010 says that property doesn't exist in XML namespace. The XAML document is a resource dictionary
which is merged into main client app resources, because it contains styles for our control.
It's even more weird because I created a class within main app that has attached property, then set property value in XAML markup - app compiled OK
Sorry for the necro... just thought I'd share what happened in my similar scenario. I copied my View from an external project, which referenced the behaviour's namespace internally:
xmlns:b="clr-namespace:MyCompany.Common.Behaviours"
b:WindowBehaviours.Close="{Binding ClosingView}"
Two things needed to happen for this to work. Firstly, the xmlns needed to explicitly reference the assembly for the behaviour class, like so:
xmlns:b="clr-namespace:MyCompany.Common.Behaviours;assembly=Common"
Secondly, I temporarily removed the second line and rebuilt my solution first. VS2012 sometimes gets its knickers in a knot when you clone WPF projects, and a good Clean & Rebuild without the offending line often fixes things (it recognised the behaviour after I added the line back again).