<UserControl
    x:Class="v2rayN.Desktop.Views.BackupAndRestoreView"
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
    d:DesignHeight="450"
    d:DesignWidth="800"
    mc:Ignorable="d">
    <UserControl.Styles>
        <Style Selector="Button">
            <Setter Property="MinWidth" Value="180" />
        </Style>
    </UserControl.Styles>

    <DockPanel Margin="{StaticResource Margin8}">
        <StackPanel Margin="{StaticResource Margin4}" DockPanel.Dock="Bottom">
            <TextBlock
                Name="txtMsg"
                HorizontalAlignment="Left"
                Margin="{StaticResource Margin4}" />
        </StackPanel>

        <StackPanel>
            <Border
                Margin="{StaticResource Margin4}"
                VerticalAlignment="Center"
                Theme="{DynamicResource CardBorder}">

                <Grid
                    Margin="{StaticResource Margin4}"
                    ColumnDefinitions="300,200"
                    RowDefinitions="Auto,Auto,Auto,Auto">
                    <TextBlock
                        Grid.Row="0"
                        Grid.Column="0"
                        Margin="{StaticResource Margin4}"
                        Text="{x:Static resx:ResUI.menuLocalBackupAndRestore}" />

                    <TextBlock
                        Grid.Row="1"
                        Grid.Column="0"
                        VerticalAlignment="Center"
                        Margin="{StaticResource Margin4}"
                        Text="{x:Static resx:ResUI.menuLocalBackup}" />
                    <Button
                        Name="menuLocalBackup"
                        Grid.Row="1"
                        Grid.Column="1"
                        VerticalAlignment="Center"
                        Margin="{StaticResource Margin4}"
                        Content="{x:Static resx:ResUI.menuLocalBackup}" />

                    <Separator
                        Grid.Row="2"
                        Grid.Column="0"
                        Grid.ColumnSpan="2"
                        Margin="{StaticResource MarginTb8}" />

                    <TextBlock
                        Grid.Row="3"
                        Grid.Column="0"
                        VerticalAlignment="Center"
                        Margin="{StaticResource Margin4}"
                        Text="{x:Static resx:ResUI.menuLocalRestore}" />
                    <Button
                        Name="menuLocalRestore"
                        Grid.Row="3"
                        Grid.Column="1"
                        VerticalAlignment="Center"
                        Margin="{StaticResource Margin4}"
                        Content="{x:Static resx:ResUI.menuLocalRestore}" />
                </Grid>
            </Border>
            <Border
                Margin="{StaticResource Margin4}"
                VerticalAlignment="Center"
                Theme="{DynamicResource CardBorder}">
                <Grid
                    Margin="{StaticResource Margin4}"
                    ColumnDefinitions="300,200"
                    RowDefinitions="Auto,Auto,Auto,Auto,Auto">
                    <StackPanel
                        Grid.Row="0"
                        Grid.Column="0"
                        Orientation="Horizontal">
                        <TextBlock Margin="{StaticResource Margin4}" Text="{x:Static resx:ResUI.menuRemoteBackupAndRestore}" />

                        <Button
                            Width="{StaticResource IconButtonWidth}"
                            Height="{StaticResource IconButtonHeight}"
                            MinWidth="{StaticResource IconButtonWidth}"
                            Margin="{StaticResource MarginLr8}"
                            Theme="{DynamicResource BorderlessButton}">
                            <Button.Content>
                                <PathIcon Data="{StaticResource building_more}" Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
                            </Button.Content>
                            <Button.Flyout>
                                <Flyout>
                                    <StackPanel>
                                        <Grid ColumnDefinitions="Auto,300" RowDefinitions="Auto,Auto,Auto,Auto,Auto">
                                            <TextBlock
                                                Grid.Row="0"
                                                Grid.Column="0"
                                                VerticalAlignment="Center"
                                                Margin="{StaticResource Margin4}"
                                                Text="{x:Static resx:ResUI.LvWebDavUrl}" />

                                            <TextBox
                                                x:Name="txtWebDavUrl"
                                                Grid.Row="0"
                                                Grid.Column="1"
                                                VerticalAlignment="Center"
                                                Margin="{StaticResource Margin4}"
                                                TextWrapping="Wrap" />

                                            <TextBlock
                                                Grid.Row="1"
                                                Grid.Column="0"
                                                VerticalAlignment="Center"
                                                Margin="{StaticResource Margin4}"
                                                Text="{x:Static resx:ResUI.LvWebDavUserName}" />

                                            <TextBox
                                                x:Name="txtWebDavUserName"
                                                Grid.Row="1"
                                                Grid.Column="1"
                                                VerticalAlignment="Center"
                                                Margin="{StaticResource Margin4}" />

                                            <TextBlock
                                                Grid.Row="2"
                                                Grid.Column="0"
                                                VerticalAlignment="Center"
                                                Margin="{StaticResource Margin4}"
                                                Text="{x:Static resx:ResUI.LvWebDavPassword}" />

                                            <TextBox
                                                x:Name="txtWebDavPassword"
                                                Grid.Row="2"
                                                Grid.Column="1"
                                                VerticalAlignment="Center"
                                                Margin="{StaticResource Margin4}" />

                                            <TextBlock
                                                Grid.Row="3"
                                                Grid.Column="0"
                                                VerticalAlignment="Center"
                                                Margin="{StaticResource Margin4}"
                                                Text="{x:Static resx:ResUI.LvWebDavDirName}" />

                                            <TextBox
                                                x:Name="txtWebDavDirName"
                                                Grid.Row="3"
                                                Grid.Column="1"
                                                VerticalAlignment="Center"
                                                Margin="{StaticResource Margin4}" />

                                            <Button
                                                x:Name="menuWebDavCheck"
                                                Grid.Row="4"
                                                Grid.Column="1"
                                                HorizontalAlignment="Right"
                                                VerticalAlignment="Center"
                                                Margin="{StaticResource Margin4}"
                                                Content="{x:Static resx:ResUI.LvWebDavCheck}" />
                                        </Grid>
                                    </StackPanel>
                                </Flyout>
                            </Button.Flyout>
                        </Button>

                    </StackPanel>

                    <TextBlock
                        Grid.Row="1"
                        Grid.Column="0"
                        VerticalAlignment="Center"
                        Margin="{StaticResource Margin4}"
                        Text="{x:Static resx:ResUI.menuRemoteBackup}" />
                    <Button
                        Name="menuRemoteBackup"
                        Grid.Row="1"
                        Grid.Column="1"
                        VerticalAlignment="Center"
                        Margin="{StaticResource Margin4}"
                        Content="{x:Static resx:ResUI.menuRemoteBackup}" />

                    <Separator
                        Grid.Row="2"
                        Grid.Column="0"
                        Grid.ColumnSpan="2"
                        Margin="{StaticResource MarginTb8}" />
                    <TextBlock
                        Grid.Row="3"
                        Grid.Column="0"
                        VerticalAlignment="Center"
                        Margin="{StaticResource Margin4}"
                        Text="{x:Static resx:ResUI.menuRemoteRestore}" />
                    <Button
                        Name="menuRemoteRestore"
                        Grid.Row="3"
                        Grid.Column="1"
                        VerticalAlignment="Center"
                        Margin="{StaticResource Margin4}"
                        Content="{x:Static resx:ResUI.menuRemoteRestore}" />
                </Grid>
            </Border>
        </StackPanel>
    </DockPanel>
</UserControl>
