0
使用实体框架从数据库加载数据需要很长时间我想在UI(WPF)上显示“加载”指示器。对于指标本身,我使用文章中所示的WPF Loading Wait Adorner。实体框架加载数据时WPF加载指示器
该指标工作正常,但在Entity Framework加载数据时未显示。在这种情况下,指标在用户界面上根本不会显示。
我运行此:
'show Adorner (loading indicator)
LoadingAdorner.IsAdornerVisible = Not LoadingAdorner.IsAdornerVisible
'read data from database with Entity Framework
Persons = _context.persons
'hide Adorner (loading indicator) after loading data is completed
LoadingAdorner.IsAdornerVisible = Not LoadingAdorner.IsAdornerVisible
和
<ac:AdornedControl Name="LoadingAdorner">
<ac:AdornedControl.AdornerContent>
<local:LoadingWait></local:LoadingWait>
</ac:AdornedControl.AdornerContent>
<ListBox>
...code not shown
</ListBox>
</ac:AdornedControl>
加载数据只有经过时,指示灯变为可见。 我错过了什么,以及如何显示数据加载指标?
我该如何使用它?我现在怎么对它说“doWork”? –
@PieroAlberto'.RunWorkerAsync();'将开始工作。 –