Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <UserControl x:Class="ReversiGUI.ReversiBoard"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:ReversiGUI"
- mc:Ignorable="d"
- d:DesignHeight="150" d:DesignWidth="150">
- <UserControl.Resources>
- <local:PlayerToColorTilesConvertor x:Key="PlayerToColorTilesConvertor" />
- </UserControl.Resources>
- <Viewbox Stretch="Uniform">
- <ItemsControl Name="Items" VerticalAlignment="Center" HorizontalAlignment="Center" ItemsSource="{Binding GridViewModel}" Background="Transparent">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel Orientation="Vertical"/>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <ItemsControl ItemsSource="{Binding .}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel Orientation="Horizontal" />
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Button Name="buttonTile" Command="{Binding PlaceStoneCommand}" Background="Transparent" BorderBrush="Black" BorderThickness="0.75" Width="30" Height="30">
- <Ellipse Width="20" Height="20" Stretch="UniformToFill">
- <Ellipse.Fill>
- <SolidColorBrush Color="{Binding ColorCell, Converter={StaticResource PlayerToColorTilesConvertor}}"/>
- </Ellipse.Fill>
- </Ellipse>
- </Button>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Viewbox>
- </UserControl>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement