5

Pivotと3つのPivotItemsを備えたアプリを入手しました。各PivotItemには独自のDataContextがあり、DataContextにはIsLoadingという名前のプロパティがあります。

SystemTray.ProgressIndicator IsVisibleプロパティを選択したpivotitemDataContext.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

これがあなたの状況でうまくいくように見えるジェフ・ウィルコックスの解決策です:

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 に答える