locked
Using more than one instance of a named userControl may cause errors RRS feed

  • Question

  • I am getting the error noted in the subject line of this post but I don't really know what it means or how to fix it. I'm new to Expression Blend, can anyone assist me? What should I be changing in my file?

    <UserControl x:Class="AMS_Lucky.MainPage"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" x:Name="userControl" Width="900" Height="700">
      <UserControl.Resources>    
            <Storyboard x:Name="NewsFeed">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_bottomlink" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="8"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:03.3000000" Value="11"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:05" Value="12"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_bottomlink" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="84"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:03.3000000" Value="42.988"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:05" Value="-16"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_link2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="7"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:01.8000000" Value="11.154"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:05" Value="13"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_link2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="104"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:01.8000000" Value="83.239"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:05" Value="-16"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_link3" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="7"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:05" Value="10"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:09" Value="4"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_link3" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="116"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:05" Value="-21"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:09" Value="-21"/>
                </DoubleAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_link3" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                            <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                    <DiscreteObjectKeyFrame KeyTime="00:00:05">
                        <DiscreteObjectKeyFrame.Value>
                            <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_link2" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                            <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                    <DiscreteObjectKeyFrame KeyTime="00:00:05">
                        <DiscreteObjectKeyFrame.Value>
                            <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_bottomlink" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                            <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                    <DiscreteObjectKeyFrame KeyTime="00:00:03.3000000">
                        <DiscreteObjectKeyFrame.Value>
                            <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                    <DiscreteObjectKeyFrame KeyTime="00:00:05">
                        <DiscreteObjectKeyFrame.Value>
                            <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                </ObjectAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="userControl" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:09" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_bottomlink" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                 <SplineDoubleKeyFrame KeyTime="00:00:03.3000000" Value="0"/>
                 <SplineDoubleKeyFrame KeyTime="00:00:05" Value="1"/>
                 <SplineDoubleKeyFrame KeyTime="00:00:09" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_link2" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                 <SplineDoubleKeyFrame KeyTime="00:00:01.8000000" Value="0"/>
                 <SplineDoubleKeyFrame KeyTime="00:00:05" Value="1"/>
                 <SplineDoubleKeyFrame KeyTime="00:00:09" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hl_link3" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                 <SplineDoubleKeyFrame KeyTime="00:00:05" Value="1"/>
                 <SplineDoubleKeyFrame KeyTime="00:00:09" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
        </UserControl.Resources>
     
        <UserControl.RenderTransform>
            <TransformGroup>
                <ScaleTransform/>
                <SkewTransform/>
                <RotateTransform/>
                <TranslateTransform/>
            </TransformGroup>
        </UserControl.RenderTransform>

        <UserControl.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFF7ED77"/>
                <GradientStop Color="#FFFFFFFF" Offset="1"/>
            </LinearGradientBrush>
        </UserControl.Background>
     
      <Grid x:Name="LayoutRoot" Background="White" Width="900" Height="700">
       <Canvas Width="900" Grid.Row="0" Margin="0.5,3,0.5,0" Height="700" x:Name="pnl_main">
        <Image Height="121.582" x:Name="img_header" Width="711.477" Canvas.Left="188.523" Source="Images/header.png" Stretch="Fill" Canvas.Top="-1.652"/>
                <Image Height="676.394" x:Name="img_logobar" Width="188.262" Canvas.Left="-0.131" Canvas.Top="-0.197" Source="Images/logobar.png" Stretch="Fill"/>
                <Image Height="29.291" x:Name="img_headerbar" Width="712" Canvas.Left="188" Canvas.Top="105.436" Source="Images/bar.png" Stretch="Fill"/>
       <Canvas x:Name="pnl_content" Width="700" Height="470" Visibility="Visible" Canvas.Top="161.686" Canvas.Left="192" >
                 <Canvas Height="470" x:Name="pnl_Home" Width="700" Visibility="Visible">  
       
        <Image Height="128" Width="152" Canvas.Top="395" Source="Images/news_bot.jpg" Canvas.Left="528" x:Name="img_news" MouseEnter="evt_startnews"/>
        <TextBox Height="48" Width="600" Canvas.Left="47" Canvas.Top="75.314" Text="At Accrue, we stand behind the simple, old-fashioned premise that there is no substitute for superior results and high-quality service delivered in a professional manner. There is no room for excuses." TextWrapping="Wrap" IsTabStop="False" IsReadOnly="True" BorderBrush="{x:Null}" Style="{StaticResource TextBoxStyle1}"/>
        <TextBox Height="32" Width="408" Canvas.Left="143" Canvas.Top="19.314" Text="We're keeping your Best Interests Top of Mind" TextWrapping="Wrap" TextAlignment="Center" FontWeight="Bold" FontFamily="./Fonts/vijaya.ttf#Vijaya" FontSize="24" Foreground="#FF8D862D" IsTabStop="False" IsReadOnly="True"/>
        <TextBox Height="24" Width="600" Canvas.Left="47" Canvas.Top="211.314" Text="We strive to deliver value-added consulting services that will exceed your expectations." TextWrapping="Wrap" IsTabStop="False" IsReadOnly="True" BorderBrush="{x:Null}" Style="{StaticResource TextBoxStyle1}"/>
        <TextBox Height="56" Width="600" Canvas.Left="47" Canvas.Top="139.314" Text="The demand for top talent has never been greater and organizations today, regardless of industry or location, seek experienced, credible leaders with the vision and skills to design winning strategies and motivate others." TextWrapping="Wrap" IsTabStop="False" IsEnabled="True" IsReadOnly="True" BorderBrush="{x:Null}" Style="{StaticResource TextBoxStyle1}"/>
        <TextBox Height="24" Width="600" Canvas.Left="47" Canvas.Top="251.314" Text="Some principles just don’t change... nor should they." TextWrapping="Wrap" FontWeight="Bold" FontFamily="Portable User Interface" TextAlignment="Center" IsTabStop="False" IsReadOnly="True" BorderBrush="{x:Null}" Style="{StaticResource TextBoxStyle1}"/>   
         <HyperlinkButton Content="Looking for CEO's &#xd;&#xa;in all the wrong places" x:Name="hl_link3" RenderTransformOrigin="0.5,0.5" Canvas.Left="543" Canvas.Top="292" NavigateUri="/Articles/wrongplaces.pdf" TargetName="ContentFrame" Foreground="#FF4475A0">
                        <HyperlinkButton.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform/>
                                <SkewTransform/>
                                <RotateTransform/>
                                <TranslateTransform/>
                            </TransformGroup>
                        </HyperlinkButton.RenderTransform>
                    </HyperlinkButton>
         <HyperlinkButton Height="36" Width="135" Content="Growing CEO's &#xd;&#xa;from the Inside" Canvas.Left="543" Canvas.Top="368" IsTabStop="True" x:Name="hl_bottomlink" RenderTransformOrigin="0.5,0.5" NavigateUri="./Articles/5772.pdf" TargetName="ContentFrame" BorderThickness="0,9,0,0" Foreground="#FF4475A0">
                        <HyperlinkButton.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform/>
                                <SkewTransform/>
                                <RotateTransform/>
                                <TranslateTransform/>
                            </TransformGroup>
                        </HyperlinkButton.RenderTransform>
                    </HyperlinkButton>
                    <HyperlinkButton Content="Why CEO's are not &#xd;&#xa;Plug and Play" x:Name="hl_link2" RenderTransformOrigin="0.5,0.5" Canvas.Left="543" Canvas.Top="328" BorderThickness="0,4,0,0" NavigateUri="./Articles/CEOs.pdf" TargetName="ContentFrame" Foreground="#FF4475A0">
                        <HyperlinkButton.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform/>
                                <SkewTransform/>
                                <RotateTransform/>
                                <TranslateTransform/>
                            </TransformGroup>
                        </HyperlinkButton.RenderTransform>
                    </HyperlinkButton>
        </Canvas>
         <Canvas Height="470" x:Name="pnl_JobSeekers" Width="700" Visibility="Collapsed" Background="#FFFCFCFC" OpacityMask="{x:Null}" Opacity="1">
          <Grid Height="474" x:Name="resultsGrid" Width="362" Visibility="Collapsed" Background="#FFECECEB" Canvas.Left="330" Canvas.Top="1"/>
           <Grid Height="274" x:Name="searchGrid" Width="326" Visibility="Visible" Background="#FFECECEB">
            <TextBox Margin="87,7.686,95,242.314" Text="Search Opportunities" TextWrapping="Wrap" d:LayoutOverrides="HorizontalAlignment" x:Name="txt_searchheader" TextAlignment="Center" />
         <TextBox Margin="22,34,22,135.631" x:Name="txt_searchinstructions" BorderBrush="{x:Null}" IsTabStop="False" IsReadOnly="True" Text="Top executive positions are seldom posted anywhere except the corporate website. If what you're looking for isn't in our database, we are dedicated to helping you find it. We are all about giving you the personalized service you deserve, please give us a call." TextWrapping="Wrap" Background="#FFFFFFFF"/>
           <ComboBox Margin="54,0,60,109.631" x:Name="drp_city" VerticalAlignment="Bottom" Height="22">
                            <ComboBox.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFF7ED77"/>
                                    <GradientStop Color="#FFCFC424" Offset="1"/>
                                    <GradientStop Color="#FFEBEBEB" Offset="0.51800000667572021"/>
                                    <GradientStop Color="#FFCEC98E" Offset="0.59799998998641968"/>
                                </LinearGradientBrush>
                            </ComboBox.Background>
                            <ComboBoxItem Content="Please choose area of interest..." IsSelected="True"/>
                            <ComboBoxItem Content="All"/>
                            <ComboBoxItem Content="Toronto"/>
                            <ComboBoxItem Content="West G.T.A." />
                            <ComboBoxItem Content="East G.T.A."/>
                            <ComboBoxItem Content="North G.T.A."/>
                            <ComboBoxItem Content="Peel Region"/>
                            <ComboBoxItem Content="York Region"/>
                            <ComboBoxItem Content="Durham Region" />
                            <ComboBoxItem Content="Barrie"/>
                            <ComboBoxItem Content="Guelph area"/>
                            <ComboBoxItem Content="Hamilton area"/>
                        </ComboBox>
         <ComboBox Height="23" Margin="54,0,60,81.963" x:Name="drp_jobtitles" VerticalAlignment="Bottom">
                            <ComboBox.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFF7ED77"/>
                                    <GradientStop Color="#FFCFC424" Offset="1"/>
                                    <GradientStop Color="#FFCEC98E" Offset="0.59799998998641968"/>
                                    <GradientStop Color="#FFEBEBEB" Offset="0.50400000810623169"/>
                                </LinearGradientBrush>
                            </ComboBox.Background>
                            <ComboBoxItem Content="Please choose a job title..." IsSelected="True"/>
                            <ComboBoxItem Content="Accounting/Finance"/>
                            <ComboBoxItem Content="Administrative/Clerical"/>
                            <ComboBoxItem Content="Advertising/Public Relations"/>
                            <ComboBoxItem Content="Architecture"/>
                            <ComboBoxItem Content="Arts &amp; Entertainment"/>
                            <ComboBoxItem Content="Automotive"/>
                            <ComboBoxItem Content="Banking/Mortgage"/>
                            <ComboBoxItem Content="Business Development"/>
                            <ComboBoxItem Content="Construction/Facilities"/>
                            <ComboBoxItem Content="Customer Services"/>
                            <ComboBoxItem Content="Education &amp; Training"/>
                            <ComboBoxItem Content="Engineering"/>
                            <ComboBoxItem Content="Fashion"/>
                            <ComboBoxItem Content="Government"/>
                            <ComboBoxItem Content="Healthcare &amp; Medical"/>
                            <ComboBoxItem Content="Hospitality, Accommodation &amp; Travel"/>
                            <ComboBoxItem Content="Human Resources"/>
                            <ComboBoxItem Content="Insurance"/>
                            <ComboBoxItem Content="Internet &amp; Media"/>
                            <ComboBoxItem Content="Law Enforcement &amp; Security"/>
                            <ComboBoxItem Content="Legal"/>
                            <ComboBoxItem Content="Management &amp; Consulting"/>
                            <ComboBoxItem Content="Manufacturing/Materials"/>
                            <ComboBoxItem Content="Marketing"/>
                            <ComboBoxItem Content="Non-Profit Organizations"/>
                            <ComboBoxItem Content="Occupational Health, Safety &amp; Environmental"/>
                            <ComboBoxItem Content="Pharmaceuticals &amp; Biotech"/>
                            <ComboBoxItem Content="Public Services"/>
                            <ComboBoxItem Content="Publishing"/>
                            <ComboBoxItem Content="Real Estate"/>
                            <ComboBoxItem Content="Restaurant &amp; Food Services"/>
                            <ComboBoxItem Content="Retail"/>
                            <ComboBoxItem Content="Sales"/>
                            <ComboBoxItem Content="Science"/>
                            <ComboBoxItem Content="Student"/>
                            <ComboBoxItem Content="Technical Services/Support"/>
                            <ComboBoxItem Content="Telecommunications"/>
                            <ComboBoxItem Content="Transportation &amp; Logistics"/>
                            <ComboBoxItem Content="Warehouse/Shipping &amp; Receiving"/>
                            <ComboBoxItem Content="Waste Management"/>
                            <ComboBoxItem Content="Other Services"/>
                            <ComboBoxItem Content="Website"/>
                        </ComboBox>
         <TextBox Height="39" Margin="22,0,22,37.963" x:Name="txt_search" VerticalAlignment="Bottom" FontFamily="Portable User Interface" FontWeight="Normal" Foreground="#FF0A0A0A" IsReadOnly="True" Text="Please choose from the dropdowns and click Find Opportunities to search our database." TextAlignment="Left" TextWrapping="Wrap" Background="#FFFFFFFF"/>
         <Button Height="24" HorizontalAlignment="Right" Margin="0,0,22,9" x:Name="btnSearch" VerticalAlignment="Bottom" Width="138" Click="evt_Search" Content="Find Opportunities &gt;&gt;" >
                            <Button.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFF7ED77"/>
                                    <GradientStop Color="#FFCFC424" Offset="1"/>
                                    <GradientStop Color="#FFEBEBEB" Offset="0.5130000114440918"/>
                                    <GradientStop Color="#FFCEC98E" Offset="0.60699999332427979"/>
                                </LinearGradientBrush>
                            </Button.Background>
                        </Button>
           </Grid>
           
    etc etc

    Monday, December 7, 2009 3:45 PM

