|
|
|
@ -8,9 +8,9 @@
|
|
|
|
|
|
|
|
|
|
<ContentPage.Resources>
|
|
|
|
|
<x:Double x:Key="CellWidth">75</x:Double>
|
|
|
|
|
<x:Double x:Key="CellHeight">75</x:Double>
|
|
|
|
|
<x:Double x:Key="VerticalSpacing">1</x:Double>
|
|
|
|
|
<x:Double x:Key="HorizontalSpacing">1</x:Double>
|
|
|
|
|
<x:Double x:Key="CellHeight">75</x:Double>
|
|
|
|
|
<x:Double x:Key="VerticalSpacing">1</x:Double>
|
|
|
|
|
<x:Double x:Key="HorizontalSpacing">1</x:Double>
|
|
|
|
|
<toolkit:MultiMathExpressionConverter x:Key="multiMathExpressionConverter" />
|
|
|
|
|
</ContentPage.Resources>
|
|
|
|
|
<Grid BackgroundColor="#efca85">
|
|
|
|
@ -28,23 +28,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Border WidthRequest="80" HeightRequest="80"
|
|
|
|
|
BackgroundColor="Transparent"
|
|
|
|
|
Margin="0" >
|
|
|
|
|
<Border.GestureRecognizers >
|
|
|
|
|
BackgroundColor="Transparent"
|
|
|
|
|
Margin="0">
|
|
|
|
|
<Border.GestureRecognizers>
|
|
|
|
|
<DropGestureRecognizer DragOver="OnDragOverBag"
|
|
|
|
|
DropCommand="{Binding OnDropB, Source={x:Reference root}}"
|
|
|
|
|
/>
|
|
|
|
|
DropCommand="{Binding OnDropB, Source={x:Reference root}}" />
|
|
|
|
|
</Border.GestureRecognizers>
|
|
|
|
|
<Image Source="bag.png" ToolTipProperties.Text="Pour m'utiliser il faut cliquer sur le boutton swap avant ^^"></Image>
|
|
|
|
|
<Image Source="bag.png"
|
|
|
|
|
ToolTipProperties.Text="Pour m'utiliser il faut cliquer sur le boutton swap avant ^^">
|
|
|
|
|
</Image>
|
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
<Button
|
|
|
|
|
HorizontalOptions="Start"
|
|
|
|
|
Grid.Row="0" Grid.Column="1"
|
|
|
|
|
Text="Swap"
|
|
|
|
|
Clicked="OnButtonSwapClicked"
|
|
|
|
|
ToolTipProperties.Text="Click to swap your tiles !"
|
|
|
|
|
Style="{StaticResource GameButton}"/>
|
|
|
|
|
Style="{StaticResource GameButton}" />
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
HorizontalOptions="End"
|
|
|
|
@ -52,14 +53,14 @@
|
|
|
|
|
Text="Skip / End Turn" WidthRequest="200"
|
|
|
|
|
Clicked="OnButtonSkipClicked"
|
|
|
|
|
ToolTipProperties.Text="Click for skip / end your turn ;)"
|
|
|
|
|
Style="{StaticResource GameButton}"/>
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
HorizontalOptions="Start"
|
|
|
|
|
Style="{StaticResource GameButton}" />
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
HorizontalOptions="Start"
|
|
|
|
|
Grid.Row="2" Grid.Column="1"
|
|
|
|
|
Text="Settings"
|
|
|
|
|
ToolTipProperties.Text="Click to check your settings -_-"
|
|
|
|
|
Style="{StaticResource GameButton}"/>
|
|
|
|
|
Style="{StaticResource GameButton}" />
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
HorizontalOptions="End"
|
|
|
|
@ -67,23 +68,22 @@
|
|
|
|
|
Text="Exit" WidthRequest="200"
|
|
|
|
|
Clicked="OnButtonExitClicked"
|
|
|
|
|
ToolTipProperties.Text="Click here to exit ;)"
|
|
|
|
|
Style="{StaticResource GameButton}"/>
|
|
|
|
|
Style="{StaticResource GameButton}" />
|
|
|
|
|
|
|
|
|
|
<CollectionView Grid.Row="0" Grid.Column="1" ItemsSource="{Binding PlayerList[0].Tiles}"
|
|
|
|
|
HorizontalOptions="Center"
|
|
|
|
|
VerticalOptions="Center" >
|
|
|
|
|
VerticalOptions="Center">
|
|
|
|
|
<CollectionView.ItemsLayout>
|
|
|
|
|
<GridItemsLayout Orientation="Horizontal"/>
|
|
|
|
|
<GridItemsLayout Orientation="Horizontal" />
|
|
|
|
|
</CollectionView.ItemsLayout>
|
|
|
|
|
<CollectionView.ItemTemplate>
|
|
|
|
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<Border WidthRequest="70" HeightRequest="70"
|
|
|
|
|
BackgroundColor="{Binding ColorBC1, Source={x:Reference root}}"
|
|
|
|
|
Margin="0"
|
|
|
|
|
>
|
|
|
|
|
BackgroundColor="{Binding ColorBC1, Source={x:Reference root}}"
|
|
|
|
|
Margin="0">
|
|
|
|
|
<Border.GestureRecognizers>
|
|
|
|
|
<DragGestureRecognizer CanDrag="True" DragStarting="OnDragStarting"/>
|
|
|
|
|
<DragGestureRecognizer CanDrag="True" DragStarting="OnDragStarting" />
|
|
|
|
|
</Border.GestureRecognizers>
|
|
|
|
|
<controls:TileView Shape="{Binding GetShape}" Color="{Binding GetColor}"></controls:TileView>
|
|
|
|
|
</Border>
|
|
|
|
@ -93,17 +93,17 @@
|
|
|
|
|
|
|
|
|
|
<CollectionView Grid.Row="1" Grid.Column="0" ItemsSource="{Binding PlayerList[2].Tiles}"
|
|
|
|
|
HorizontalOptions="Center"
|
|
|
|
|
VerticalOptions="Center" >
|
|
|
|
|
VerticalOptions="Center">
|
|
|
|
|
<CollectionView.ItemsLayout>
|
|
|
|
|
<GridItemsLayout Orientation="Vertical"/>
|
|
|
|
|
<GridItemsLayout Orientation="Vertical" />
|
|
|
|
|
</CollectionView.ItemsLayout>
|
|
|
|
|
<CollectionView.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<Border WidthRequest="70" HeightRequest="70"
|
|
|
|
|
BackgroundColor="{Binding ColorBC3, Source={x:Reference root}}"
|
|
|
|
|
Margin="0">
|
|
|
|
|
BackgroundColor="{Binding ColorBC3, Source={x:Reference root}}"
|
|
|
|
|
Margin="0">
|
|
|
|
|
<Border.GestureRecognizers>
|
|
|
|
|
<DragGestureRecognizer CanDrag="True" DragStarting="OnDragStarting"/>
|
|
|
|
|
<DragGestureRecognizer CanDrag="True" DragStarting="OnDragStarting" />
|
|
|
|
|
</Border.GestureRecognizers>
|
|
|
|
|
<controls:TileView Shape="{Binding GetShape}" Color="{Binding GetColor}"></controls:TileView>
|
|
|
|
|
</Border>
|
|
|
|
@ -113,17 +113,17 @@
|
|
|
|
|
|
|
|
|
|
<CollectionView Grid.Row="1" Grid.Column="2" ItemsSource="{Binding PlayerList[3].Tiles}"
|
|
|
|
|
HorizontalOptions="Center"
|
|
|
|
|
VerticalOptions="Center" >
|
|
|
|
|
VerticalOptions="Center">
|
|
|
|
|
<CollectionView.ItemsLayout>
|
|
|
|
|
<GridItemsLayout Orientation="Vertical"/>
|
|
|
|
|
<GridItemsLayout Orientation="Vertical" />
|
|
|
|
|
</CollectionView.ItemsLayout>
|
|
|
|
|
<CollectionView.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<Border WidthRequest="70" HeightRequest="70"
|
|
|
|
|
BackgroundColor="{Binding ColorBC4, Source={x:Reference root}}"
|
|
|
|
|
Margin="0">
|
|
|
|
|
BackgroundColor="{Binding ColorBC4, Source={x:Reference root}}"
|
|
|
|
|
Margin="0">
|
|
|
|
|
<Border.GestureRecognizers>
|
|
|
|
|
<DragGestureRecognizer CanDrag="True" DragStarting="OnDragStarting"/>
|
|
|
|
|
<DragGestureRecognizer CanDrag="True" DragStarting="OnDragStarting" />
|
|
|
|
|
</Border.GestureRecognizers>
|
|
|
|
|
<controls:TileView Shape="{Binding GetShape}" Color="{Binding GetColor}"></controls:TileView>
|
|
|
|
|
</Border>
|
|
|
|
@ -133,17 +133,17 @@
|
|
|
|
|
|
|
|
|
|
<CollectionView Grid.Row="2" Grid.Column="1" ItemsSource="{Binding PlayerList[1].Tiles}"
|
|
|
|
|
HorizontalOptions="Center"
|
|
|
|
|
VerticalOptions="Start" >
|
|
|
|
|
VerticalOptions="Start">
|
|
|
|
|
<CollectionView.ItemsLayout>
|
|
|
|
|
<GridItemsLayout Orientation="Horizontal"/>
|
|
|
|
|
<GridItemsLayout Orientation="Horizontal" />
|
|
|
|
|
</CollectionView.ItemsLayout>
|
|
|
|
|
<CollectionView.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<Border WidthRequest="70" HeightRequest="70"
|
|
|
|
|
BackgroundColor="{Binding ColorBC2, Source={x:Reference root}}"
|
|
|
|
|
BackgroundColor="{Binding ColorBC2, Source={x:Reference root}}"
|
|
|
|
|
Margin="0">
|
|
|
|
|
<Border.GestureRecognizers>
|
|
|
|
|
<DragGestureRecognizer CanDrag="True" DragStarting="OnDragStarting"/>
|
|
|
|
|
<DragGestureRecognizer CanDrag="True" DragStarting="OnDragStarting" />
|
|
|
|
|
</Border.GestureRecognizers>
|
|
|
|
|
<controls:TileView Shape="{Binding GetShape}" Color="{Binding GetColor}"></controls:TileView>
|
|
|
|
|
</Border>
|
|
|
|
@ -154,56 +154,59 @@
|
|
|
|
|
<ScrollView Grid.Row="1" Grid.Column="1" VerticalOptions="FillAndExpand">
|
|
|
|
|
<CollectionView ItemsSource="{Binding Board.ReadCells}"
|
|
|
|
|
HorizontalOptions="Center"
|
|
|
|
|
VerticalOptions="Center" HorizontalScrollBarVisibility="Never" VerticalScrollBarVisibility="Never"
|
|
|
|
|
>
|
|
|
|
|
VerticalOptions="Center" HorizontalScrollBarVisibility="Never"
|
|
|
|
|
VerticalScrollBarVisibility="Never">
|
|
|
|
|
|
|
|
|
|
<CollectionView.HeightRequest>
|
|
|
|
|
|
|
|
|
|
<MultiBinding Converter="{StaticResource multiMathExpressionConverter}" ConverterParameter="x0 * x1 +(x0 - 1) * x2 ">
|
|
|
|
|
<MultiBinding Converter="{StaticResource multiMathExpressionConverter}"
|
|
|
|
|
ConverterParameter="x0 * x1 +(x0 - 1) * x2 ">
|
|
|
|
|
<Binding Path="Board.Rows" />
|
|
|
|
|
<Binding Source="{StaticResource CellHeight}" />
|
|
|
|
|
<Binding Source="{StaticResource VerticalSpacing}" />
|
|
|
|
|
</MultiBinding>
|
|
|
|
|
|
|
|
|
|
</CollectionView.HeightRequest>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<CollectionView.WidthRequest>
|
|
|
|
|
|
|
|
|
|
<MultiBinding Converter="{StaticResource multiMathExpressionConverter}" ConverterParameter="x0 * x1 +(x0 - 1) * x2 ">
|
|
|
|
|
|
|
|
|
|
<MultiBinding Converter="{StaticResource multiMathExpressionConverter}"
|
|
|
|
|
ConverterParameter="x0 * x1 +(x0 - 1) * x2 ">
|
|
|
|
|
<Binding Path="Board.Columns" />
|
|
|
|
|
<Binding Source="{StaticResource CellWidth}" />
|
|
|
|
|
<Binding Source="{StaticResource HorizontalSpacing}" />
|
|
|
|
|
</MultiBinding>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</CollectionView.WidthRequest>
|
|
|
|
|
|
|
|
|
|
<CollectionView.ItemsLayout>
|
|
|
|
|
<GridItemsLayout Orientation="Vertical"
|
|
|
|
|
Span="{Binding Board.Columns}"
|
|
|
|
|
HorizontalItemSpacing="{StaticResource HorizontalSpacing}"
|
|
|
|
|
VerticalItemSpacing="{StaticResource VerticalSpacing}"/>
|
|
|
|
|
Span="{Binding Board.Columns}"
|
|
|
|
|
HorizontalItemSpacing="{StaticResource HorizontalSpacing}"
|
|
|
|
|
VerticalItemSpacing="{StaticResource VerticalSpacing}" />
|
|
|
|
|
</CollectionView.ItemsLayout>
|
|
|
|
|
<CollectionView.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<Border WidthRequest="{StaticResource CellWidth}"
|
|
|
|
|
HeightRequest="{StaticResource CellHeight}"
|
|
|
|
|
HeightRequest="{StaticResource CellHeight}"
|
|
|
|
|
BackgroundColor="WhiteSmoke">
|
|
|
|
|
<Border.GestureRecognizers >
|
|
|
|
|
<Border.GestureRecognizers>
|
|
|
|
|
<DropGestureRecognizer DragOver="OnDragOver"
|
|
|
|
|
DropCommand="{Binding OnDrop, Source={x:Reference root}}"
|
|
|
|
|
DropCommandParameter="{Binding .}"/>
|
|
|
|
|
DropCommandParameter="{Binding .}" />
|
|
|
|
|
</Border.GestureRecognizers>
|
|
|
|
|
<controls:TileView HorizontalOptions="Center" Shape="{Binding Tile.GetShape}" Color="{Binding Tile.GetColor}"></controls:TileView>
|
|
|
|
|
<controls:TileView HorizontalOptions="Center" Shape="{Binding Tile.GetShape}"
|
|
|
|
|
Color="{Binding Tile.GetColor}">
|
|
|
|
|
</controls:TileView>
|
|
|
|
|
</Border>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</CollectionView.ItemTemplate>
|
|
|
|
|
</CollectionView>
|
|
|
|
|
</ScrollView>
|
|
|
|
|
|
|
|
|
|
<controls:Scoreboard InputTransparent="True" HorizontalOptions="End" Grid.Row="1" Grid.Column="1" ></controls:Scoreboard>
|
|
|
|
|
|
|
|
|
|
<controls:Scoreboard InputTransparent="True" HorizontalOptions="End" Grid.Row="1" Grid.Column="1"></controls:Scoreboard>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
</ContentPage>
|
|
|
|
|
</ContentPage>
|