<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Packet_Sender_Mobile.TrafficPage">
    <ContentPage.Padding>
        <OnPlatform x:TypeArguments="Thickness">
            <OnPlatform.Platforms>
                <On Platform="iOS" Value="0, 30, 0, 0" />
                <On Platform="Android" Value="0, 0, 0, 0" />
            </OnPlatform.Platforms>
        </OnPlatform>
    </ContentPage.Padding>

    
    <ContentPage.Content>

        <StackLayout>
            <StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" >
                <Button HorizontalOptions="FillAndExpand"  x:Name="clearButton" Clicked="clearButton_Clicked" Text="Clear" />
                <Button HorizontalOptions="FillAndExpand"  x:Name="saveButton" Clicked="saveButton_ClickedAsync" Text="Save" />
            </StackLayout>
            <ListView x:Name="trafficListView" HasUnevenRows="true" ItemSelected="trafficListView_ItemSelected">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <StackLayout Padding="5" Orientation="Horizontal">

                                <Image WidthRequest="30" HeightRequest="30" Aspect="AspectFill" Source="{Binding packetimagetraffic}" />
                                <StackLayout Padding="5"  Orientation="Vertical">

                                    <Label Text="{Binding ascii}" FontSize="Medium" VerticalOptions="Center" />
                                    <Label Text="{Binding trafficpath}" FontSize="Medium" VerticalOptions="Center" />
                                    <Label Text="{Binding Path=error}">
                                    </Label>

                                </StackLayout>
                            </StackLayout>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>