<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:xuni="clr-namespace:Xuni.Forms.FlexPie;assembly=Xuni.Forms.FlexPie"
             xmlns:common="clr-namespace:FlexPieDemo.Data.Views.Common;assembly=FlexPie101.Data"
             x:Class="FlexPieDemo.Data.Views.Samples.BasicFeaturesSample" x:Name="page"
            Padding="20">
  <StackLayout>
    <Label BindingContext="{x:Reference page}" Text="{Binding Title}" IsVisible="{StaticResource TitleVisible}" HorizontalOptions="Center" Font="Large"/>
    <Grid x:Name="root" VerticalOptions="FillAndExpand">
      <Grid.RowDefinitions>
        <RowDefinition Height="50*" />
        <RowDefinition Height="50*"/>
      </Grid.RowDefinitions>

      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="50*"/>
        <ColumnDefinition Width="50*"/>
      </Grid.ColumnDefinitions>

      <Grid x:Name="gridOption"  BindingContext="{x:Reference flexPie}" VerticalOptions="Start" HorizontalOptions="Start" >
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto" />
          <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <StackLayout  Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal">
          <Label BindingContext="{x:Reference stepperRadius}" Text="{Binding Value,StringFormat='Inner Radius {0}'}"  VerticalOptions="Center" />
          <common:PreciseStepper x:Name="stepperRadius"  VerticalOptions="Center" Value="{Binding InnerRadius,Mode=TwoWay}" Maximum="1.00" Minimum="0" Increment="0.1"/>
        </StackLayout>
        <Label Grid.Row="1" Text="Offset"  VerticalOptions="Center" />
        <Slider Grid.Row="1" Grid.Column="1" Value="{Binding Offset,Mode=TwoWay}" VerticalOptions="Center" />
        <Label Grid.Row="2" Text="Start Angle"  VerticalOptions="Center" />
        <Slider Grid.Row="2" Grid.Column="1" Value="{Binding StartAngle,Mode=TwoWay}" Maximum="360" VerticalOptions="Center"/>
        <Label Grid.Row="3" Text="Reversed" VerticalOptions="Center" />
        <Switch x:Name="toggleReversed" VerticalOptions="Center"
                IsToggled="{Binding Reversed,Mode=TwoWay}" Grid.Row="3" Grid.Column="1" HorizontalOptions="Start" />
      </Grid>

      <xuni:FlexPie InnerRadius ="0.3" BindingName = "Name" Binding = "Value" x:Name="flexPie" />
    </Grid>
  </StackLayout>
</ContentPage>