Posted 14 years ago
by Bradley

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
and BadgeListBoxItemStyle is
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:[Modified at 03/14/2011 05:33 PM]
<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>
<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>
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>