<ItemsControl ItemsSource="{Binding CaskList}" HorizontalAlignment="Left" VerticalAlignment="Top"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas Width="1680" Height="800" MouseDown="Canvas_MouseDown"> </Canvas> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemContainerStyle> <Style TargetType="ContentPresenter"> <Setter Property="Canvas.Left" Value="{Binding Left}"/> <Setter Property="Canvas.Top" Value="{Binding Top}"/> </Style> </ItemsControl.ItemContainerStyle> <ItemsControl.ItemTemplate> <DataTemplate> <Grid> <Rectangle Stroke="Black" Width="64" Height="64" Fill="{Binding Color}" ></Rectangle> <Label Content="{Binding ID}" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>--> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)