var DataItem = ((FrameworkElement)sender).DataContext as MyItemType;
<DataTemplate x:Key ="TexteTemplate"> <Border> <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right"> <Button Content="G" TextElement.FontWeight="Bold" Click="RichTextGras_Click" /> <Button Content="I" TextElement.FontStyle="Italic" Click="RichTextItalic_Click" /> <Button Content="S" Click="RichTextSouligné_Click" /> </StackPanel> <RichTextBox Grid.Row="1" Document="{Binding Path=Text}" x:Name ="RTBox"/> </Grid> </Border> </DataTemplate>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)