<UserControl
    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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
    xmlns:tabs="clr-namespace:Artemis.UI.Screens.Settings.Device.Tabs"
    xmlns:converters="clr-namespace:Artemis.UI.Converters"
    x:Class="Artemis.UI.Screens.Settings.Device.Tabs.DeviceLedsTabView"
    mc:Ignorable="d"
    d:DesignHeight="450" d:DesignWidth="800"
    d:DataContext="{d:DesignInstance {x:Type tabs:DeviceLedsTabViewModel}}">
    <UserControl.Resources>
        <converters:UriToFileNameConverter x:Key="UriToFileNameConverter" />
        <converters:LedIdToStringConverter x:Key="LedIdToStringConverter" />
    </UserControl.Resources>
    <Grid>
        <DataGrid ItemsSource="{Binding LedViewModels}"
                  d:DataContext="{d:DesignInstance Type={x:Type tabs:DeviceLedsTabLedViewModel}}"
                  CanUserSortColumns="True"
                  IsReadOnly="True"
                  CanUserAddRows="False"
                  AutoGenerateColumns="False"
                  materialDesign:DataGridAssist.CellPadding="16 5 5 5"
                  materialDesign:DataGridAssist.ColumnHeaderPadding="16 5 5 5"
                  CanUserResizeRows="False"
                  VirtualizingStackPanel.VirtualizationMode="Standard"
                  Margin="10">
            <DataGrid.Resources>
                <Style TargetType="DataGridRow" BasedOn="{StaticResource MaterialDesignDataGridRow}">
                    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
                </Style>
            </DataGrid.Resources>
            <DataGrid.Columns>
                <materialDesign:DataGridTextColumn Binding="{Binding ArtemisLed.RgbLed.Id, Converter={StaticResource LedIdToStringConverter}, Mode=OneWay}" Header="LED ID" Width="Auto" />
                <materialDesign:DataGridTextColumn Binding="{Binding ArtemisLed.RgbLed.Color}" Header="Color (ARGB)" Width="Auto" CanUserSort="False" />
                <materialDesign:DataGridTextColumn Binding="{Binding ArtemisLed.Layout.Image, Converter={StaticResource UriToFileNameConverter}, Mode=OneWay}" Header="Image file" CanUserSort="False" />
                <materialDesign:DataGridTextColumn Binding="{Binding ArtemisLed.RgbLed.Shape}" Header="Shape" />
                <materialDesign:DataGridTextColumn Binding="{Binding ArtemisLed.RgbLed.Size}" Header="Size" Width="Auto" CanUserSort="False" />
                <materialDesign:DataGridTextColumn Binding="{Binding ArtemisLed.RgbLed.CustomData}" Header="LED data" Width="Auto" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>