WPF实体框架加载过程陷入困境

时间:2022-01-20 02:14:37

currently i am working with the project in C# WPF with entity framework, i had used MahApps.Metro package for UI, i need to implement the ProgreeBar or LoadingIndicator or anything that idicates that my app is not stuck,

目前我正在使用实体框架在C#WPF中使用该项目,我使用了用于UI的MahApps.Metro包,我需要实现ProgreeBar或LoadingIndicator或任何表明我的应用程序没有被卡住的内容,

Whenever i made any kind of operation first time, my apps stucks for few second and it seems like its hang,

每当我第一次进行任何操作时,我的应用程序都会停留几秒钟而且看起来像是挂起,

In web apps i had implemented AJAX call, loading process with

在网络应用程序中,我实现了AJAX调用,加载过程

.ajaxStart()
.ajaxStop()

So my question is does anyone know or is there any way to implement every call of app or entity framework or any process how can i implement ProgressBar or GIF Loader or anything that shows process.

所以我的问题是有没有人知道或者有没有办法实现app或实体框架的任何调用或任何过程如何实现ProgressBar或GIF Loader或任何显示进程的东西。

I had tries ProgessBar of MahApps.Metro but whenever I start that ProgressBar it Stucks untill that process complete.

我曾尝试过使用MahApps.Metro的ProgessBar,但每当我启动ProgressBar时,它就会直到完成该过程。

EDITED:

Some of Code is,

一些代码是,

private void ShowClientWindow(object sender, RoutedEventArgs e)
    {
        myProgess.IsIndeterminate = true; //its for progressbar

        myFrame.Source = new Uri("MyViews/ClientView.xaml", UriKind.Relative);

        myProgess.IsIndeterminate = false;
    }

Thanks,

Gaurav Oza

1 个解决方案

#1


The solution is not to display a ProgressBar to let the user think the application is not stuck, but to use async calls to actually avoid being stuck.

解决方案不是显示ProgressBar以让用户认为应用程序没有卡住,而是使用异步调用来实际避免卡住。

Entity Framework 6 does support async query and save

实体框架6确实支持异步查询和保存

#1


The solution is not to display a ProgressBar to let the user think the application is not stuck, but to use async calls to actually avoid being stuck.

解决方案不是显示ProgressBar以让用户认为应用程序没有卡住,而是使用异步调用来实际避免卡住。

Entity Framework 6 does support async query and save

实体框架6确实支持异步查询和保存