WrapPanel
Verwendung in ListBox
ItemsPanelTemplate
mit Vertical
Orientation
und VerticalScrollbarVisibility
Satz Disabled
, kann ich meinen scrollen Inhalt nicht mit dem Mausrad, in horizontaler Richtung.wpf listbox WrapPanel scroll verticle Orientierung
Ich mag meine ListBox machen, um anzuzeigen, wie es in horizontaler Richtung bewegen-fähig sein kann, aber die Elemente in Richtung von oben nach unten in Bezug auf die Fensterhöhe erscheinen sollen.
Artikel sollen auf diese Weise erscheinen, wie unten
1 4 7 10
2 5 8 11 ...
3 6 9 12
Das Hauptproblem ist, ich nicht mit der Maus bewegen kann. Mit Scrollbar funktioniert es gut, mit der Tastaturauswahl funktioniert es gut.
Hier ist, was ich tat
<ListBox ItemContainerStyle="{StaticResource ResourceKey=ContainerStyle}" Background="{StaticResource StaticBackground}" ItemsSource="{Binding ListSource}" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical" ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Flow of data from top to bottom with horizontal orientation
und das ist mein ItemContainerStyle
<Style TargetType="{x:Type ListBoxItem}" x:Key="ContainerStyle">
<Setter Property="ContentTemplate" Value="{StaticResource DT_TestTemplate}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border x:Name="Border"
Margin="5,5,5,5"
SnapsToDevicePixels="true">
<Border.Background>
<SolidColorBrush Color="Transparent" />
</Border.Background>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Unselected" >
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).
(SolidColorBrush.Color)">
<EasingColorKeyFrame KeyTime="0"
Value="White" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Selected">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).
(SolidColorBrush.Color)">
<EasingColorKeyFrame KeyTime="0"
Value="#FFF34235" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="SelectedUnfocused">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).
(SolidColorBrush.Color)">
<EasingColorKeyFrame KeyTime="0"
Value="#FFF34235" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True" >
<!--<Setter Property="ContentTemplate" Value="{StaticResource DT_TestTemplateSelectedItem}" />-->
<Setter Property="BorderBrush" Value="Transparent" />
</Trigger>
</Style.Triggers>
</Style>
Was kann ich tun, um es mit dem Mausrad zu machen bewegen?
Klären Sie Ihre Frage, weil nicht klar ist. – Aybe