wpf "carousel listbox" Something like the Spotify app RRS feed

  • Question

  • Hello,
    I need advice on how to create something like a "carousel listbox", which will dynamically add or subtract items from the listbox on the basis of changes in the size of the program window, and also that they be grouped into pages.

    Something like the Spotify app.

    See picture:

    I tried to create something similar to help PathListbox http://expressionblend.codeplex.com , but still that's not it. Then I tried created a listbox that displays items horizontally: see source code

    I would be very glad for any advice. Thanks a lot.

    <ListBox x:Name="ListBoxPlaylists" 
                     ItemsSource="{Binding FeaturedPlaylistsCvs,IsAsync=True}"
                     ItemTemplate="{StaticResource FeaturedPlaylistsItemTemplate}" 
                        <VirtualizingStackPanel x:Name="MyStackPanel" 
                                <ei:FluidMoveBehavior Duration="0:0:0:1" AppliesTo="Children">
                                        <QuinticEase EasingMode="EaseInOut"/>
                                        <QuinticEase EasingMode="EaseInOut"/>
                    <Style TargetType="{x:Type ListBoxItem}">
                        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
                        <Setter Property="SnapsToDevicePixels" Value="True"></Setter>
                        <Setter Property="Template">
                                <ControlTemplate TargetType="ListBoxItem">
                                    <ContentPresenter x:Name="Cont" Margin="10" Content="{TemplateBinding Content}"
                                         ContentTemplate="{TemplateBinding ContentTemplate}"/>
                            <Trigger Property="IsMouseOver"
                                <Setter Property="Background"
                        Value="Transparent" />
                            <Trigger Property="IsSelected"
                                <Setter Property="Background"
                        Value="Transparent" />
       <DataTemplate x:Key="FeaturedPlaylistsItemTemplate">
                    <DropShadowEffect x:Key="z-depth1" BlurRadius="5" ShadowDepth="1" Direction="270" Color="Black"/>
                <Grid x:Name="Grid1" d:DesignWidth="199" d:DesignHeight="316" MaxHeight="316" Background="{DynamicResource WindowBackground}"  >
                        <RowDefinition Height="199"/>
                        <RowDefinition Height="*"/>
                    <cachedImage:Image Grid.Row="0" 
                                       ImageUrl="{Binding ImgUrl}" 
                                       HorizontalAlignment="Stretch" />
                    <StackPanel Grid.Row="1" Height="47" VerticalAlignment="Top" Width="Auto">
                        <TextBlock Margin="10,10,10,0" TextTrimming="CharacterEllipsis" Text="{Binding Title}"/>
                        <TextBlock Margin="10,10,10,0" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" MaxHeight="50" Text="{Binding Description}"/>

    Thursday, January 5, 2017 10:14 AM

All replies

  • Hi ORRNY66,

    >>Then I tried created a listbox that displays items horizontally

    I found the following article describes a suitable way to implement this.

    WPF: Carousel Control:

    I also found the third-party control wpf-coverflow may be helpful for you.

    WPF Cover Flow Tutorial:

    WPF itself does not province such a control to use, I suggest you can refer to some good three-party control to achieve this effect.

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best Regards,

    Yohann Lu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, January 6, 2017 5:27 AM