<?xml version="1.0" encoding="UTF-8"?>
<u:AdaptedPage xmlns="http://xamarin.com/schemas/2014/forms"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               xmlns:u="clr-namespace:Pixiview.UI"
               xmlns:r="clr-namespace:Pixiview.Resources"
               x:Class="Pixiview.OptionPage"
               Title="{r:Text Option}">
    <ContentPage.ToolbarItems>
        <ToolbarItem Order="Primary" Clicked="ShareCookie_Clicked"
                     IconImageSource="{DynamicResource FontIconShare}"/>
    </ContentPage.ToolbarItems>
    <TableView Intent="Settings" VerticalOptions="Start"
               BackgroundColor="{DynamicResource OptionBackColor}">
        <TableRoot>
            <TableSection Title="{r:Text Illusts}">
                <u:OptionSwitchCell Title="{r:Text R18}"
                                    IsToggled="{Binding IsOnR18, Mode=TwoWay}"/>
                <u:OptionDropCell x:Name="optionFavSync" Title="{r:Text SyncType}"
                                  SelectedIndex="{Binding SyncFavType, Mode=TwoWay}"/>
            </TableSection>
            <TableSection Title="{r:Text Proxy}">
                <u:OptionSwitchCell Title="{r:Text Enabled}"
                                    IsToggled="{Binding IsProxied, Mode=TwoWay}"/>
            </TableSection>
            <TableSection Title="{r:Text Detail}">
                <u:OptionEntryCell Title="{r:Text Host}"
                                   Text="{Binding Host, Mode=TwoWay}"
                                   Keyboard="Url" Placeholder="www.example.com"/>
                <u:OptionEntryCell Title="{r:Text Port}"
                                   Text="{Binding Port, Mode=TwoWay}"
                                   Keyboard="Numeric" Placeholder="8080"/>
            </TableSection>
            <TableSection Title="{r:Text Privacy}">
                <u:OptionEntryCell Title="{r:Text Cookie}"
                                   Text="{Binding Cookie, Mode=TwoWay}"
                                   Keyboard="Text"/>
            </TableSection>
        </TableRoot>
    </TableView>
</u:AdaptedPage>
