<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:settings="clr-namespace:Artemis.UI.Screens.Settings"
             xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
             xmlns:plugins="clr-namespace:Artemis.UI.Screens.Plugins"
             mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="450"
             x:Class="Artemis.UI.Screens.Settings.PluginsTabView"
             x:DataType="settings:PluginsTabViewModel">
    <Grid RowDefinitions="Auto,*">
        <Grid Grid.Row="0" Grid.Column="0" MaxWidth="1000" Margin="0 22 0 10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition MinWidth="165" MaxWidth="400" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <TextBox Classes="clearButton" Text="{CompiledBinding SearchPluginInput}" Watermark="Search plugins" Margin="0 0 10 0" />

            <StackPanel Spacing="5" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
                <HyperlinkButton VerticalAlignment="Top" Command="{CompiledBinding GetMorePlugins}">
                    Get more plugins
                </HyperlinkButton>
                <Button Classes="accent" Command="{CompiledBinding ImportPlugin}">Import plugin</Button>
            </StackPanel>
        </Grid>

        <ScrollViewer Grid.Row="1" Grid.Column="0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" VerticalAlignment="Top">
            <ItemsControl ItemsSource="{CompiledBinding Plugins}" MaxWidth="1000" VerticalAlignment="Center">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate x:DataType="plugins:PluginSettingsViewModel">
                        <ContentControl Content="{CompiledBinding}" MinHeight="200" />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

        </ScrollViewer>
    </Grid>
</UserControl>