<Window x:Class="MassiveKnob.Plugin.EmulatorDevice.Devices.EmulatorDeviceWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        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:devices="clr-namespace:MassiveKnob.Plugin.EmulatorDevice.Devices"
        mc:Ignorable="d"
        Title="Massive Knob - Device Emulator" Height="400" Width="300"
        WindowStartupLocation="CenterScreen"
        WindowStyle="ToolWindow"
        Topmost="True"
        d:DataContext="{d:DesignInstance devices:EmulatorDeviceWindowViewModelDesignTime, IsDesignTimeCreatable=True}">
    <Window.Resources>
        <ResourceDictionary>
            <Style TargetType="DockPanel" x:Key="Row">
            </Style>

            <Style TargetType="TextBlock" x:Key="Label">
                <Setter Property="Margin" Value="4,4,8,4" />
                <Setter Property="DockPanel.Dock" Value="Left" />
            </Style>

            <Style x:Key="Value">
                <Setter Property="Control.Margin" Value="4,4,8,4" />
            </Style>
        </ResourceDictionary>
    </Window.Resources>
    <ScrollViewer VerticalScrollBarVisibility="Auto">
        <StackPanel>
            <ItemsControl ItemsSource="{Binding AnalogInputs}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <DockPanel Style="{StaticResource Row}">
                            <TextBlock Text="{Binding DisplayName}" Style="{StaticResource Label}" />
                            <Slider Minimum="0" Maximum="100" Value="{Binding AnalogValue}" Style="{StaticResource Value}" />
                        </DockPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

            <ItemsControl ItemsSource="{Binding DigitalInputs}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <DockPanel Style="{StaticResource Row}">
                            <TextBlock Text="{Binding DisplayName}" Style="{StaticResource Label}" />
                            <CheckBox IsChecked="{Binding DigitalValue}" Style="{StaticResource Value}" />
                        </DockPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

            <ItemsControl ItemsSource="{Binding AnalogOutputs}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <DockPanel Style="{StaticResource Row}">
                            <TextBlock Text="{Binding DisplayName}" Style="{StaticResource Label}" />
                            <TextBlock Text="{Binding AnalogValue}" Style="{StaticResource Value}" />
                        </DockPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

            <ItemsControl ItemsSource="{Binding DigitalOutputs}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <DockPanel Style="{StaticResource Row}">
                            <TextBlock Text="{Binding DisplayName}" Style="{StaticResource Label}" />
                            <TextBlock Text="{Binding DigitalValueDisplayText}" Style="{StaticResource Value}" />
                        </DockPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </StackPanel>
    </ScrollViewer>
</Window>
