Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created October 24, 2019 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntegerMan/e0eaf832ef5e032a80adb227db321784 to your computer and use it in GitHub Desktop.
Save IntegerMan/e0eaf832ef5e032a80adb227db321784 to your computer and use it in GitHub Desktop.
<Grid Margin="10" Background="Green">
<Image Source="Grass.png" Stretch="Fill" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></Image>
<Viewbox Stretch="Uniform">
<Border BorderThickness="1" BorderBrush="DarkGreen">
<ItemsControl ItemsSource="{Binding Actors}" Width="130" Height="130">
<ItemsControl.ItemTemplate>
<ItemContainerTemplate>
<Border BorderBrush="Black" BorderThickness="1">
<Image Source="{Binding ImagePath}" Width="10" Height="10" Stretch="Fill"></Image>
</Border>
</ItemContainerTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas></Canvas>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="Canvas.Left" Value="{Binding PosX}" />
<Setter Property="Canvas.Top" Value="{Binding PosY}" />
</Style>
</ItemsControl.ItemContainerStyle>
</ItemsControl>
</Border>
</Viewbox>
</Grid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment