得到“已准备好” WPF 工具包图表渲染后的信号

发布于 2024-12-03 00:20:05 字数 146 浏览 1 评论 0原文

我正在使用 WPF 工具包的图表工具。 创建图表后,我喜欢获得该图表的快照,而不需要可视化该图表。我的问题是我不知道渲染过程何时完成,所以我可以创建快照。 我尝试监听“LayoutUpdated”事件,但图表更新得非常频繁。

谁能告诉我如何确定图表是否完全渲染?

I am using the charting stuff of the WPF toolkit.
After creating a chart I like to have a snaphshot of that chart, without visualizing that chart. My problem is that I don't know when the rendering process is done, so I can create a snapshot.
I tried listening to the "LayoutUpdated" event, but the chart is being updated very often.

Can anyone tell me how to find out if the chart is completely rendered?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

自由如风 2024-12-10 00:20:05

您可以在后面的代码中使用调度程序:

this.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new Action(() =>
    {
        // code in here should be executed after chart has been rendered.
    }
));

You can use the Dispatcher in your code behind:

this.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new Action(() =>
    {
        // code in here should be executed after chart has been rendered.
    }
));
初见终念 2024-12-10 00:20:05

Loaded 事件听起来正是您所需要的。

MyChart.Loaded += (sender, e) =>
{
    // chart has been loaded but not yet rendered
}

其中“MyChart”是您在 XAML 中为图表指定的名称。

我不确定这对于频繁更新的效果如何,但此链接似乎表明 http://blogs.msdn.com/b/mikehillberg/archive/2006/09/19/loadedvsinitialized.aspx这就是您正在寻找的东西。

The Loaded event sounds like what you need.

MyChart.Loaded += (sender, e) =>
{
    // chart has been loaded but not yet rendered
}

where "MyChart" is a the name you've given the chart in your XAML.

I'm not sure how well this works with frequent updates, but this link seems to indicate http://blogs.msdn.com/b/mikehillberg/archive/2006/09/19/loadedvsinitialized.aspx that this is what you're looking for.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文