Windows phone 7 如何将SystemTray Progressbar绑定到选定数据透视项DataContext中的属性
我有一个应用程序,有一个数据透视和3个数据透视项。每个数据透视项都有自己的DataContext,DataContext有一个名为IsLoading的属性 是否可以将SystemTray.ProgressIndicator IsVisible属性绑定到选定的pivotitem DataContext.IsLoading属性 以下是我尝试的:Windows phone 7 如何将SystemTray Progressbar绑定到选定数据透视项DataContext中的属性,windows-phone-7,data-binding,pivot,system-tray,pivotitem,Windows Phone 7,Data Binding,Pivot,System Tray,Pivotitem,我有一个应用程序,有一个数据透视和3个数据透视项。每个数据透视项都有自己的DataContext,DataContext有一个名为IsLoading的属性 是否可以将SystemTray.ProgressIndicator IsVisible属性绑定到选定的pivotitem DataContext.IsLoading属性 以下是我尝试的: <shell:SystemTray.ProgressIndicator> <shell:ProgressIndicator
<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>
试试这个:
(还没有尝试过)杰夫·威尔科克斯(Jeff Wilcox)提出了一个解决方案,它似乎适合您的情况: 您可以根据其他(或所选)透视项目的状态调整该技术,直接在透视页面上显示ProgressIndicator
<a:ProgressIndicatorProxy IsVisible="{Binding ElementName=pivot, Path=SelectedItem.DataContext.IsLoading}" />