<?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:extensions="clr-namespace:PlantBox.Client.Extensions"
             xmlns:forms="clr-namespace:Microcharts.Forms;assembly=Microcharts.Forms"
             x:Class="PlantBox.Client.Forms.Plant.HistoricPage">
    <ContentPage.Content>
        <StackLayout Padding="5">
            <StackLayout Orientation="Horizontal">
                <Label HorizontalOptions="Start"
                       VerticalOptions="CenterAndExpand"
                       Text="{extensions:Locale Interval}" />
                <Picker x:Name="Picker"
                        HorizontalOptions="EndAndExpand"
                        VerticalOptions="CenterAndExpand"
                        WidthRequest="200"
                        SelectedItem="{Binding HistoricDuration, Mode=OneWayToSource}"
                        SelectedIndexChanged="Picker_SelectedIndexChanged" />
            </StackLayout>
            <ScrollView>
                <StackLayout x:Name="layout">
                    <BindableLayout.ItemTemplate>
                        <DataTemplate>
                            <Frame HorizontalOptions="FillAndExpand"
                            HeightRequest="200"
                            Padding="5">
                                <StackLayout>
                                    <Label Text="{Binding Name}" />
                                    <forms:ChartView Chart="{Binding Chart}"
                                                    HorizontalOptions="FillAndExpand"
                                                    VerticalOptions="FillAndExpand" />
                                </StackLayout>
                            </Frame>
                        </DataTemplate>
                    </BindableLayout.ItemTemplate>
                </StackLayout>
            </ScrollView>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>