如何将系统托盘进度条绑定到所选PivotItem DataContext中的属性

5
我有一个带有Pivot和3个PivotItems的应用程序。每个PivotItem都有自己的DataContext,并且DataContext具有名为IsLoading的属性。
可以将SystemTray.ProgressIndicator IsVisible属性绑定到选定的PivotItem 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>
2个回答

4

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接