<UserControl x:Class="Ion.Sdk.DemoApp.Views.InstrumentBrowser"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:Ion.Sdk.DemoApp.Views"
             xmlns:idi="clr-namespace:Ion.Sdk.Idi;assembly=Ion.Sdk.Idi"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300"
             x:Name="View"
             Style="{StaticResource UserControl.Dialog}">
    <UserControl.Resources>
        
        <DataTemplate DataType="{x:Type idi:WorkspaceInfo}">
            <Button Style="{StaticResource Button.ListItem}"
                    Cursor="Hand"
                    ToolTip="Click to select workspace"
                    Content="{Binding}"
                    Command="{Binding ElementName=View, Path=SelectCommand}"
                    CommandParameter="{Binding}">
                <Button.ContentTemplate>
                    <DataTemplate>
                        <TextBlock Style="{StaticResource TextBlock.Content}"
                                   Foreground="{StaticResource Brush.Accent.Strong}"
                                   Text="{Binding Path=Name}"
                                   Margin="{StaticResource Margin.Text}" />
                    </DataTemplate>
                </Button.ContentTemplate>
            </Button>
        </DataTemplate>
    </UserControl.Resources>
    <Grid x:Name="Root">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid x:Name="HeaderGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Border Grid.ColumnSpan="3"
                    Background="{StaticResource Brush.Background}" />
            <Viewbox Stretch="Uniform"
                     Height="12"
                     Margin="15 0 0 0"
                     SnapsToDevicePixels="True">
                <Path Stretch="Uniform"
                      Data="{StaticResource Geometry.Download}"
                      Fill="{StaticResource Brush.Accent.Strong}" />
            </Viewbox>
            <TextBlock Grid.Column="1" Text="Select workspace"
                       Style="{StaticResource TextBlock.Content}"
                       Margin="{StaticResource Margin.Content}"
                       Foreground="{StaticResource Brush.Accent.Strong}" />
            <Button Grid.Column="2"
                    Style="{StaticResource Button.Circle}"
                    Command="{Binding ElementName=View, Path=CloseCommand}"
                    ContentTemplate="{StaticResource Button.Template.Close}"
                    VerticalAlignment="Top"
                    HorizontalAlignment="Right"
                    Margin="{StaticResource Margin.Button}" />
        </Grid>
        
        
        
        <Grid Grid.Row="1">
            <ScrollViewer Margin="1 0">
                <ItemsControl ItemsSource="{Binding Path=Workspaces}" />
            </ScrollViewer>
        </Grid>
    </Grid>
</UserControl>
