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 38
|
<Window.Resources>
<Style x:Key="txtStyle" TargetType="{x:Type TextBlock}">
<Setter Property="TextAlignment" Value="Center"></Setter>
<Setter Property="FontSize" Value="13"></Setter>
<Setter Property="FontWeight" Value="Bold"></Setter>
<Setter Property="TextWrapping" Value="WrapWithOverflow"></Setter>
<EventSetter Event="ComboBoxItem.PreviewMouseDown" Handler="cb_PreviewMouseDown"></EventSetter>
</Style>
<DataTemplate x:Key="EmpKey">
<Grid Height="66" Width="444" ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"></ColumnDefinition>
<ColumnDefinition Width="70"></ColumnDefinition>
................................................................................................................
<Label Grid.Column="0" VerticalAlignment="Bottom" VerticalContentAlignment="Bottom">Titre</Label>
<Label Grid.Column="1" VerticalAlignment="Bottom" VerticalContentAlignment="Bottom">Date</Label>
................................................................................................................
<TextBlock Grid.Column="0" Text="{Binding Titre}"
Style="{StaticResource txtStyle}"></TextBlock>
<TextBlock Grid.Column="1" Text="{Binding Date}"
Style="{StaticResource txtStyle}"></TextBlock>
................................................................................................................
</Grid>
</DataTemplate>
</Window.Resources>
................................................................................................................
<ComboBox Height="66" HorizontalContentAlignment="Stretch" RenderTransformOrigin="-6.5,1.4" Width="444" Grid.Column="1" Grid.ColumnSpan="5" SelectedValue="{Binding Titre}"
x:Name="L_Cre"
VerticalAlignment="Top" ItemsSource="{Binding}"
ItemTemplate="{StaticResource EmpKey}"
IsSynchronizedWithCurrentItem="True"
HorizontalAlignment="Left" >
</ComboBox> |
Partager