5

我有一个带有 Pivot 和 3 PivotItems 的应用程序。每个 PivotItem 都有自己的 DataContext,DataContext 有一个名为 IsLoading 的属性。

可以将 SystemTray.ProgressIndicator IsVisible 属性绑定到选定的数据透视项 DataContext.IsLoading 属性吗?

这是我尝试过的:

<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>
4

2 回答 2

4

尝试这个:

http://www.codeproject.com/Articles/246355/Binding-the-WP7-ProgressIndicator-in-XAML?display=Print

<a:ProgressIndicatorProxy IsVisible="{Binding ElementName=pivot, Path=SelectedItem.DataContext.IsLoading}" />

(没试过)

于 2011-10-18T07:39:04.477 回答
0

这是 Jeff Wilcox 的一个解决方案,看起来它适用于您的情况:

http://www.jeff.wilcox.name/2011/07/creating-a-global-progressindicator-experience-using-the-windows-phone-7-1-sdk-beta-2/

您可以调整该技术以根据其他(或选定的)数据透视项目的状态直接处理数据透视页面上的 ProgressIndicator。

于 2011-10-18T16:40:31.877 回答