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

48 lines
3.3 KiB
XML

<UserControl x:Class="DTS.Common.Controls.GridViewColumnHeaderSelectable"
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"
xmlns:strings="clr-namespace:DTS.Common.Strings"
mc:Ignorable="d"
x:Name="dtsGridViewColumnHeader"
d:DesignHeight="20" d:DesignWidth="200">
<UserControl.Resources>
<ResourceDictionary>
<Geometry x:Key="DownArrowIconGeometry">F0 M 0,0L 10,0L 5,7L 0,0 Z</Geometry>
<local:BoolToInvertedBoolConverter x:Key="BoolToInvertedBoolConverter"/>
<Style TargetType="Button" BasedOn="{StaticResource PageContentButtonDark}" />
</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" PreviewMouseLeftButtonDown="PreviewLeftButtonUp">
<TextBlock Text="{Binding Path=HeaderTitle, FallbackValue='I Should Not Be Here'}" HorizontalAlignment="Left" Margin="5,0,5,0" />
</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>
<Button Grid.Column="0" Padding="10 5" Content="{x:Static strings:Strings.SelectAll}" Click="SelectAllButton_OnClick" />
<Button Grid.Column="1" Padding="10 5" Content="{x:Static strings:Strings.ClearAll}" Click="ClearAllButton_OnClick"/>
</Grid>
</Border>
</Popup>
</Grid>
<!--</GridViewColumnHeader>-->
</UserControl>