Hi
I'm having an issue since I updated to 18.2 (was priori to 17.2)
I create Y axes in code behind :
yAxis = new NumericYAxis(); yAxis.Title = IdYAxis; yAxis.Tag = IdYAxis; AxisLabelSettings setaxlab = new AxisLabelSettings(); switch (PositionYaxis) { case ePositionYAxis.IN_LEFT: setaxlab.Location = AxisLabelsLocation.InsideLeft; break; case ePositionYAxis.OUT_LEFT: setaxlab.Location = AxisLabelsLocation.OutsideLeft; break; case ePositionYAxis.IN_RIGHT: setaxlab.Location = AxisLabelsLocation.InsideRight; break; case ePositionYAxis.OUT_RIGHT: setaxlab.Location = AxisLabelsLocation.OutsideRight; break; } setaxlab.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(couleurAxis)); yAxis.LabelSettings = setaxlab; yAxis.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(couleurAxis)); TitleSettings titleset =(TitleSettings) YNumericAxisbase.TitleSettings.Clone(); titleset.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(couleurAxis)); titleset.Angle = 270; yAxis.TitleSettings = titleset; yAxis.MajorStrokeDashArray = new DoubleCollection(new double[] { 1, 7 }); yAxis.MajorStroke = new SolidColorBrush((Color)ColorConverter.ConvertFromString(couleurAxis)); yAxis.MinimumValue = Miny; yAxis.MaximumValue = MaxY; _owner.Axes.Add(yAxis);
But I now have multiple Binding errors when I run the software :
System.Windows.Data Error: 40 : BindingExpression path error: 'Effect' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=Effect; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'Effect' (type 'Effect')System.Windows.Data Error: 40 : BindingExpression path error: 'Foreground' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=Foreground; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'Foreground' (type 'Brush')System.Windows.Data Error: 40 : BindingExpression path error: 'FontFamily' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=FontFamily; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'FontFamily' (type 'FontFamily')System.Windows.Data Error: 40 : BindingExpression path error: 'FontSize' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=FontSize; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'FontSize' (type 'Double')System.Windows.Data Error: 40 : BindingExpression path error: 'FontStretch' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=FontStretch; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'FontStretch' (type 'FontStretch')System.Windows.Data Error: 40 : BindingExpression path error: 'FontStyle' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=FontStyle; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'FontStyle' (type 'FontStyle')System.Windows.Data Error: 40 : BindingExpression path error: 'FontWeight' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=FontWeight; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'FontWeight' (type 'FontWeight')System.Windows.Data Error: 40 : BindingExpression path error: 'HorizontalAlignment' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=HorizontalAlignment; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'HorizontalAlignment' (type 'HorizontalAlignment')System.Windows.Data Error: 40 : BindingExpression path error: 'IsHitTestVisible' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=IsHitTestVisible; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'IsHitTestVisible' (type 'Boolean')System.Windows.Data Error: 40 : BindingExpression path error: 'OpacityMask' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=OpacityMask; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'OpacityMask' (type 'Brush')System.Windows.Data Error: 40 : BindingExpression path error: 'Opacity' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=Opacity; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'Opacity' (type 'Double')System.Windows.Data Error: 40 : BindingExpression path error: 'Margin' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=Margin; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'Padding' (type 'Thickness')System.Windows.Data Error: 40 : BindingExpression path error: 'VerticalAlignment' property not found on 'object' ''AnalysePatientViewModel' (HashCode=38220454)'. BindingExpression:Path=VerticalAlignment; DataItem='AnalysePatientViewModel' (HashCode=38220454); target element is 'TextBlock' (Name=''); target property is 'VerticalAlignment' (type 'VerticalAlignment')
Those errors are repeated for each Y axe I add in the xamdatachart, I think it has to do with the axis title textblock.
For a reason I don't inderstand the textblock semmes to try to find its values directly on the control Viewmodel ... I did not have those errors unsing 17.2.
If I create the axes in xaml , I dont have any errors, I tried to compare the objects (xaml created axis vs code created axis) but could not find the cause of this problem.
Thanks in advance
Hello,
In creating an isolated sample, it often helps to make a copy of your application and slowly remove functionality that is likely to be unrelated to the issue. Then test to make sure the issue still occurs and repeat until the issue does not happen. This lets you narrow down the cause and you may even come across a solution you can work on.
If you are unable to provide an isolated sample I may be able to give suggestions if you provide the code for your page.
Looking forward to hearing from you.
Thanks for your time.
It did not solve my issue but I can't reproduce the issue when I try to make a simple sample application, quite hard for you to help me further then.
Thank you for posting in our forums!
These errors are related to when they are added to the Axes collection, and not what may differ between them. If you add the Y axes to the chart's Axes collection before you change any properties, the errors do not occur. See the below code snippet:
yAxis = new NumericYAxis(); _owner.Axes.Add(yAxis); yAxis.Title = "IdYAxis"; yAxis.Tag = "IdYAxis"; ...
If you need further assistance with this, please let me know and I will be glad to help.