<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Configs.SignalTowerConfig.SignalTowerConfigView"
            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:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:micro="clr-namespace:Caliburn.Micro"
             mc:Ignorable="d" 
             d:DesignHeight="1024" d:DesignWidth="1900">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition  Width="150"/>
                <ColumnDefinition  Width="100"/>
                <ColumnDefinition  Width="100"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Button Content="Save" Grid.Column="1" Width="90" Height="30"  Margin="0" Padding="0" >
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <micro:ActionMessage MethodName="SaveSelection">
                        </micro:ActionMessage>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>

            <Button Content="Cancel" Grid.Column="2" Width="90" Height="30"  Margin="0" Padding="0" >
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <micro:ActionMessage MethodName="CancelSelection">
                        </micro:ActionMessage>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>

        </Grid>

        <Grid Grid.Row="1">
            <DataGrid  HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0"
                       VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
                       ItemsSource="{Binding SignalTowerData}" Margin="0,5,0,0" >

                <DataGrid.Columns>
                    <DataGridTemplateColumn Header="Condition Name" Width="300">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Name}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" >
                                </TextBlock>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>

                    <DataGridTemplateColumn Header="Red" Width="140">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>

                                <Border HorizontalAlignment="Stretch" Background="OrangeRed">
                                    <StackPanel Orientation="Horizontal">
                                        <CheckBox  VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON"  IsChecked="{Binding Path=IsRed, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
                                        <CheckBox Padding="10,0,0,0"  VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking"  IsChecked="{Binding Path=IsRedBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>

                                    </StackPanel>
                                </Border>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>

                    <DataGridTemplateColumn Header="Yellow" Width="140">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Border HorizontalAlignment="Stretch" Background="LightGoldenrodYellow">
                                    <StackPanel Orientation="Horizontal">
                                        <CheckBox  VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON"  IsChecked="{Binding Path=IsYellow, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
                                        <CheckBox Padding="10,0,0,0"  VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking"  IsChecked="{Binding Path=IsYellowBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>

                                    </StackPanel>                                </Border>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>

                    <DataGridTemplateColumn Header="Green" Width="140">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Border HorizontalAlignment="Stretch" Background="LightGreen">
                                    <StackPanel Orientation="Horizontal">
                                        <CheckBox  VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON"  IsChecked="{Binding Path=IsGreen, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
                                        <CheckBox Padding="10,0,0,0"  VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking"  IsChecked="{Binding Path=IsGreenBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>

                                    </StackPanel>                                </Border>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>


                    <DataGridTemplateColumn Header="Blue" Width="140">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Border HorizontalAlignment="Stretch" Background="LightBlue">
                                    <StackPanel Orientation="Horizontal">
                                        <CheckBox  VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON"  IsChecked="{Binding Path=IsBlue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
                                        <CheckBox Padding="10,0,0,0"  VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking"  IsChecked="{Binding Path=IsBlueBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>

                                    </StackPanel>                                </Border>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>

                    <DataGridTemplateColumn Header="Buzzer" Width="140">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Border HorizontalAlignment="Stretch" Background="White">
                                    <StackPanel Orientation="Horizontal">
                                        <CheckBox  VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON"  IsChecked="{Binding Path=IsBuzzer, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
                                        <CheckBox Padding="10,0,0,0"  VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking"  IsChecked="{Binding Path=IsBuzzerBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>

                                    </StackPanel>                                </Border>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>

                </DataGrid.Columns>
            </DataGrid>
        </Grid>
    </Grid>
</UserControl>
