<UserControl 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:pages="clr-namespace:Nebula.Launcher.ViewModels.Pages"
             xmlns:customControls="clr-namespace:Nebula.Launcher.Controls"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="Nebula.Launcher.Views.Pages.ConfigurationView"
             x:DataType="pages:ConfigurationViewModel">
    <Design.DataContext>
        <pages:ConfigurationViewModel />
    </Design.DataContext>
    
    <ScrollViewer>
        <StackPanel Spacing="10" Margin="10">
            <ItemsControl
                ItemsSource="{Binding ConfigurationVerbose}"
                Padding="0" >
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Spacing="10" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>
            
            <WrapPanel Orientation="Horizontal">
                <Button 
                    Classes="ConfigBorder"
                    VerticalAlignment="Bottom" 
                    HorizontalAlignment="Stretch" 
                    Padding="5"
                    Margin="5"
                    Command="{Binding InvokeUpdateConfiguration}">
                    <customControls:LocalizedLabel LocalId="config-save"/>
                </Button>
                <Button 
                    Classes="ConfigBorder"
                    VerticalAlignment="Bottom" 
                    HorizontalAlignment="Stretch" 
                    Padding="5"
                    Margin="5"
                    Command="{Binding ResetConfig}">
                    <customControls:LocalizedLabel LocalId="config-reset"/>
                </Button>
                <Button 
                    Classes="ConfigBorder"
                    VerticalAlignment="Bottom" 
                    HorizontalAlignment="Stretch" 
                    Padding="5"
                    Margin="5"
                    Command="{Binding OpenDataFolder}">
                    <customControls:LocalizedLabel LocalId="config-open-data"/>
                </Button>
                
                <Button 
                    Classes="ConfigBorder"
                    VerticalAlignment="Bottom" 
                    HorizontalAlignment="Stretch" 
                    Padding="5"
                    Margin="5"
                    Command="{Binding ExportLogs}">
                    <customControls:LocalizedLabel LocalId="config-export-logs"/>
                </Button>
                
                <Button 
                    Classes="ConfigBorder"
                    VerticalAlignment="Bottom" 
                    HorizontalAlignment="Stretch" 
                    Padding="5"
                    Margin="5"
                    Command="{Binding RemoveAllContent}">
                    <customControls:LocalizedLabel LocalId="config-remove-content-all"/>
                </Button>
            </WrapPanel>
        </StackPanel>
    </ScrollViewer>
</UserControl>
