【问题标题】:OxyPlot is not updating titleOxyPlot 没有更新标题
【发布时间】:2013-09-12 11:50:09
【问题描述】:

我正在使用 OxyPlot 在 WPF/.net 4.5 下的用户控件上显示图表,并具有以下 XAML:

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

在我的代码隐藏中:

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"));

然后从外部设置此属性,但一旦分配了PlotModel,OxyPlot 似乎会忽略对此的任何更改。使用通过PlotModels 构造函数提供的标题,但更改模型的属性(并调用RefreshPlot)不会更改 UI 中的标题。

我做错了什么?

【问题讨论】:

    标签: c# wpf data-binding oxyplot


    【解决方案1】:

    我不知道为什么,但现在它正在工作......

    我没有更改标题的任何内容,但一定是其他一些更改触发了它的工作。

    【讨论】:

    • 有同样的问题。希望我的问题也能自行解决。
    猜你喜欢
    • 2022-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多