FanPanel orientation

Views for WPF Forum

Posted 13 years ago by Bradley
Avatar
I'm trying to create a fan panel that is always set to the horizontal orientation. The problem is, no matter what settings I use for the offsetstep's the items in the panel always show up vertical. Here's the code

        <ListBox x:Name="ButtonMenu"
                 Grid.Row="1"
                 ItemContainerStyle="{StaticResource BadgeListBoxItemStyle}"
                 ItemsSource="{Binding ChartingMenu, ElementName=this}"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 ScrollViewer.VerticalScrollBarVisibility="Auto">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <views:FanPanel BackAngleStep="0"
                                    BackOffsetStep="100,0"
                                    BackOpacityStep="0"
                                    ForeAngleStep="0"
                                    ForeElementLayoutPlacement="Below"
                                    ForeOffsetStep="100,0"
                                    ForeOpacityStep="1" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
and BadgeListBoxItemStyle is

         <Style x:Key="BadgeListBoxItemStyle"
                   TargetType="ListBoxItem">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBoxItem">
                            <Border x:Name="border"
                                    Width="100" Height="95"
                                    Padding="{TemplateBinding Padding}"
                                    Background="Transparent"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="0">
                                <Grid>
                                    <StackPanel Margin="0,0,0,0"
                                                VerticalAlignment="Center">
                                            <Image Source="{Binding ImageSource}"
                                                   Width="64"
                                                   Height="64" HorizontalAlignment="Center" />

                                        <TextBlock FontSize="8" HorizontalAlignment="Center" Foreground="White"
                                                   Text="{Binding Description}" /> 
                                    </StackPanel>
                                </Grid>
                            </Border>

                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected"
                                         Value="True">
                                    <Setter TargetName="border"
                                            Property="BorderBrush"
                                            Value="#f8ce53" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
ChartingMenu, the thing the listbox binds to, is a DeferrableObservableCollection like one of the other example projects use. Any suggestions?

Edit:
I tried doing this instead, without any success, the items still just show up vertically:

                    <views:FanPanel BackAngleStep="0"
                                    BackOpacityStep="0"
                                    ForeAngleStep="0"
                                    ForeElementLayoutPlacement="Below"
                                    ForeOpacityStep="1">
                        <views:FanPanel.BackOffsetStep>
                            <Point X="10"
                                   Y="10" />
                        </views:FanPanel.BackOffsetStep>
                        <views:FanPanel.ForeOffsetStep>
                            <Point X="10"
                                   Y="10" />
                        </views:FanPanel.ForeOffsetStep>                        
                    </views:FanPanel>
[Modified at 03/14/2011 05:33 PM]

Comments (1)

Posted 13 years ago by Bradley
Avatar
Apparently there was a style being applied to my listbox, and adding Style="{x:Null}" fixed this. Thanks
The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.