Untitled

mail@pastecode.io avatar
unknown
csharp
a year ago
1.4 kB
2
Indexable
Never
<DockPanel Grid.Row="1" Grid.Column="1" Height="Auto" Width="Auto" Margin="70,70,70,70">
            <ItemsControl ItemsSource="{Binding Fields}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <UniformGrid Rows="{Binding GridWidth}" Columns="{Binding GridHeight}" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Button Command="{Binding SelectCommand}" CommandParameter="{Binding Number}" Focusable="False" RenderTransformOrigin="0.5, 0.5" FontSize="12" FontWeight="Bold">
                            <Button.RenderTransform>
                                <ScaleTransform ScaleX="1" ScaleY="1" />
                            </Button.RenderTransform>
                            <Image Source="{Binding Image}" Stretch="UniformToFill"></Image>
                        </Button>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
                <ItemsControl.ItemContainerStyle>
                    <Style>
                        <Setter Property="Grid.Row" Value="{Binding X}" />
                        <Setter Property="Grid.Column" Value="{Binding Y}" />
                    </Style>
                </ItemsControl.ItemContainerStyle>
            </ItemsControl>
        </DockPanel>