This project is read-only.

ElementFlow

Mar 18, 2008 at 9:26 PM
First off, thank you very much for putting this code out there. There is obviously a lot of work and thought put into it.

I do have a couple of questions though.

First, I have tried to use the control as the ItemsHost in a ListBox, and while it works visually, it doesnt select an item in the list as far as the ListBox is concerned. Any Suggestions.

Second, any thought as to how to allow gestures on the ElementFlow? Ala an iPhone type of interface, with swipes and such?

Again, thanks for putting this out there. I have played with adding the Penner Animations in for the zAxis animation in the Cover Flow View State and they work real well.

Paul
Mar 19, 2008 at 2:30 PM
Hi Paul,

The Selection model for ElementFlow is not tied to an ItemsControl at the moment although that is something I could consider. Right now I expose a SelectedIndex dep-property on ElementFlow which you can hook into to make selections.

Gestures: Its actually easy to add gestures to ElementFlow. I have done that for an iPhone clone I created a while back. A short explanation of how you can do it is by overlaying an InkCanvas on the ItemsControl and translating the gestures on the InkCanvas to specific calls on ElementFlow.

Mar 31, 2008 at 9:30 PM
pmont or pavanpodila,

Any chance you could post the code you used to use the control as the ItemsHost of a ListBox? I'm having issues getting this working. I'm getting the following error:

"Layout measurement override of element 'FluidKit.Controls.ElementFlow' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size."

My list box
<ListBox x:Name="MainListBox"
VirtualizingStackPanel.IsVirtualizing="True"
SelectionMode="Single"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Source={StaticResource SortedAudioFilesView}}"
ItemTemplate="{StaticResource ListBoxItemOptimized}"
PreviewMouseWheel="MainListBox_PreviewMouseWheel"
Background="{x:Null}"
Margin="0,0,0,0"
Grid.Column="1"
BorderThickness="0,0,0,0"
HorizontalContentAlignment="Left"
Grid.Row="1"
>
</ListBox>


My Style for the elementflow:

<Style x:Key="ListBoxElementFlowPanel"
TargetType="{x:Type ListBox}">
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility"
Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility"
Value="Auto" />
<Setter Property="ScrollViewer.CanContentScroll"
Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<ScrollViewer VerticalScrollBarVisibility="Auto"
Background="{TemplateBinding Background}">
<ItemsControl x:Name="_itemsControl"
Grid.Row="1"
Grid.Column="1"
ItemsSource="{Binding Source={StaticResource SortedAudioFilesView}}"
ItemTemplate="{StaticResource ListBoxItemOptimized}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<FluidKit.Controls:ElementFlow x:Name="ElementFlow"
Focusable="True"
TiltAngle="45"
ItemGap="0.5"
FrontItemGap="0.65"
PopoutDistance="1.0"
ElementWidth="188"
ElementHeight="230"
UseReflection="False"
Background="Black" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Mar 31, 2008 at 9:34 PM
That was quick. I posted a few seconds too soon.

I just had to remove the ScrollViewer from the style and it's working.

Thanks for an awesome control. Now I just need help on making the items editable.

John