|
<UserControl
x:Class="ReversiEight.BoardSquareView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ReversiEight"
xmlns:conv="using:ReversiEight.Converters"
xmlns:vm="using:ReversiEight.ViewModel"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" FontSize="40">
<UserControl.Resources>
<ControlTemplate x:Key="ButtonTemplate" TargetType="Button">
<Grid Background="Transparent">
<ContentPresenter/>
</Grid>
</ControlTemplate>
<conv:ValueToVisibilityConverter x:Key="ValueToVisibilityConverter"/>
</UserControl.Resources>
<Grid>
<Button Command="{Binding CellTapped}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Template="{StaticResource ButtonTemplate}">
<Grid>
<Image Source="Assets/WhitePiece.png"
Visibility="{Binding State, Converter={StaticResource ValueToVisibilityConverter}, ConverterParameter='WHITE'}"/>
<Image Source="Assets/BlackPiece.png"
Visibility="{Binding State, Converter={StaticResource ValueToVisibilityConverter}, ConverterParameter='BLACK'}"/>
</Grid>
</Button>
</Grid>
</UserControl>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.