<Window x:Class="EMDGui.EmdGui"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="1050" Width="700"
        Background="Black" WindowStyle="None" WindowState="Maximized">
    <Window.Resources>
        <LinearGradientBrush x:Key="defaultBackground">
            <GradientStop Offset="0.0" Color="Blue"/>
            <GradientStop x:Name="stopLS"  Offset="0.3" Color="Blue"/>
            <GradientStop x:Name="stopRS" Offset="0.7" Color="Green"/>
            <GradientStop Offset="1.0" Color="Green"/>
        </LinearGradientBrush>

        <Storyboard x:Key="AnimateColor">
            <!--<DoubleAnimation Storyboard.TargetName="border1" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].Offset" To="1.0" />-->
            <ParallelTimeline>
                <DoubleAnimation Duration="0:0:0.7" Storyboard.TargetProperty="Offset" Storyboard.TargetName="stopL" To="1.0"/>
                <DoubleAnimation Duration="0:0:0.7" Storyboard.TargetProperty="Offset" Storyboard.TargetName="stopR" To="1.3"/>
                <!--AutoRevers="True"-->
            </ParallelTimeline>
        </Storyboard>

        <Style x:Key="text">
            <Setter Property="TextBlock.FontFamily" Value="Arial"/>
            <Setter Property="TextBlock.FontSize" Value="150" />
            <Setter Property="TextBlock.FontWeight" Value="Bold" />
            <Setter Property="TextBlock.Foreground" Value="White" />
            <Setter Property="TextBlock.HorizontalAlignment" Value="Center"/>
        </Style>

        <Storyboard x:Key="Focused" >
            <DoubleAnimation Duration="0:0:0.3" Storyboard.TargetProperty=
                "BorderBrush.GradientStops[0].Offset" Storyboard.TargetName="Bd"/>
        </Storyboard>
    </Window.Resources>
    <Window.Triggers>
        <!--<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=">-->
        <!--</DataTrigger>-->
    </Window.Triggers>
    <Viewbox Stretch="Uniform">
        <Grid Height="1050" Width="700">
            <StackPanel  VerticalAlignment="Center">
                <Border x:Name="border1" Margin="0 20 0 20" CornerRadius="25" BorderBrush="White" BorderThickness="4" Width="650" Height="200" MouseDown="dimmer_MouseDown" MouseUp="dimmer_MouseUp">
                    <Border.Background>
                        <LinearGradientBrush x:Name="defaultBackground">
                            <LinearGradientBrush.StartPoint>
                                <Point X="0" Y="0"/>
                            </LinearGradientBrush.StartPoint>
                            <LinearGradientBrush.EndPoint>
                                <Point X="1" Y="0"/>
                            </LinearGradientBrush.EndPoint>
                            <GradientStop Offset="0.0" Color="Blue"/>
                            <GradientStop x:Name="stopL"  Offset="-0.3" Color="Blue"/>
                            <GradientStop x:Name="stopR" Offset="0.0" Color="Green"/>
                            <GradientStop Offset="1.0" Color="Green"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <TextBlock x:Name="display1" Width="auto" Style="{StaticResource text}">
                    0 W
                    </TextBlock>

                    <!--<Border.Triggers>
                    <EventTrigger RoutedEvent="Border.MouseEnter">
                        <BeginStoryboard>
                            <Storyboard>
                                //<DoubleAnimation Storyboard.TargetName="border1" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].Offset" To="1.0" />
                                <ParallelTimeline>
                                    <DoubleAnimation Duration="0:0:0.7" Storyboard.TargetProperty="Offset" Storyboard.TargetName="stopL" To="1.0"/>
                                    <DoubleAnimation Duration="0:0:0.7" Storyboard.TargetProperty="Offset" Storyboard.TargetName="stopR" To="1.3"/>
                                    //AutoRevers="True"
                                </ParallelTimeline>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                    <EventTrigger RoutedEvent="Border.MouseLeave">
                        <BeginStoryboard>
                            <Storyboard>
                                <ParallelTimeline>
                                    <DoubleAnimation Duration="0:0:0.7" Storyboard.TargetProperty="Offset" Storyboard.TargetName="stopL" To="-0.3" />
                                    <DoubleAnimation Duration="0:0:0.7" Storyboard.TargetProperty="Offset" Storyboard.TargetName="stopR" To="0.0"/>
                                </ParallelTimeline>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Border.Triggers>-->
                </Border>
                <Border x:Name="border2" Margin="0 20 0 20" CornerRadius="25" BorderBrush="White" BorderThickness="4" Width="650" Height="200"  MouseDown="dimmer_MouseDown" MouseUp="dimmer_MouseUp">
                    <Border.Background>
                        <LinearGradientBrush x:Name="default2Background">
                            <LinearGradientBrush.StartPoint>
                                <Point X="0" Y="0"/>
                            </LinearGradientBrush.StartPoint>
                            <LinearGradientBrush.EndPoint>
                                <Point X="1" Y="0"/>
                            </LinearGradientBrush.EndPoint>
                            <GradientStop Offset="0.0" Color="Blue"/>
                            <GradientStop x:Name="stopL2"  Offset="-0.3" Color="Blue"/>
                            <GradientStop x:Name="stopR2" Offset="0.0" Color="Green"/>
                            <GradientStop Offset="1.0" Color="Green"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <TextBlock x:Name="display2" Width="auto" Style="{StaticResource text}">
                    0 W
                    </TextBlock>
                </Border>
                <Border Margin="0 20 0 20" CornerRadius="25" BorderBrush="White" BorderThickness="4" Width="650" Height="200" Background="{StaticResource defaultBackground}" MouseUp="switchAll_MouseUp">
                    <TextBlock Width="auto" Style="{StaticResource text}">
                        Switch
                    </TextBlock>
                </Border>
                <Border HorizontalAlignment="Center"  VerticalAlignment="Center" Margin="0 20 0 20" CornerRadius="25" BorderBrush="White" BorderThickness="4" Width="650" Height="200" Background="DarkRed" MouseUp="switchBruno_MouseUp">
                    <TextBlock Width="auto" Style="{StaticResource text}">
                        Bruno
                    </TextBlock>
                </Border>
            </StackPanel>
        </Grid>
    </Viewbox>
</Window>
