Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ComboBox > 'System.Windows.Controls.Panel.Children' is set more than once. [Line: 339 Position: 18]

Not answered 'System.Windows.Controls.Panel.Children' is set more than once. [Line: 339 Position: 18]

Feed from this thread
  • Eric avatar

    Posted on Apr 20, 2010 (permalink)

    I resolved this by upgrading to the SL4 controls 

    Reply

  • Chris avatar

    Posted on Apr 21, 2010 (permalink)

    I too saw this issue when using the Silverlight 3 controls. Upgrading to the SIlverlight 4 controls resulted in a different error for me:

    Failed to create a 'System.Windows.DependencyProperty' from the text 'animation:AnimationManager.AnimationSelector'. [Line: 6 Position: 34]

    So far I am only referencing Telerik.Windows.Controls and Telerik.Windows.Controls.Input. Is there another Silverlight 4 reference I need to add?

    Thanks

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Eric avatar

    Posted on Apr 21, 2010 (permalink)

    On this site I went to "your account" "downloads" "latest internal builds"

    Get the SL4 zip file, unzip it to a new folder (I created one in program files\telerik)

    In your project - delete the current references you have
    add in new references for the same DLLs but from the above (new) folder

    Save, exit vs2010, restart and run
    My project is using 5 dlls (input, navigation, data, charting, controls) and I did not have to add anything else/new

    On the silverlight tab of your client side project make sure the targer silverlight version is 4

    Reply

  • Chris avatar

    Posted on Apr 21, 2010 (permalink)

    Hi,
    I followed your instructions and still see the same error. It occurs right on the InitializeComponent(). I should probably have mentioned that I am still on the Release Candidate of Visual Studio 2010.

    Reply

  • Eric avatar

    Posted on Apr 21, 2010 (permalink)

    I've installed the released version of 2010, toolkit etc.  takes hours but might be worth it.  Apart from that you probably need help from Telerik proper.

    Reply

  • Valeri Hristov Valeri Hristov admin's avatar

    Posted on Apr 26, 2010 (permalink)

    Hello Eric, Chris,

    Silverlight 4 XAML parser is more "strict" than the Silverlight 3's parser and it throws exceptions for code that worked well in Silverlight 3. That's why you should use our Silverlight 4 assemblies in Silverlight 4 applications.

    All the best,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Simon Wolters avatar

    Posted on Apr 27, 2010 (permalink)

    I also get the exception after upgrading my projects from SL3 to SL4 and replacing all the assemblies and references with the v422 telerik release:
    Failed to create a 'System.Windows.DependencyProperty' from the text 'animation:AnimationManager.AnimationSelector'.

    The inner exception says:
    {System.TypeInitializationException: Der Typeninitialisierer für "Telerik.Windows.Controls.Animation.AnimationManager" hat eine Ausnahme verursacht. ---> System.TypeLoadException: Der Typ 'System.Action' konnte nicht aus der mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e -Assembly geladen werden.
       bei Telerik.Windows.Controls.Animation.AnimationManager..cctor()
       --- Ende der internen Ausnahmestapelüberwachung ---
       bei System.Runtime.CompilerServices.RuntimeHelpers._RunClassConstructor(RuntimeType type)
       bei System.Windows.DependencyProperty.QueryRegisteredProperty(String name, Type ownerType)
       bei MS.Internal.ManagedTypeInfoProviderRPInvokes.LookupDependencyProperty(Type type, String name)
       bei MS.Internal.ManagedTypeInfoProviderRPInvokes.ResolveDependencyPropertyName(XamlTypeToken sTypeToken, String inPropertyName, XamlPropertyToken& outProperty, XamlTypeToken& outPropertyTypeToken)}






    I removed all the mentioned extension properties for animations from my controls but still get the error. I guess the problem is that your themes are using these properties as well.

    Reply

  • Valeri Hristov Valeri Hristov admin's avatar

    Posted on Apr 27, 2010 (permalink)

    Hi Simon,

    I already answered the following thread:
    http://www.telerik.com/community/forums/silverlight/combobox/error-using-silverlight-4-controls.aspx

    The exception should disappear if you update the Silverlight runtime to version 4.0.50401.

    Kind regards,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Simon Wolters avatar

    Posted on Apr 28, 2010 (permalink)

    Hi Valeri,

    thank you - indeed the exception is gone after the SL runtime upgrade.
    Now I unfortunately get the same exception as mentioned by the thread creator:
    'System.Windows.Controls.Panel.Children' is set more than once.

    I am using a custom theme that is based on the telerik v3.09 windows 7 theme. If I disable this theme and use your default theme, the solution works fine. Do you know which propertie(s) are causing this error in SL4? I'd rather fix those than reapply my custom theming to the new version.

    Reply

  • Valeri Hristov Valeri Hristov admin's avatar

    Posted on Apr 29, 2010 (permalink)

    Hello Simon,

    The "'System.Windows.Controls.Panel.Children' is set more than once" exception is caused by invalid XAML: in Silverlight 4 setting attached properties inside the content of an element is considered an error, hence the exception. For example the following XAML is wrong:
    <Grid>
        <Border />
        <VisualStyleManager.VisualStateGroups>
        ...
        </VisualStyleManager.VisualStateGroups>
        <StackPanel />
    </Grid>

    but the following is OK:
    <Grid>
        <VisualStyleManager.VisualStateGroups>
        ...
        </VisualStyleManager.VisualStateGroups>
        <Border />
        <StackPanel />
    </Grid>

    note that to fix the problem, the attached property VisualStateGroups should be the first XML element inside the Grid element. This XAML used to work fine in Silverlight 3 and the early versions of Silverlight 4.

    Sincerely yours,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Simon Wolters avatar

    Posted on Apr 29, 2010 (permalink)

    That did the trick!

    Thank you very much. The telerik support is really awesome.

    Reply

  • Mike Lee avatar

    Posted on Sep 1, 2010 (permalink)

    Thanks for this solution.  We've been trying to figure this out for weeks, and thought we introduced a bad element into our theme.  Basically, we took the template for the radcombobox and moved the VisualStateManager to the top of the grid, and moved a border to the bottom to get rid of the error.  Thanks!

    This snippet:
    <vsm:VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="Normal" />
            <VisualState x:Name="MouseOver">
                <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="RenderHighlighted">
                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                            <DiscreteObjectKeyFrame.Value>
                                <sys:Boolean>True</sys:Boolean>
                            </DiscreteObjectKeyFrame.Value>
                        </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                </Storyboard>
            </VisualState>
            <VisualState x:Name="Disabled">
                <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity">
                        <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.33" />
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
            </VisualState>
        </VisualStateGroup>
    </vsm:VisualStateManager.VisualStateGroups>
     
    <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" />



    - Mike
    www.eikospartners.com

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ComboBox > 'System.Windows.Controls.Panel.Children' is set more than once. [Line: 339 Position: 18]
Related resources for "'System.Windows.Controls.Panel.Children' is set more than once. [Line: 339 Position: 18]"

Silverlight ComboBox Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]