Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top