locked
How to use the carousel panel in windows 8

    Question

  • Can anybody give me an example on how to use the carousel panel control in visual studio 2011 express beta? What does the control do exactly?

    Thanks and Regards, Prashanth MP.

    Thursday, March 15, 2012 12:24 PM

Answers

  • That was true in the Developer Preview. The following code snippets show how to use the CarouselPanel in other item controls (the parent has to be an ItemsControl indeed):

    <ListBox x:Name="CarouselHost"
                Height="100"
                Width="600">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <CarouselPanel />
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
    </ListBox>

    this.CarouselHost.Items.Add("x");
    this.CarouselHost.Items.Add("y");
    this.CarouselHost.Items.Add("z");
    this.CarouselHost.Items.Add("q");
    // etc...
    It displays the items as a revolving list.


    Thursday, March 15, 2012 3:44 PM

All replies

  • Per Mark Rideout on this thread:http://social.msdn.microsoft.com/Forums/en-gb/winappswithcsharp/thread/e996fbb7-9224-4049-8ac2-e8f210008c7a the CarouselPanel is only intended to be used within a ComboBox.

    Rebecca M. Riordan

    Thursday, March 15, 2012 2:11 PM
  • That was true in the Developer Preview. The following code snippets show how to use the CarouselPanel in other item controls (the parent has to be an ItemsControl indeed):

    <ListBox x:Name="CarouselHost"
                Height="100"
                Width="600">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <CarouselPanel />
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
    </ListBox>

    this.CarouselHost.Items.Add("x");
    this.CarouselHost.Items.Add("y");
    this.CarouselHost.Items.Add("z");
    this.CarouselHost.Items.Add("q");
    // etc...
    It displays the items as a revolving list.


    Thursday, March 15, 2012 3:44 PM
  • Cool, thanks. I keep forgetting to check the dates on these threads. So thanks for the info, Diederik, and thanks for not letting my bad info stand.

    Rebecca M. Riordan

    Thursday, March 15, 2012 3:50 PM
  • Thanks for the info guys :)

    Thanks and Regards, Prashanth MP.

    Friday, March 16, 2012 6:27 AM
  • I copied and pasted Diederik's code into an metro-style app, but CarouselPanel looks just like a StackPanel.  There's no "revolving list" to be seen.  Do you guys have some special update to .NET 4.5 that I don't?  I have the one that came with Windows 8 Consumer Preview.

    Thursday, April 5, 2012 12:31 AM
  • it looks like stackpanel. When you reach the end of the list, you can continue scrolling in the same direction. After the end of the list an empty placeholder is inserted, and then everything starts all over again.

    http://blogs.u2u.be/diederik/post/2012/03/28/Using-the-CarouselPanel-in-Windows-8-Metro.aspx


    http://leeontech.wordpress.com/

    Thursday, April 5, 2012 8:16 AM
  • With a mouse and keyboard (no touchscreen) it's only noticeable when using the scroll wheel on the mouse.  It doesn't work using the down button on the scrollbar.  It doesn't work using the down arrow on the keyboard.

    In any case, this is not what I expected of a CarouselPanel.  I was going to use this control, but I'm quite disappointed now seeing that's all it does.

    Thursday, April 5, 2012 1:10 PM
  • That was true in the Developer Preview. The following code snippets show how to use the CarouselPanel in other item controls (the parent has to be an ItemsControl indeed):

    <ListBox x:Name="CarouselHost"
                Height="100"
                Width="600">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <CarouselPanel />
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
    </ListBox>

    this.CarouselHost.Items.Add("x");
    this.CarouselHost.Items.Add("y");
    this.CarouselHost.Items.Add("z");
    this.CarouselHost.Items.Add("q");
    // etc...
    It displays the items as a revolving list.


    This sample worked in the Consumer Preview, but with Visual Studio 2012 RC and Windows 8 Release Preview, it does not.

    I get: "The Panel you are using for the Control is not allowed as an ItemsPanel for the Control."

    An oversight, or is this functionality intentionally changing again?

    Tuesday, June 5, 2012 2:23 PM
  • Sorry for the problems. CarouselPanel is only intended to be used within a ComboBox.

    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Tuesday, June 5, 2012 9:56 PM
  • Well you can use it to choose a number, like when you add an alarm on Windows Phone 7.

    here is an unsolicited and shameless plug :)

    how to make a carousel control for Windows 8 store app


    Pinoy

    Tuesday, October 9, 2012 11:38 AM