<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:vm="using:Needlework.Net.ViewModels.Pages.Endpoints"
		xmlns:controls="using:Needlework.Net.Controls"
        mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
		Name="EndpointsControl"
        x:Class="Needlework.Net.Views.Pages.EndpointsView"
		x:DataType="vm:EndpointsViewModel">
	<controls:BusyArea IsBusy="{Binding IsBusy}"
					   BusyText="Loading...">
		<Grid RowDefinitions="auto,auto,*" ColumnDefinitions="*">
		<TextBox Watermark="Search" Margin="0 4" Text="{Binding Search}" Grid.Row="1" Grid.Column="0"/>
		<ScrollViewer Grid.Row="2" Grid.Column="0">
			<ItemsRepeater ItemsSource="{Binding Query}">
				<ItemsRepeater.ItemTemplate>
					<DataTemplate>
						<Button Command="{Binding #EndpointsControl.((vm:EndpointsViewModel)DataContext).OpenEndpointCommand}"
								VerticalAlignment="Stretch"
								HorizontalAlignment="Stretch"
								HorizontalContentAlignment="Left"
								CommandParameter="{Binding}"
								Content="{Binding}"
								Theme="{StaticResource TransparentButton}"/>
					</DataTemplate>
				</ItemsRepeater.ItemTemplate>
			</ItemsRepeater>
		</ScrollViewer>
	</Grid>
	</controls:BusyArea>
</UserControl>