OxyPlot is not updating title

拜拜、爱过 提交于 2020-01-07 02:56:09

问题


I am using OxyPlot to show a Chart on a user control under WPF/.net 4.5 and have the following XAML:

<oxy:Plot x:Name="oxyPlot" Title="{Binding ChartTitle}" Model="{Binding Plot}" />

and in my Code-Behind:

public string ChartTitle
{
    get { return (string)GetValue(ChartTitleProperty); }
    set { SetValue(ChartTitleProperty, value); }
}
public static readonly DependencyProperty ChartTitleProperty =
    DependencyProperty.Register("ChartTitle", typeof(string), typeof(ChartControl), new PropertyMetadata("OMICRON Lab Chart"));

This property is then set from outside, but OxyPlot seems to ignore any changes to this as soon as a PlotModel is assigned. The title supplied via the PlotModels constructor is used, but also changing the property of the model (and calling RefreshPlot) does not change the title in the UI.

What am I doing wrong?


回答1:


I have no idea why, but now it is working...

I did not change anything about the title, but some other changes must have triggered it to work.



来源:https://stackoverflow.com/questions/18763502/oxyplot-is-not-updating-title

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!