This is a migrated thread and some comments may be shown as answers.

Receives binding warning in debug output

1 Answer 72 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Tormod
Top achievements
Rank 2
Tormod asked on 17 Aug 2012, 09:37 AM
I receive this message when binding to a graphsource for each connection in the graphsource:
System.Windows.Data Error: 40 : BindingExpression path error: 'Content' property not found on 'object' ''SeqLink' (HashCode=58169988)'. BindingExpression:Path=Content; DataItem='SeqLink' (HashCode=58169988); target element is 'ContentPresenter' (Name=''); target property is 'Content' (type 'Object')

Commenting out all binding in the Style for connections in xaml does not help.

internal class SeqLink:ILink<SeqStep>
    {
        public string ConnectionSide { get; internal set; }
 
        object ILink.Source
        {
            get { return Source; }
            set { Source = (SeqStep) value; }
        }
 
        public SeqStep Target { get; set; }
 
        //Uncomment either of these to remove the runtime binding error in debug window. However, the appearance is unchanged, AFAICT.
 
        //public string Content
        //{
        //    get { return String.Empty; }
        //    set { throw new NotImplementedException("Set content was called");}
        //}
 
        //public FrameworkElement Content
        //{
        //    get { return new Button() {Height = 30,Width = 30,Content = "SampleText"}; }
        //    set { throw new NotImplementedException("Set was called"); }
        //}
 
        public SeqStep Source { get; set; }
 
        object ILink.Target
        {
            get { return Target; }
            set { Target = (SeqStep) value; }
        }
    }

Have I done something wrong, is this a bug or is there something that I should be exposing through this property that would achieve some functionality that I fail to grasp? 

1 Answer, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 22 Aug 2012, 07:18 AM
Hi,

 The binding seems to be resolving the correct property of source object, but still fails. I believe this is because the SeqLink class is internal. If you make it public, then it would be able to correctly find the Content property. Moreover, I would recommend using another name different than 'Content' for your property in the SeqLink class. The RadDiagramConnection already has a Content property (of type object) and there could be some ambiguity between the two properties.

Greetings,
Alex Fidanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Diagram
Asked by
Tormod
Top achievements
Rank 2
Answers by
Alex Fidanov
Telerik team
Share this question
or