FanPanel Item Order

Views for WPF Forum

Posted 11 years ago by MCRXB
Version: 13.1.0582
Avatar

I'm using a FanPanel as an ItemTemplate in a ListBox. I'd like to reverse the order in which the items appear. Currently, they appear in this order, numbered as defined in the ListBox:

4    3    2    1

And I'd like them to appear:

1    2    3    4

Is there any way to reverse the order? If I reverse the order, inactive items should appear on the right of the screen. I can manually reverse the listbox items and then set the selectedindex to the last item to achieve the results but the scrollbar then works in the opposite direction that it should.

<ListBox
        Background="Transparent"
        BorderThickness="0"
        ClipToBounds="False"
        Grid.Row="1"
        Margin="0,10,0,0"
        PreviewMouseWheel="ListBox_PreviewMouseWheel"
        ScrollViewer.HorizontalScrollBarVisibility="Visible"
        ScrollViewer.VerticalScrollBarVisibility="Disabled">
        <ListBox.ItemsPanel>
          <ItemsPanelTemplate>
            <views:FanPanel
              BackAngleStep="0"
              BackOffsetStep="700, 0"
              BackOpacityStep="0.8"
              ForeAngleStep="0"
              ForeOffsetStep="700, 0"
              ForeOpacityStep="0.8"
              ForeElementLayoutPlacement="Below" />
          </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
        <ListBox.Items>
          <ListBoxItem>
            ...
          </ListBoxItem>
        </ListBox.Items>
      </ListBox>

 Thank you!

Comments (2)

Answer - Posted 11 years ago by MCRXB
Avatar

I found an easy solution was to use negative values for the fore and back offset setp properties.

[Modified 11 years ago]

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, yes you can set the Fore/BackOffsetSteps to be negative numbers and that will do it.  However you will still have the same issue where the ScrollBar is opposite of the layout.  We don't really have any way to prevent that. 

You might be able to try and put a ScaleTransform with ScaleX="-1" on the ScrollBar's LayoutTransform via an implicit Style within the ListBox's Resouces.  But we've never tried that so I'm not sure if it would work, and if it would introduce input issues.


Actipro Software Support

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.