ARTICLE

Accordion in WPF Toolkit

Posted by Diptimaya Patra Articles | WPF March 04, 2010
Accordion is a Control added to the WPF Toolkit in February 2010 release. In this article we will see how we can use the control.
Reader Level:
Download Files:
 

Introduction

Accordion is a Control added to the WPF Toolkit in February 2010 release. In this article we will see how we can use the control. It was very easy to handle in Silverlight though; we will see how far it is easy in WPF.

Creating WPF Application Project

Fire up Visual Studio 2008 and Create a WPF Application and name the project as AccordionInWPF.

AccordionFig1.gif

We can add an Accordion Control by referencing the following DLL in the Toolkit Folder.

AccordionFig2.gif

Or, we can add it in Expression Blend.

AccordionFig3.gif

After adding the Accordion, we need to add AccordionItem also. Add two of them.

Expression Blend doesn't support designing.

AccordionFig4.gif

So we would go back to Visual Studio, perhaps there we will be able to!

AccordionFig5.gif

Yes, we can add content to the AccordionItem in Visual Studio.

I realized that after adding each control to the content we have to build the project the Expression Blend is able to reload the design.

AccordionFig6.gif

As you see above I have added several controls.

The following is the XAML reference.

AccordionFig7.gif

In this sample we will see how we can select another accordion item by some event in other accordion item.

Here's the thing. We will take user input from AccordionItem "User Input" and on Submit Button click event we will display the "User Info" AccordionItem.

The following code is for your reference.

AccordionFig8.gif

That's it. Run the application and give some input to the TextBoxes and Click on Submit button, you would see the User Info Accordion is selected.

AccordionFig9.gif

I am not able to change the Background color from Blue to any other color. Let me have some tweak on that.

Hope this article helps.

Login to add your contents and source code to this article
post comment
     

please tell me how to add this. i am unable to do this.

Posted by aman gandhi Apr 16, 2011

How do you modify the theme of accordion item? Any help...

Posted by akt akt Feb 01, 2011

You can change the blue background by modifying the theme of the accordion item. For some odd reason it's set to blue.

Posted by Diego Gonzalez Jul 27, 2010

hi,

That is very good article, i wanted to know about your progress in changing the blue background color that you mentioned at the end of the article. If you found any thing related then please share it with me

Thanks

Immi

Posted by Immi May 06, 2010
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Join a Chapter