0

以下の XAML を使用して、BusyIndi​​cator でテキストのスクロールを実現しようとしています。TargetName へのアクセスに関連する例外が発生しています。誰か助けてくれませんか?

コードビハインド

// Locate Storyboard resource
Storyboard s = (Storyboard)TryFindResource("animation");
s.Begin(bsi_Indicator);

XAML コード:

<xctk:BusyIndicator IsBusy="True" x:Name="bsi_Indicator">
        <xctk:BusyIndicator.BusyContentTemplate>  
            <DataTemplate>
                    <StackPanel Margin="4">
                        <Canvas Name="canvas1" Height="32" ClipToBounds="True"  VerticalAlignment="Top">
                        <TextBlock Name="ScrollText" FontFamily="Verdana" FontSize="12" Text="{Binding Path=DataContext.WaitText, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" >
                            <TextBlock.Resources>
                                <Storyboard x:Key="animation" Storyboard.TargetProperty="(Canvas.Left)" RepeatBehavior="Forever" >
                                    <DoubleAnimation Storyboard.TargetName="ScrollText" From="0" To="-50" Duration="0:0:10"  />
                                </Storyboard>
                            </TextBlock.Resources>
                        </TextBlock>
                    </Canvas>
                        <ProgressBar Value="100" Height="20"/>
                    </StackPanel>
            </DataTemplate>
        </xctk:BusyIndicator.BusyContentTemplate>

        <xctk:BusyIndicator.ProgressBarStyle>
            <Style TargetType="ProgressBar">
                <Setter Property="Visibility" Value="Collapsed"/>
            </Style>
        </xctk:BusyIndicator.ProgressBarStyle>
        <ContentControl />
    </xctk:BusyIndicator>

エラー:

Additional information: 'ScrollText' name cannot be found in the name scope of 'Xceed.Wpf.Toolkit.BusyIndicator'.
4

1 に答える 1