2011-11-06 98 views
0

我必须在这里失去一个步骤。Silverlight 4,mvvm和工具包忙指标不起作用

<toolkit:BusyIndicator HorizontalAlignment="Center" VerticalAlignment="Center" Name="busyIndicator" IsBusy="{Binding BusyIndicator}"> 
    <Grid Background="#FFE6F0FF" HorizontalAlignment="Left" VerticalAlignment="Top" > 

我在我的视图模型如下:

private BusyIndicator _busyIndicator; 
    public BusyIndicator BusyIndicator 
    { 
     get { return _busyIndicator; } 
     set 
     { 
      if (_busyIndicator == value) return; 
      _busyIndicator = value; 
      OnNotifyPropertyChanged("BusyIndicator"); 
     } 
    } 

BusyIndicator = new BusyIndicator { IsBusy = true, BusyContent = "Please wait..." }; 

但是当我火我的异步调用WCF来,什么都没有显示出来?

回答

2

为什么财产返回BusyIndicator?它不应该是一个布尔?然后我认为它应该工作。

+0

完全忽略了这一点。谢谢! – PixelMuse

0

此外,确保DataContext属性设置为BusyIndi​​cator控件,并在视图模型的“IsBusy”属性指定的数据范围内。如果数据上下文被设置为包含在BusyIndi​​cator中的网格,ViewModel中的属性将不会被调用。

数据上下文可以在运行时(在xaml.cs代码隐藏中)或在XAML中设置。

相关问题