Answers

  • The error is just a warning because in Silverlight 3 named UserControls is not fully supported (fixed in Silverlight 4 beta).

    To get around this remove the name from your UserControl (x:Name="userControl") and change the one animation from:

    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="userControl" Storyboard.TargetProperty="(UIElement.Opacity)">
       <SplineDoubleKeyFrame KeyTime="00:00:09" Value="1"/>
    </DoubleAnimationUsingKeyFrames>
    to this:

    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)">
       <SplineDoubleKeyFrame KeyTime="00:00:09" Value="1"/>
    </DoubleAnimationUsingKeyFrames>
    

    and you will get the same effect.
    - Adam
    • Marked as answer by GwennaGundy Monday, December 7, 2009 7:53 PM
    Monday, December 7, 2009 7:46 PM

All replies

  • The error is just a warning because in Silverlight 3 named UserControls is not fully supported (fixed in Silverlight 4 beta).

    To get around this remove the name from your UserControl (x:Name="userControl") and change the one animation from:

    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="userControl" Storyboard.TargetProperty="(UIElement.Opacity)">
       <SplineDoubleKeyFrame KeyTime="00:00:09" Value="1"/>
    </DoubleAnimationUsingKeyFrames>
    to this:

    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)">
       <SplineDoubleKeyFrame KeyTime="00:00:09" Value="1"/>
    </DoubleAnimationUsingKeyFrames>
    

    and you will get the same effect.
    - Adam
    • Marked as answer by GwennaGundy Monday, December 7, 2009 7:53 PM
    Monday, December 7, 2009 7:46 PM
  • Thank you very much
    Monday, December 7, 2009 7:54 PM