2011-10-11 46 views
5

我得到了一個帶有Pivot和3 PivotItems的應用程序。每個PivotItem都有自己的DataContext,而DataContext有一個名爲IsLoading的屬性。如何將SystemTray Progressbar綁定到選定的PivotItem DataContext中的屬性

可以將SystemTray.ProgressIndicator IsVisible屬性綁定到選定的pivotitem DataContext.IsLoading屬性?

這裏是我tryied什麼:

<shell:SystemTray.ProgressIndicator> 
    <shell:ProgressIndicator 
     IsVisible="{Binding ElementName=pivot, Path=SelectedItem.DataContext.IsLoading}" /> 
</shell:SystemTray.ProgressIndicator> 
<Grid Background="Transparent"> 
    <controls:Pivot x:Name="pivot"> 

     <controls:PivotItem Header="pivot item" 
           Margin="0,28,24,0" 
           DataContext="{Binding DCOne}" /> 

     <controls:PivotItem Header="pivot item" 
          Margin="0,28,24,0" 
          DataContext="{Binding DCTwo}" /> 

     <controls:PivotItem Header="pivot item" 
          Margin="0,28,24,0" 
          DataContext="{Binding DCThree}" /> 
</Grid> 

回答

相關問題