Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to bind SystemTray Progressbar to a property in selected PivotItem DataContext

I got an app with a Pivot and 3 PivotItems. Each PivotItem has its own DataContext, and the DataContext has a property named IsLoading.

It is possible to bind the SystemTray.ProgressIndicator IsVisible property to the selected pivotitem DataContext.IsLoading property?

Here is What I 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>
like image 625
Marcelo de Aguiar Avatar asked Oct 09 '22 19:10

Marcelo de Aguiar


1 Answers

Try this:

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

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

(haven't tried it)

like image 53
Rico Suter Avatar answered Oct 12 '22 10:10

Rico Suter