1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <Window x:Class="WpfApplication6.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" xmlns:my="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit">
<Window.Resources>
<DataTemplate x:Key="dtColorViewTemplate">
<Border CornerRadius="5,5,5,5" BorderBrush="Black"
BorderThickness="1,1,1,1" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" Margin="1,1,1,1" Background="green"/>
</DataTemplate>
</Window.Resources>
<Grid>
<my:DataGrid AutoGenerateColumns="False" ItemsSource="{Binding}" Margin="39,48,37,58" Name="dataGrid1" SelectionUnit="Cell">
<my:DataGridTemplateColumn CellTemplate="{StaticResource dtColorViewTemplate}"/>
</my:DataGrid>
</Grid>
</Window> |
Partager