WPF-如何在单击按钮时显示进度栏以显示正在进行的操作,直到过程完成 [英] WPF - How to show Progress Bar on button click to show operation is in progress till the process is completed

查看:235
本文介绍了WPF-如何在单击按钮时显示进度栏以显示正在进行的操作,直到过程完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个WPF应用程序,当我从SP列表中获取数据时,我想在其中显示进度条(使其可见),一旦获取并要显示数据,进度条就应该消失了.已经尝试过使用动画,但是什么也没有 直到单击按钮完成代码执行.

I have a WPF application where i want to show a progress bar (make it visible) while data is being fetched from the SP list, once data is fetched and about to display, progress bar should get disappeared. Already tried with the use of animation but nothing happens till the code execution is finished on button click.

当我单击按钮时,服务器端代码将被执行,直到完成所有代码执行之后,什么都不会发生.最初使进度条处于隐藏状态,然后单击按钮,我将可见性更改为可见,但由于代码仍然存在而未应用 被执行.

When i am clicking button, server side code gets executed and nothing happens till all code execution is done. Progress bar is made hidden initially and on button click i am changing visibility to visible but its not getting applied since the code is still getting executed..

我确定有人在WPF中做了类似的事情,请提出我可以采取的选择.

I am sure someone has done something similar to this in WPF, Please suggest what options can i take. 

此致

Rahul

推荐答案

你好,

您是否尝试将UpdateProgress与Updatepane一起使用?我之前有相同的要求,并已达到以下要求

did you try to use UpdateProgress with Updatepane? i had the same requirement before and i've achieved it as the following 

如果您需要其他帮助,请告诉我.

let me know if you need any further help.


这篇关于WPF-如何在单击按钮时显示进度栏以显示正在进行的操作,直到过程完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