Files
DP44/Common/DTS.CommonCore/Controls/GridViewColumnHeaderSearchable.xaml
2026-04-17 14:55:32 -04:00

48 lines
4.3 KiB
XML

<UserControl x:Class="DTS.Common.Controls.GridViewColumnHeaderSearchable"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DTS.Common.Controls"
mc:Ignorable="d"
x:Name="dtsGridViewColumnHeader"
d:DesignHeight="20" d:DesignWidth="200" PreviewMouseLeftButtonDown="PreviewLeftButtonUp">
<UserControl.Resources>
<ResourceDictionary>
<Geometry x:Key="FilterIconGeometry">M2.9999999,0.99999994 L2.9999999,2 3.9999999,2 3.9999999,3 4.9999999,3 4.9999999,4 5.9999999,4 5.9999999,3 6.9999999,3 6.9999999,2 7.9999999,2 7.9999999,0.99999994 6.9999999,0.99999994 5.9999999,0.99999994 4.9999999,0.99999994 3.9999999,0.99999994 z M0,0 L11,0 11,0.99999994 9.9999999,0.99999994 9.9999999,2 8.9999999,2 8.9999999,3 7.9999999,3 7.9999999,4 6.9999999,4 6.9999999,12 3.9999999,12 3.9999999,4 2.9999999,4 2.9999999,3 1.9999999,3 1.9999999,2 0.99999994,2 0.99999994,0.99999994 0,0.99999994 z</Geometry>
<Geometry x:Key="DownArrowIconGeometry">F0 M 0,0L 10,0L 5,7L 0,0 Z</Geometry>
<local:BoolToInvertedBoolConverter x:Key="BoolToInvertedBoolConverter"/>
<Geometry x:Key="MagnifierIconGeometry">M53.049224,12 C41.049224,12 31.049224,22 31.049224,34 31.049224,46 41.049224,56 53.049224,56 65.049224,56 75.049224,46 75.049224,34 75.049224,22 65.049224,12 53.049224,12 z M53.049224,0 C72.049224,0 87.049224,15 87.049224,34 87.049224,53 72.049224,68 53.049224,68 49.049224,68 45.549224,67.5 42.049224,66 L41.549224,66 13.5,103.5 3.1554435E-30,92.092051 27.049224,55.5 26.987233,55.354591 C22.987233,49.354591 19.049224,42 19.049224,34 19.049224,15 34.049224,0 53.049224,0 z</Geometry>
</ResourceDictionary>
</UserControl.Resources>
<Grid DataContext="{Binding ElementName=dtsGridViewColumnHeader}" x:Name="mainGrid" Height="20" MaxHeight="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border BorderThickness="0" Grid.Column="0">
<TextBlock Text="{Binding Path=HeaderTitle, FallbackValue='I Should Not Be Here'}" HorizontalAlignment="Left" Margin="5,0,5,0" AutomationProperties.AutomationId="ColumnTitle"/>
</Border>
<!--<Button Grid.Column="0" Content="{Binding Path=HeaderTitle, FallbackValue='I should not be here'}" HorizontalAlignment="Left" Margin="5,0,5,0" Click="ButtonClick" /> -->
<ToggleButton Grid.Column="1" x:Name="TogglePopupButton" Width="20" Height="20" MaxWidth="20" MaxHeight="20" IsEnabled="{Binding ElementName=ToggledPopup, Path=IsOpen, Converter={StaticResource BoolToInvertedBoolConverter}}"
IsChecked="{Binding ToggleButtonIsChecked, Mode=TwoWay, FallbackValue=True}" >
<Path x:Name="BtnArrow" VerticalAlignment="Center" HorizontalAlignment="Center" Width="8" Fill="#FF527DB5" Stretch="Uniform"
Data="{Binding ToggleIconGeometry, FallbackValue={StaticResource DownArrowIconGeometry}}"/>
</ToggleButton>
<Popup Grid.Column="0" Grid.ColumnSpan="2" x:Name="ToggledPopup" HorizontalAlignment="Stretch" Placement="Bottom" VerticalAlignment="Stretch" StaysOpen="False" IsOpen="{Binding ToggleButtonIsChecked, Mode=TwoWay}">
<Border Background="#FFEEEEEE" BorderBrush="#FF888888" BorderThickness="1">
<Grid HorizontalAlignment="Stretch" Margin="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Path Grid.Column="0" Data="{StaticResource MagnifierIconGeometry}" Margin="5" Width="10" Height="10" Fill="#FF888888" Stretch="Fill" />
<TextBox Grid.Column="1" Width="150" Text="{Binding HeaderSearchTerm}" KeyUp="HeaderSearchTerm_KeyDown" />
</Grid>
</Border>
</Popup>
</Grid>
<!--</GridViewColumnHeader>-->
</UserControl>