问题
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 PlotModel
s 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