ComponentOne Carousel for WPF and Silverlight
CarouselPanel Task Based Help / Adding C1Carousel to the Application
In This Topic
    Adding C1Carousel to the Application
    In This Topic

    Follow these steps to add a CarouselPanel control to your project:

    1. From the Visual Studio File menu select New and choose Project.
    2. In the New Project dialog box choose a language in the left-side menu, choose .NET Framework 4 in the Framework drop-down list, and enter a name for the project.
    3. In the Solution Explorer, right-click the project name and choose Add Reference. In the Add Reference dialog box, locate and select the following assemblies and click OK to add references to your project:
      • C1.Silverlight.dll
      • C1.Silverlight.Carousel.dll
    4. Add the XAML namespace to the UserControl or Window tag with the following markup:

      Copy Code

      The namespaces will now appear similar to the following:

      Copy Code
      <UserControl x:Class="QuickStart.MainPage"
      mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400">

    5. In the XAML view add a Resources tag just under the UserControl or Window tag and above the Grid tag with the following markup:

      WPF XAML
      Copy Code

      Silverlight XAML
      Copy Code

      You will add templates within this tag.

    6. Add an ItemsPanelTemplate within the Resources tag to define the C1CarouselPanel:

      Copy Code
      <ItemsPanelTemplate x:Key="carouselPanelTemplate">
      <c1:C1CarouselPanel Padding="0, 10, 50, 50" VerticalPathAlignment="Center" HorizontalItemAnchorOnPath="Center" VerticalItemAnchorOnPath="Center"/>

    You have now added a CarouselPanel to the page. If you run your application now, there will be an empty application displayed.


    See Also