Skip to content

Commit

Permalink
Merge pull request #67 from w-ahmad/FilterPerformance
Browse files Browse the repository at this point in the history
use ListView to host filter items
  • Loading branch information
w-ahmad authored Nov 23, 2024
2 parents 655bfac + 250ff69 commit e1a3de2
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions src/WinUI.TableView/Themes/TableViewColumnHeader.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,24 +170,35 @@
BorderThickness="0,0,0,1"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}">
<CheckBox x:Name="SelectAllCheckBox"
Margin="12,8,12,0"
Margin="12,8,12,1"
IsThreeState="True"
Content="(Select All)" />
</Border>
<ScrollViewer Grid.Row="2"
Padding="12,0"
VerticalScrollMode="Enabled">
<ItemsControl ItemsSource="{Binding FilterItems}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}">
<TextBlock Text="{Binding Value}"
TextWrapping="NoWrap" />
</CheckBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<ListView Grid.Row="2"
SelectionMode="None"
ItemsSource="{Binding FilterItems}">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem"
BasedOn="{StaticResource DefaultListViewItemStyle}">
<Setter Property="Padding"
Value="12,0" />
<Setter Property="Margin"
Value="0" />
<Setter Property="MinHeight"
Value="36" />
<Setter Property="Height"
Value="36" />
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}">
<TextBlock Text="{Binding Value}"
TextWrapping="NoWrap" />
</CheckBox>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</ControlTemplate>
</MenuFlyoutItem.Template>
Expand Down

0 comments on commit e1a3de2

Please sign in to comment.