1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
<Style x:Key="ColumnHeaderStyle" TargetType="{x:Type WpfToolkit:DataGridColumnHeader}">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="{StaticResource HeaderBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource HeaderBorderBrush}" />
<Setter Property="BorderThickness" Value="0,1,0,1" />
<!--<Setter Property="Margin" Value="3,3,3,0"/>-->
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Vertical" Width="Auto">
<TextBlock Text="{Binding}" x:Name="MyText" Margin="2,5,2,5" Height="Auto"
HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox AcceptsReturn="False" Width="100" Visibility="??????????????">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.Filtrer}" >
<KeyBinding.CommandParameter>
<MultiBinding Converter="{StaticResource YConverter}">
<Binding Path="Text" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type TextBox}}"/>
<Binding ElementName="MyText" Path="Text" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" />
</MultiBinding>
</KeyBinding.CommandParameter>
</KeyBinding>
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<DataTemplate.Triggers>
</DataTemplate.Triggers>
</DataTemplate>
</Setter.Value>
</Setter> |
Partager