Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use ListView to host filter items #67

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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