Advertisement
Hellboyandso

ReversiBoard

May 23rd, 2015
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. <UserControl x:Class="ReversiGUI.ReversiBoard"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:ReversiGUI"
  7. mc:Ignorable="d"
  8. d:DesignHeight="150" d:DesignWidth="150">
  9.  
  10. <UserControl.Resources>
  11. <local:PlayerToColorTilesConvertor x:Key="PlayerToColorTilesConvertor" />
  12. </UserControl.Resources>
  13. <Viewbox Stretch="Uniform">
  14. <ItemsControl Name="Items" VerticalAlignment="Center" HorizontalAlignment="Center" ItemsSource="{Binding GridViewModel}" Background="Transparent">
  15. <ItemsControl.ItemsPanel>
  16. <ItemsPanelTemplate>
  17. <StackPanel Orientation="Vertical"/>
  18. </ItemsPanelTemplate>
  19. </ItemsControl.ItemsPanel>
  20. <ItemsControl.ItemTemplate>
  21. <DataTemplate>
  22. <ItemsControl ItemsSource="{Binding .}">
  23. <ItemsControl.ItemsPanel>
  24. <ItemsPanelTemplate>
  25. <StackPanel Orientation="Horizontal" />
  26. </ItemsPanelTemplate>
  27. </ItemsControl.ItemsPanel>
  28. <ItemsControl.ItemTemplate>
  29. <DataTemplate>
  30. <Button Name="buttonTile" Command="{Binding PlaceStoneCommand}" Background="Transparent" BorderBrush="Black" BorderThickness="0.75" Width="30" Height="30">
  31. <Ellipse Width="20" Height="20" Stretch="UniformToFill">
  32. <Ellipse.Fill>
  33. <SolidColorBrush Color="{Binding ColorCell, Converter={StaticResource PlayerToColorTilesConvertor}}"/>
  34. </Ellipse.Fill>
  35. </Ellipse>
  36. </Button>
  37. </DataTemplate>
  38. </ItemsControl.ItemTemplate>
  39. </ItemsControl>
  40. </DataTemplate>
  41. </ItemsControl.ItemTemplate>
  42. </ItemsControl>
  43. </Viewbox>
  44. </UserControl>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement