|
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 | 4 | xmlns:converters="clr-namespace:Flow.Launcher.Converters" |
5 | 5 | xmlns:core="clr-namespace:Flow.Launcher.Core.Resource;assembly=Flow.Launcher.Core" |
6 | | - xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"> |
| 6 | + xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" |
| 7 | + xmlns:wpftk="clr-namespace:WpfToolkit.Controls;assembly=VirtualizingWrapPanel"> |
7 | 8 | <converters:BorderClipConverter x:Key="BorderClipConverter" /> |
8 | 9 | <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> |
9 | 10 | <converters:TextConverter x:Key="TextConverter" /> |
|
384 | 385 | </Style.Triggers> |
385 | 386 | </Style> |
386 | 387 |
|
387 | | - <Style |
388 | | - x:Key="StoreListStyle" |
389 | | - BasedOn="{StaticResource {x:Type ListBox}}" |
390 | | - TargetType="ListBox"> |
| 388 | + <Style x:Key="StoreListStyle" TargetType="ui:GridView"> |
| 389 | + <Setter Property="Padding" Value="0 0 0 10" /> |
| 390 | + <Setter Property="IsTabStop" Value="False" /> |
| 391 | + <Setter Property="KeyboardNavigation.TabNavigation" Value="Once" /> |
| 392 | + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" /> |
| 393 | + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> |
| 394 | + <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" /> |
| 395 | + <Setter Property="ScrollViewer.PanningMode" Value="Both" /> |
| 396 | + <Setter Property="UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" /> |
| 397 | + <Setter Property="FocusVisualMargin" Value="-2" /> |
| 398 | + <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" /> |
| 399 | + <Setter Property="ui:ScrollViewerHelper.AutoHideScrollBars" Value="{DynamicResource AutoHideScrollBars}" /> |
391 | 400 | <Setter Property="Background" Value="{DynamicResource Color01B}" /> |
| 401 | + <Setter Property="ItemsPanel"> |
| 402 | + <Setter.Value> |
| 403 | + <ItemsPanelTemplate> |
| 404 | + <wpftk:VirtualizingWrapPanel |
| 405 | + x:Name="ItemWrapPanel" |
| 406 | + Margin="0 0 0 10" |
| 407 | + ItemSize="216,184" |
| 408 | + MouseWheelDelta="48" |
| 409 | + ScrollLineDelta="16" |
| 410 | + SpacingMode="None" |
| 411 | + StretchItems="True" /> |
| 412 | + </ItemsPanelTemplate> |
| 413 | + </Setter.Value> |
| 414 | + </Setter> |
| 415 | + <Setter Property="Template"> |
| 416 | + <Setter.Value> |
| 417 | + <ControlTemplate TargetType="ui:GridView"> |
| 418 | + <Border |
| 419 | + Background="{TemplateBinding Background}" |
| 420 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 421 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 422 | + CornerRadius="{TemplateBinding CornerRadius}" |
| 423 | + SnapsToDevicePixels="True"> |
| 424 | + <ui:ScrollViewerEx |
| 425 | + x:Name="ScrollViewer" |
| 426 | + AutoHideScrollBars="{TemplateBinding ui:ScrollViewerHelper.AutoHideScrollBars}" |
| 427 | + Focusable="false" |
| 428 | + HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" |
| 429 | + IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" |
| 430 | + KeyboardNavigation.TabNavigation="{TemplateBinding KeyboardNavigation.TabNavigation}" |
| 431 | + VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> |
| 432 | + <Grid> |
| 433 | + <Grid.RowDefinitions> |
| 434 | + <RowDefinition Height="Auto" /> |
| 435 | + <RowDefinition Height="*" /> |
| 436 | + <RowDefinition Height="Auto" /> |
| 437 | + </Grid.RowDefinitions> |
| 438 | + <ContentPresenter |
| 439 | + Grid.Row="0" |
| 440 | + HorizontalAlignment="Stretch" |
| 441 | + VerticalAlignment="Stretch" |
| 442 | + Content="{TemplateBinding Header}" |
| 443 | + ContentTemplate="{TemplateBinding HeaderTemplate}" /> |
| 444 | + <ItemsPresenter |
| 445 | + Grid.Row="1" |
| 446 | + Margin="{TemplateBinding Padding}" |
| 447 | + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
| 448 | + <ContentPresenter |
| 449 | + Grid.Row="2" |
| 450 | + HorizontalAlignment="Stretch" |
| 451 | + VerticalAlignment="Stretch" |
| 452 | + Content="{TemplateBinding Footer}" |
| 453 | + ContentTemplate="{TemplateBinding FooterTemplate}" /> |
| 454 | + </Grid> |
| 455 | + </ui:ScrollViewerEx> |
| 456 | + </Border> |
| 457 | + <ControlTemplate.Triggers> |
| 458 | + <MultiTrigger> |
| 459 | + <MultiTrigger.Conditions> |
| 460 | + <Condition Property="IsGrouping" Value="True" /> |
| 461 | + <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="False" /> |
| 462 | + </MultiTrigger.Conditions> |
| 463 | + <Setter Property="ScrollViewer.CanContentScroll" Value="False" /> |
| 464 | + </MultiTrigger> |
| 465 | + </ControlTemplate.Triggers> |
| 466 | + </ControlTemplate> |
| 467 | + </Setter.Value> |
| 468 | + </Setter> |
392 | 469 | <Style.Triggers> |
393 | 470 | <DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}" Value="0"> |
394 | 471 | <Setter Property="Template"> |
|
0 commit comments