-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing VirtualizingItemsControlStyle
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
70 changes: 70 additions & 0 deletions
70
GW2PAO/Style/NamedStyles/VirtualizingItemsControlStyle.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:core="clr-namespace:GW2PAO.PresentationCore;assembly=GW2PAO.PresentationCore"> | ||
|
||
<Style x:Key="LeftScrollViewer" TargetType="{x:Type ScrollViewer}"> | ||
<Setter Property="OverridesDefaultStyle" Value="True" /> | ||
<Setter Property="CanContentScroll" Value="True" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type ScrollViewer}"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition /> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
<ScrollContentPresenter Grid.Column="1" Grid.Row="1" CanContentScroll="True" /> | ||
<ScrollBar x:Name="PART_VerticalScrollBar" | ||
Grid.Column="0" Grid.Row="1" | ||
Value="{TemplateBinding VerticalOffset}" | ||
Maximum="{TemplateBinding ScrollableHeight}" | ||
ViewportSize="{TemplateBinding ViewportHeight}" | ||
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/> | ||
<ScrollBar x:Name="PART_HorizontalScrollBar" | ||
Orientation="Horizontal" | ||
Grid.Row="0" | ||
Grid.Column="1" | ||
Value="{TemplateBinding HorizontalOffset}" | ||
Maximum="{TemplateBinding ScrollableWidth}" | ||
ViewportSize="{TemplateBinding ViewportWidth}" | ||
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/> | ||
</Grid> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
<Style x:Key="VirtualizingItemsControlStyle" TargetType="ItemsControl"> | ||
<Setter Property="VirtualizingStackPanel.IsVirtualizing" Value="True" /> | ||
<Setter Property="ScrollViewer.CanContentScroll" Value="True" /> | ||
<Setter Property="ItemsPanel"> | ||
<Setter.Value> | ||
<ItemsPanelTemplate> | ||
<VirtualizingStackPanel IsItemsHost="True" VirtualizingStackPanel.VirtualizationMode="Recycling" /> | ||
</ItemsPanelTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate> | ||
<Border BorderThickness="{TemplateBinding Border.BorderThickness}" | ||
Padding="{TemplateBinding Control.Padding}" | ||
BorderBrush="{TemplateBinding Border.BorderBrush}" | ||
Background="{TemplateBinding Panel.Background}" | ||
SnapsToDevicePixels="True"> | ||
<ScrollViewer Padding="{TemplateBinding Control.Padding}" | ||
Focusable="False" | ||
Style="{StaticResource LeftScrollViewer}"> | ||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" /> | ||
</ScrollViewer> | ||
</Border> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
</ResourceDictionary> |