Cannot access label from C#

Dec 14, 2012 at 10:12 PM

I'm trying to access the artistLabel from the xaml.cs file. However I cannot get c# to recognize the label if it is inside the BusyBar. 

 

Any suggestions? 

<wpfx:BusyIndicator Name="BusyBar" IsBusy="True">
            <wpfx:BusyIndicator.BusyContentTemplate>
                <DataTemplate>
                    <StackPanel Margin="4">
                        <TextBlock Text="Adding music to library" FontWeight="Bold" HorizontalAlignment="Center" Padding="0,0,0,10"/>
                        
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Label Content="Artist: " Grid.Column="0" Grid.Row="0"></Label>
                            <Label Grid.Column="1" Grid.Row="0" Name="artistLabel" ></Label>
                        </Grid>
                        <StackPanel Margin="4">
                            <ProgressBar Value="80" Height="15"/>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0" Grid.Row="1" Content="Cancel" HorizontalAlignment="Right" Margin="2 0 0 0"/>
                        </Grid>
                    </StackPanel>
                </DataTemplate>
            </wpfx:BusyIndicator.BusyContentTemplate>
            <wpfx:BusyIndicator.OverlayStyle>
                <Style TargetType="Rectangle">
                    <Setter Property="Fill" Value="#ffffeeee"/>
                </Style>
            </wpfx:BusyIndicator.OverlayStyle>
            <wpfx:BusyIndicator.ProgressBarStyle>
                <Style TargetType="ProgressBar">
                    <Setter Property="Visibility" Value="Collapsed"/>
                </Style>
            </wpfx:BusyIndicator.ProgressBarStyle>
            <!--<ContentControl Style="{StaticResource SampleContent}"/>-->
        </wpfx:BusyIndicator>