如何绑定 LineSeries? IsAsync=“True”的 ItemSource 到 PointCollection?

发布于 2024-10-06 13:42:43 字数 521 浏览 0 评论 0原文

正如主题所述,我想将 LineSeries 中的数据绑定到我通过计时器在代码隐藏中创建、填充和维护的 PointCollection。 我通过简单的方法取得了一些成功:

<charting:LineSeries.ItemsSource>
    <PointCollection x:Name="pntCLeftHand"/>
</charting:LineSeries.ItemsSource>

然后将项目添加到代码隐藏中的“pntCLeftHand”中。

这很有效,但我认为 UI 更新太耗时,所以我希望绑定是异步的。 IsAsync 属性会对我有所帮助,但我想这只能与以下内容一起使用:

<charting:LineSeries ItemsSource="{Binding pntCLeftHand, IsAsync=True}"/>

不幸的是,这不起作用。

有人能给我指路吗?

提前致谢。

As the topic states, I want to Bind the data in a LineSeries to a PointCollection that I create, fill and mantain in Code-Behind through a Timer.
I have some success with the simple approach:

<charting:LineSeries.ItemsSource>
    <PointCollection x:Name="pntCLeftHand"/>
</charting:LineSeries.ItemsSource>

And then Adding items into 'pntCLeftHand' in Code-Behind.

This works well, but I think the UI Updating is just too time consuming, so I want the Binding to be Asynchronous. The IsAsync property would help me, but I guess this can only be used with something like the following:

<charting:LineSeries ItemsSource="{Binding pntCLeftHand, IsAsync=True}"/>

Unfortunately that just doesn't work.

Can somebody show me the way?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文