Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 646123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:34:38+00:00 2026-05-13T21:34:38+00:00

I have a problem styling/templating an AccordionItem in the accordion control from the silverlight

  • 0

I have a problem styling/templating an AccordionItem in the accordion control from the silverlight toolkit. For some reason, the child controls are Horizontally Aligned Left. The only way I can get to fix this is to edit the ExpandableContentControlStyle on the AccordionItem.

The style is located below:

<Style x:Key="ExpandableContentControlStyle1" TargetType="layoutPrimitivesToolkit:ExpandableContentControl">
  <Setter.Value>
     <ControlTemplate TargetType="layoutPrimitivesToolkit:ExpandableContentControl">
        <ContentPresenter x:Name="ContentSite" Cursor="{TemplateBinding Cursor}" Margin="0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Stretch" />
     </ControlTemplate>
  </Setter.Value>
 </Setter>
</Style>

Now my problem is that to have this style being attached to the AccordionItem, I have to set it:

<layoutToolkit:Accordion HorizontalAlignment="Stretch">
   <layoutToolkit:AccordionItem Header="Hello" BorderBrush="{x:Null}" ExpandableContentControlStyle="{StaticResource ExpandableContentControlStyle1}"/>
   <layoutToolkit:AccordionItem Header="Haha" BorderBrush="{x:Null}"/>
</layoutToolkit:Accordion>

But those AccordionItem will be generated from an ItemSource. What I’d like to do is to have that style be applied to the generated AccordionItem without setting it.

PS. The above problem can become obsolete if I can just find out how to edit the (ContentPresenter x:Name=”ContentSite”) from the parent Accordion. I cannot edit it from none of the following template properties:

  1. ContentTemplate
  2. ItemContainerStyle
  3. AccordionButtonStyle
  4. ItemsPanel
  5. ItemTemplate

If anyone knows what is going on with that, I’d appreciate the help or you can just help with styling of multiple elements.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:34:39+00:00Added an answer on May 13, 2026 at 9:34 pm

    I haven’t used the Accordion control myself, though typically you set the ItemContainerStyle to the style you want for each item in the list. For instance, if you wanted a specific ListBoxItem style on a ListBox, you set the ItemContainerStyle to the ListBoxItem style you want. I glanced at the source for the Accordion and this seems to hold true for that control as well. Try setting the ItemContainerStyle property of the Accordion to your ExpandableContentControlStyle1.

    <layoutToolkit:Accordion
        HorizontalAlignment="Stretch"
        ItemContainerStyle="{StaticResource ExpandableContentControlStyle1}">
    </layoutToolkit:Accordion>
    

    To set the style outside of the control itself, create a style for the Accordion. If you’re using Silverlight 4, you can use implicit styles. Put the following style in the <UserControl.Resources> section of your page.

    <Style TargetType="layoutToolkit:Accordion">
      <Setter Property="ItemContainerStyle" Value="{StaticResource ExpandableContentControlStyle1}"/>
    </Style>
    

    Otherwise, with Silverlight 3 you’ll have to explicitly give the style a Key and explicitly set the style on the Accordion control.

    <Style x:Key="Control_Accordion" TargetType="layoutToolkit:Accordion">
        <Setter Property="ItemContainerStyle" Value="{StaticResource ExpandableContentControlStyle1}"/>
    </Style>
    
    <layoutToolkit:Accordion
        Style="{StaticResource Control_Accordion}"
        HorizontalAlignment="Stretch">
    </layoutToolkit:Accordion>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form which has some styling applied, including a border. The problem
I have a rich:modalPanel which I am styling from external css, But the problem
I have problem with UIWebView delay when the load image from url. In my
I have a problem with styling legend items in Highcharts , when applying a
I have a problem with asp:button styling. I added following style: .myAspButton { background-image:
I got a problem with CSS styling of a page. Basically I have a
I have a problem styling my form. Everything works fine except the checkboxes. They
I have a styling problem, I am using WordPress and want to do have
I have a problem with the styling of a searchbar in IE9. There is
I am getting a styling problem with options. I need some options to appear

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.