Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

BindingExpression path error: 'Orientation' property not found on 'object' ''ColorScale'

Solved!
Go to solution

Hello all,

 

A data binding error is thrown by the Debug Output window just after setting the DataSource property to some data:

 

System.Windows.Data Error: 40 :BindingExpression path error: 'Orientation' property not found on 'object' ''ColorScale' (HashCode=50862316)'. BindingExpression:Path=Orientation; DataItem='ColorScale' (HashCode=50862316); target element is 'DependencyPropertyListener' (HashCode=6239444); target property is 'Target' (type 'Object')

 

I did the following:

Graph graph = new Graph();
graph.Plots.Add(new Plot());
graph.Plots[0].Renderer = new IntensityPlotRenderer();
((IntensityPlotRenderer)graph.Plots[0].Renderer).ColorScale = new ColorScale();
graph.DataSource = new List<System.Windows.Media.Media3D.Point3D>();

 The error message is thrown right after executing the assignment of a new List to the DataSource. The error seems harmless but would be nice to understand what is causing this issue.

 

Thanks.

0 Kudos
Message 1 of 11
(7,371 Views)

Which version of Measurement Studio and Visual Studio are you using? I can reproduce the problem you're reporting in Measurement Studio 2013 for Visual Studio 2012, but when I run your code snippet in Measurement Studio 2015 for Visual Studio 2013 I do not see the message in the output window.

Daniel Dorroh
National Instruments
Message 2 of 11
(7,353 Views)

I'm running version Measurement Studio 2013 for Visual Studio 2012 on Visual Studio Professional 2013.

0 Kudos
Message 3 of 11
(7,351 Views)

I upgraded Measurement Studio to Measurement Studio 2015 and running Visual Studio Professional 2013 and I do not get a binding error with the code snippet above. But I do get the error when I attach the graph to a Border for example:

 

Snippet

this.Border.Child = graph;

 And declare a border:

 

Snippet

<Grid>
     <Border Name="Border" />
</Grid>

 

Please let me know if you get a binding error message when you attach the graph to a Border element. Thank you.

0 Kudos
Message 4 of 11
(7,214 Views)

I opened the project ColorScale.2013 example in National Instruments\MStudioVS2013\DotNET\Examples\WPF\Standard\ColorScale\cs\ and replaced the code with just the snippets below and the error unfortunately shows up.

 

In the MainWindow constructor:

Snippet

public MainWindow()
{
    this.InitializeComponent();
 
    Graph graph = new Graph();
 
    graph.Plots.Add(new Plot());
 
    graph.Plots[0].Renderer = new IntensityPlotRenderer();
 
    ((IntensityPlotRenderer)graph.Plots[0].Renderer).ColorScale = new ColorScale();
 
    graph.DataSource = new List<System.Windows.Media.Media3D.Point3D>();
 
    Grid.Children.Add(graph);
}

 

In XAML:

Snippet

<Window x:Class="NationalInstruments.Examples.ColorScale.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Using Color Scale In Intensity Graph"
        Width="800"
        Height="600">
    <Grid Name="Grid" />
</Window>

 

The error shows up twice:

 

System.Windows.Data Error: 40 : BindingExpression path error: 'Orientation' property not found on 'object' ''ColorScale'.

BindingExpression:Path=Orientation;

DataItem='ColorScale';

target element is 'DependencyPropertyListener';

target property is 'Target' (type 'Object')

0 Kudos
Message 5 of 11
(7,187 Views)
Solution
Accepted by topic author gabe0

Hi, gabe0

 

It looks like this error is happening because the graph control is watching its collection of scales to determine whether the scale orientation changes have occurred, but the ColorScale does not have an orientation property. While you cannot do anything to your program to get around this error, you can safely ignore it. I have filed a bug report for this behavior.

 

Thank you for the feedback!

Daniel Dorroh
National Instruments
Message 6 of 11
(7,167 Views)

Great thank you!

0 Kudos
Message 7 of 11
(7,164 Views)

No problem!

 

I have a follow up question for you. Is there a reason you don't just use the IntensityGraph class?

Daniel Dorroh
National Instruments
0 Kudos
Message 8 of 11
(7,160 Views)

Oh yeah good question: we needed a color scale bar that can be used in other places where there was no NI control being used.

 

Thanks,

Gabe.

0 Kudos
Message 9 of 11
(7,148 Views)

Just wanted to let you know this issue was fixed in the Measurement Studio 2019 release.

~ Paul H
0 Kudos
Message 10 of 11
(3,590 Views)