我有DataGrid
长时间加载
我希望等待时间BusyIndicator
我已经宣布了一个房产" IsBusy"在我的ViewModel中,引发了BusyIndicator
如果我用" true"声明属性默认情况下,BusyIndicator
会显示good => OK.
如果我声明它是" false",BusyIndicator
是hidden => OK.
但是,如果我在XAML中通过触发器设置值,则该属性设置良好,但BusyIndicator
不会出现。
视图模型:
public bool IsBusy
{
get { return _IsBusy; }
set { _IsBusy = value; RaisePropertyChanged(nameof(IsBusy)); }
}
private void SetBusy(bool obj)
{
IsBusy = obj;
}
XAML:
<xctk:BusyIndicator Name="BusyBar" IsBusy="{Binding IsBusy, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" BusyContent="Traitement en cours. veuillez patienter..." />
<ComboBox x:Name="cbbSchEtt" ...>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding SetBusyCommand}" CommandParameter="True"/>
<ei:CallMethodAction MethodName="LoadTableau" TargetObject="{Binding ElementName=ucTabBord}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
如果我通过后面的代码设置它(m是我的ViewModel):
private void LoadTableau()
{
m.IsBusy = true;//Mouse.OverrideCursor = Cursors.Wait;
.....
m.IsBusy = false;
}
有关信息,如果我在LoadTableau()
结束时未将其设置为false,则显示BusyIndicator
。
有什么想法吗?