<Window
        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" mc:Ignorable="d" x:Class="VibrationExciterControl.MainWindow"
        Title="Vibration Exciter Control v1.0" Height="550" Width="850" Closing="Window_Closing" Loaded="Window_Loaded" Icon="VEC.ico" MinWidth="850" MinHeight="550">
    <Window.Resources>

        <DataTemplate x:Key="ListBoxDevices">

            <StackPanel Orientation="Vertical">
                <TextBlock Text="{Binding DeviceName}" Foreground="{Binding color}"  Padding="0,0,0,0" FontWeight="Bold"/>
                <TextBlock Text="{Binding DeviceIP}" Foreground="{Binding color}" Padding="5,0,0,0"/>
            </StackPanel>
        </DataTemplate>


        <SolidColorBrush x:Key="SliderThumb.Static.Foreground" Color="#FFE5E5E5"/>
        <SolidColorBrush x:Key="SliderThumb.MouseOver.Background" Color="#FFDCECFC"/>
        <SolidColorBrush x:Key="SliderThumb.MouseOver.Border" Color="#FF7Eb4EA"/>
        <SolidColorBrush x:Key="SliderThumb.Pressed.Background" Color="#FFDAECFC"/>
        <SolidColorBrush x:Key="SliderThumb.Pressed.Border" Color="#FF569DE5"/>
        <SolidColorBrush x:Key="SliderThumb.Disabled.Background" Color="#FFF0F0F0"/>
        <SolidColorBrush x:Key="SliderThumb.Disabled.Border" Color="#FFD9D9D9"/>
        <SolidColorBrush x:Key="SliderThumb.Static.Background" Color="#FFF0F0F0"/>
        <SolidColorBrush x:Key="SliderThumb.Static.Border" Color="#FFACACAC"/>
        <ControlTemplate x:Key="SliderThumbHorizontalTop" TargetType="{x:Type Thumb}">
            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
                <Path x:Name="grip" Data="M 0,6 C0,6 5.5,0 5.5,0 5.5,0 11,6 11,6 11,6 11,18 11,18 11,18 0,18 0,18 0,18 0,6 0,6 z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" SnapsToDevicePixels="True" Stroke="{StaticResource SliderThumb.Static.Border}" StrokeThickness="1" UseLayoutRounding="True" VerticalAlignment="Center"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
                </Trigger>
                <Trigger Property="IsDragging" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <ControlTemplate x:Key="SliderThumbHorizontalBottom" TargetType="{x:Type Thumb}">
            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
                <Path x:Name="grip" Data="M 0,12 C0,12 5.5,18 5.5,18 5.5,18 11,12 11,12 11,12 11,0 11,0 11,0 0,0 0,0 0,0 0,12 0,12 z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" SnapsToDevicePixels="True" Stroke="{StaticResource SliderThumb.Static.Border}" StrokeThickness="1" UseLayoutRounding="True" VerticalAlignment="Center"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
                </Trigger>
                <Trigger Property="IsDragging" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <SolidColorBrush x:Key="SliderThumb.Track.Border" Color="#FFD6D6D6"/>
        <SolidColorBrush x:Key="SliderThumb.Track.Background" Color="#FFE7EAEA"/>
        <Style x:Key="RepeatButtonTransparent" TargetType="{x:Type RepeatButton}">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <ControlTemplate x:Key="SliderThumbHorizontalDefault" TargetType="{x:Type Thumb}">
            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
                <Path x:Name="grip" Data="M 0,0 C0,0 11,0 11,0 11,0 11,18 11,18 11,18 0,18 0,18 0,18 0,0 0,0 z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" SnapsToDevicePixels="True" Stroke="{StaticResource SliderThumb.Static.Border}" StrokeThickness="1" UseLayoutRounding="True" VerticalAlignment="Center"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
                </Trigger>
                <Trigger Property="IsDragging" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <ControlTemplate x:Key="SliderHorizontal" TargetType="{x:Type Slider}">
            <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <TickBar x:Name="TopTick" Fill="{TemplateBinding Foreground}" Height="4" Margin="0,0,0,2" Placement="Top" Grid.Row="0" Visibility="Collapsed"/>
                    <TickBar x:Name="BottomTick" Fill="{TemplateBinding Foreground}" Height="4" Margin="0,2,0,0" Placement="Bottom" Grid.Row="2" Visibility="Collapsed"/>
                    <Border x:Name="TrackBackground" BorderBrush="{StaticResource SliderThumb.Track.Border}" BorderThickness="1" Background="{StaticResource SliderThumb.Track.Background}" Height="4.0" Margin="5,0" Grid.Row="1" VerticalAlignment="center">
                        <Canvas Margin="-6,-1">
                            <Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Height="4.0" Visibility="Hidden"/>
                        </Canvas>
                    </Border>
                    <Track x:Name="PART_Track" Grid.Row="1">
                        <Track.DecreaseRepeatButton>
                            <RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource RepeatButtonTransparent}"/>
                        </Track.DecreaseRepeatButton>
                        <Track.IncreaseRepeatButton>
                            <RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource RepeatButtonTransparent}"/>
                        </Track.IncreaseRepeatButton>
                        <Track.Thumb>
                            <Thumb x:Name="Thumb" Focusable="False" Height="18" OverridesDefaultStyle="True" Template="{StaticResource SliderThumbHorizontalDefault}" VerticalAlignment="Center" Width="11"/>
                        </Track.Thumb>
                    </Track>
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="TickPlacement" Value="TopLeft">
                    <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
                    <Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbHorizontalTop}"/>
                    <Setter Property="Margin" TargetName="TrackBackground" Value="5,2,5,0"/>
                </Trigger>
                <Trigger Property="TickPlacement" Value="BottomRight">
                    <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
                    <Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbHorizontalBottom}"/>
                    <Setter Property="Margin" TargetName="TrackBackground" Value="5,0,5,2"/>
                </Trigger>
                <Trigger Property="TickPlacement" Value="Both">
                    <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
                    <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
                </Trigger>
                <Trigger Property="IsSelectionRangeEnabled" Value="true">
                    <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
                </Trigger>
                <Trigger Property="IsKeyboardFocused" Value="true">
                    <Setter Property="Foreground" TargetName="Thumb" Value="Blue"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <ControlTemplate x:Key="SliderThumbVerticalLeft" TargetType="{x:Type Thumb}">
            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
                <Path x:Name="grip" Data="M 6,11 C6,11 0,5.5 0,5.5 0,5.5 6,0 6,0 6,0 18,0 18,0 18,0 18,11 18,11 18,11 6,11 6,11 z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" Stroke="{StaticResource SliderThumb.Static.Border}"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
                </Trigger>
                <Trigger Property="IsDragging" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <ControlTemplate x:Key="SliderThumbVerticalRight" TargetType="{x:Type Thumb}">
            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
                <Path x:Name="grip" Data="M 12,11 C12,11 18,5.5 18,5.5 18,5.5 12,0 12,0 12,0 0,0 0,0 0,0 0,11 0,11 0,11 12,11 12,11 z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" Stroke="{StaticResource SliderThumb.Static.Border}"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
                </Trigger>
                <Trigger Property="IsDragging" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <ControlTemplate x:Key="SliderThumbVerticalDefault" TargetType="{x:Type Thumb}">
            <Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
                <Path x:Name="grip" Data="M0.5,0.5 L18.5,0.5 18.5,11.5 0.5,11.5z" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" Stroke="{StaticResource SliderThumb.Static.Border}"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.MouseOver.Border}"/>
                </Trigger>
                <Trigger Property="IsDragging" Value="true">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Pressed.Border}"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Fill" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Background}"/>
                    <Setter Property="Stroke" TargetName="grip" Value="{StaticResource SliderThumb.Disabled.Border}"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <ControlTemplate x:Key="SliderVertical" TargetType="{x:Type Slider}">
            <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TickBar x:Name="TopTick" Grid.Column="0" Fill="{TemplateBinding Foreground}" Margin="0,0,2,0" Placement="Left" Visibility="Collapsed" Width="4"/>
                    <TickBar x:Name="BottomTick" Grid.Column="2" Fill="{TemplateBinding Foreground}" Margin="2,0,0,0" Placement="Right" Visibility="Collapsed" Width="4"/>
                    <Border x:Name="TrackBackground" BorderBrush="{StaticResource SliderThumb.Track.Border}" BorderThickness="1" Background="{StaticResource SliderThumb.Track.Background}" Grid.Column="1" HorizontalAlignment="center" Margin="0,5" Width="4.0">
                        <Canvas Margin="-1,-6">
                            <Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Visibility="Hidden" Width="5.0"/>
                        </Canvas>
                    </Border>
                    <Track x:Name="PART_Track" Grid.Column="1">
                        <Track.DecreaseRepeatButton>
                            <RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource RepeatButtonTransparent}"/>
                        </Track.DecreaseRepeatButton>
                        <Track.IncreaseRepeatButton>
                            <RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource RepeatButtonTransparent}"/>
                        </Track.IncreaseRepeatButton>
                        <Track.Thumb>
                            <Thumb x:Name="Thumb" Focusable="False" Height="30" OverridesDefaultStyle="True" Template="{StaticResource SliderThumbVerticalDefault}" VerticalAlignment="Top" Width="40"/>
                        </Track.Thumb>
                    </Track>
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="TickPlacement" Value="TopLeft">
                    <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
                    <Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbVerticalLeft}"/>
                    <Setter Property="Margin" TargetName="TrackBackground" Value="2,5,0,5"/>
                </Trigger>
                <Trigger Property="TickPlacement" Value="BottomRight">
                    <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
                    <Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbVerticalRight}"/>
                    <Setter Property="Margin" TargetName="TrackBackground" Value="0,5,2,5"/>
                </Trigger>
                <Trigger Property="TickPlacement" Value="Both">
                    <Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
                    <Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
                </Trigger>
                <Trigger Property="IsSelectionRangeEnabled" Value="true">
                    <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
                </Trigger>
                <Trigger Property="IsKeyboardFocused" Value="true">
                    <Setter Property="Foreground" TargetName="Thumb" Value="Blue"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="SliderStyle1" TargetType="{x:Type Slider}">
            <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="Foreground" Value="{StaticResource SliderThumb.Static.Foreground}"/>
            <Setter Property="Template" Value="{StaticResource SliderHorizontal}"/>
            <Style.Triggers>
                <Trigger Property="Orientation" Value="Vertical">
                    <Setter Property="Template" Value="{StaticResource SliderVertical}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
        <SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
        <SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA"/>
        <SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5"/>
        <Style x:Key="{x:Type TextBoxBase}" TargetType="{x:Type TextBoxBase}">
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
            <Setter Property="BorderBrush" Value="{StaticResource TextBox.Static.Border}"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="AllowDrop" Value="true"/>
            <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
            <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBoxBase}">
                        <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Template="{DynamicResource ScrollViewerControlTemplate1}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Opacity" TargetName="border" Value="0.56"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border}"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.Focus.Border}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
                        <Condition Property="IsSelectionActive" Value="false"/>
                    </MultiTrigger.Conditions>
                    <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
                </MultiTrigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="{x:Type Hyperlink}" TargetType="{x:Type Hyperlink}">
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}"/>
            <Setter Property="TextDecorations" Value="Underline"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Foreground" Value="Red"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="true">
                    <Setter Property="Cursor" Value="Hand"/>
                </Trigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="RichTextBoxStyle1" TargetType="{x:Type RichTextBox}">
            <Style.Resources>
                <Style x:Key="{x:Type FlowDocument}" TargetType="{x:Type FlowDocument}">
                    <Setter Property="OverridesDefaultStyle" Value="true"/>
                </Style>
                <Style x:Key="{x:Type Hyperlink}" BasedOn="{StaticResource {x:Type Hyperlink}}" TargetType="{x:Type Hyperlink}">
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Foreground" Value="Blue"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Style.Resources>
            <Setter Property="MinWidth" Value="10"/>
            <Style.BasedOn>
                <StaticResource ResourceKey="{x:Type TextBoxBase}"/>
            </Style.BasedOn>
        </Style>
        <ControlTemplate x:Key="ScrollViewerControlTemplate1" TargetType="{x:Type ScrollViewer}">
            <Grid x:Name="Grid" Background="{TemplateBinding Background}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Rectangle x:Name="Corner" Grid.Column="1" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Row="1"/>
                <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0" d:IsHidden="True"/>
                <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" MinWidth="5" Width="9" d:IsHidden="True"/>
                <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" d:IsHidden="True"/>
            </Grid>
        </ControlTemplate>

    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="25"/>
            <RowDefinition Height="27"/>
            <RowDefinition Height="44"/>
            <RowDefinition Height="33"/>
            <RowDefinition Height="75"/>
            <RowDefinition Height="22*"/>
            <RowDefinition Height="93*"/>
            <RowDefinition Height="139*"/>
            <RowDefinition Height="36*"/>
            <RowDefinition Height="25"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="122"/>
            <ColumnDefinition Width="15"/>
            <ColumnDefinition Width="122"/>
            <ColumnDefinition Width="14*"/>
            <ColumnDefinition Width="40*"/>
            <ColumnDefinition Width="91*"/>
            <ColumnDefinition Width="146*"/>
            <ColumnDefinition Width="121*"/>
            <ColumnDefinition Width="9*"/>
            <ColumnDefinition Width="115*"/>
            <ColumnDefinition Width="47*"/>
        </Grid.ColumnDefinitions>
        <Border x:Name="CanvasBorder" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="7" Grid.RowSpan="4" BorderBrush="Black">
            <Canvas x:Name="CanvasGraph" HorizontalAlignment="Stretch"  VerticalAlignment="Stretch" SizeChanged="CanvasGraph_SizeChanged"/>
        </Border>

        <Button x:Name="ButtonStart" Content="Start Test" Grid.Column="7" Grid.Row="8" HorizontalAlignment="Stretch" Margin="5,5,5,5"  VerticalAlignment="Stretch" Grid.RowSpan="2" Grid.ColumnSpan="4" Click="ButtonStart_Click" IsEnabled="False"/>

        <StackPanel Grid.Row="4" Grid.Column="0" VerticalAlignment="Bottom" Height="41">
            <TextBlock HorizontalAlignment="Left" Margin="2,0,0,0"  TextWrapping="Wrap" Text="Start Frequency:"/>
            <Grid>
                <TextBox x:Name="TextBoxStartFrequency" HorizontalAlignment="Stretch" Height="23" Margin="2,0,18,2" TextWrapping="Wrap" Text="5" TextAlignment="Right" TextChanged="TextBoxStartFrequency_TextChanged"/>
                <TextBlock HorizontalAlignment="Right" Margin="2,0,3,0" Text="Hz"/>
            </Grid>
        </StackPanel>

        <StackPanel Grid.Row="4" Grid.Column="2" VerticalAlignment="Bottom" Height="41">
            <TextBlock HorizontalAlignment="Left" Margin="2,0,0,0"  TextWrapping="Wrap" Text="Stop Frequency:"/>
            <Grid>
                <TextBox x:Name="TextBoxStopFrequency" HorizontalAlignment="Stretch" Height="23" Margin="2,0,18,2" TextWrapping="Wrap" Text="500" TextAlignment="Right" TextChanged="TextBoxStopFrequency_TextChanged"/>
                <TextBlock HorizontalAlignment="Right" Margin="2,0,3,0" Text="Hz"/>
            </Grid>
        </StackPanel>
        <Button x:Name ="ButtonSweep" Content="Sweep frequency" Grid.Column="4" HorizontalAlignment="Stretch" Margin="2,0,2,2" Grid.Row="4" VerticalAlignment="Bottom" Height="20" Grid.ColumnSpan="2" Click="ButtonSweep_Click" />
        <Button x:Name="ButtonSingleFrequency" Content="Single frequecy" Grid.Column="6" HorizontalAlignment="Stretch" Margin="2,0,2,2" Grid.Row="4" VerticalAlignment="Bottom" Height="20" Click="ButtonSingleFrequency_Click" />
        <CheckBox Name="CheckBoxSweepStartStopBack" Grid.Column="6" Grid.ColumnSpan="1" HorizontalAlignment="Stretch" Margin="2,2,2,0" Grid.Row="4" VerticalAlignment="Top" Unchecked="CheckBoxSweepStartStopBack_Unchecked" Checked="CheckBoxSweepStartStopBack_Checked">
            <ContentControl VerticalAlignment="Center">
                <TextBlock TextWrapping="Wrap" VerticalAlignment="Stretch" TextAlignment="Left"><Run Text="from Start to Stop and back"/></TextBlock>
            </ContentControl>
        </CheckBox>

        <CheckBox Name="CheckBoxFixTime" Grid.Column="6" Grid.ColumnSpan="1" HorizontalAlignment="Stretch" Margin="2,2,2,0" Grid.Row="3" VerticalAlignment="Top" Checked="CheckBoxFixTime_Checked">
            <ContentControl VerticalAlignment="Center">
                <TextBlock TextWrapping="Wrap" VerticalAlignment="Stretch" TextAlignment="Left"><Run Text="fix time to Stop freq.  in sweep mode"/></TextBlock>
            </ContentControl>
        </CheckBox>

        <CheckBox Name="CheckBoxHalfSin" Grid.Column="6" Grid.ColumnSpan="1" HorizontalAlignment="Stretch" Margin="2,2,2,0" Grid.Row="2" VerticalAlignment="Bottom" Checked="CheckBoxHalfSin_Checked" Unchecked="CheckBoxHalfSin_Unchecked">
            <ContentControl VerticalAlignment="Center">
                <TextBlock TextWrapping="Wrap" VerticalAlignment="Stretch" TextAlignment="Left"><Run Text="half sin pulses"/></TextBlock>
            </ContentControl>
        </CheckBox>

        <DockPanel Grid.Column="6" Grid.Row="9" HorizontalAlignment="Stretch">
            <TextBlock  DockPanel.Dock ="Left" TextWrapping="Wrap" Text="Time of test:" Margin="0,0,3,7" VerticalAlignment="Bottom" Height="16"/>
            <TextBlock DockPanel.Dock="Right"  HorizontalAlignment="Right" Margin="2,0,3,7" Text="s" VerticalAlignment="Bottom" Height="16" Width="5"/>
            <TextBox DockPanel.Dock="Left"  x:Name="TextBoxTimeOfTest" Grid.Column="5" HorizontalAlignment="Stretch" Height="23"  TextWrapping="Wrap" Text="300" VerticalAlignment="Bottom" BorderThickness="1,0" TextAlignment="Right" Background="#FFF7ED8A" TextChanged="TextBoxTimeOfTest_TextChanged"/>


        </DockPanel>

        <Button x:Name="ButtonSearchNetwork" Content="Search in network" Grid.Column="9" HorizontalAlignment="Stretch" Margin="0,5,10,0" VerticalAlignment="Top" Click="ButtonSearchNetwork_Click" Grid.Row="3" Grid.ColumnSpan="2" Height="20"/>
        <Button x:Name="ButtonConnect" Content="Connect" Grid.Column="9" Grid.Row="4" HorizontalAlignment="Stretch" Margin="0,25,10,0" VerticalAlignment="Top" IsEnabled="False" Click="ButtonConnect_Click" Grid.ColumnSpan="2" Height="20"/>
        <Button x:Name="ButtonClose" Content="Close connection" Grid.Column="9" Grid.Row="4" HorizontalAlignment="Stretch" Margin="0,0,10,0" VerticalAlignment="Top" IsEnabled="False" Grid.ColumnSpan="2" Height="20" Click="ButtonClose_Click"/>

        <TextBlock Grid.Column="9" HorizontalAlignment="Left" Margin="0,3,0,0" Text="Connection state:" VerticalAlignment="Top" Height="16" Width="92"/>


        <DockPanel x:Name="DockPanelNetworkAuto"  Grid.Column="7" Grid.Row="1" Grid.RowSpan="4" Visibility="Visible">

            <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="0,3,0,0" Text="Devices list:" VerticalAlignment="Top" Height="16"/>
            <Grid>
                <ListBox x:Name="ListBoxDevices" HorizontalAlignment="Stretch" ItemTemplate="{StaticResource ListBoxDevices}" VerticalAlignment="Stretch" Margin="0,0,0,0" SelectionChanged="ListBoxDevices_SelectionChanged" MouseDoubleClick="ListBoxDevices_MouseDoubleClick"/>
                <Border IsHitTestVisible="False" HorizontalAlignment="Center" VerticalAlignment="Bottom" Padding="5,0,5,0" >
                    <TextBlock  x:Name="TextBlockDevicesStatus" Text="" TextWrapping="Wrap" TextAlignment="Center"/>
                </Border>
            </Grid>
        </DockPanel>

        <DockPanel x:Name="DockPanelNetworkManual"  Grid.Column="7" Grid.Row="1" Grid.RowSpan="4" Visibility="Collapsed">

            <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="2,3,2,0" Text="Remote IP:" VerticalAlignment="Top" Height="16"/>
            <TextBox Name="TextBoxRemoteIP" DockPanel.Dock="Top" VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="2,0,2,0" Height="23" />
            <!--<TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="2,3,2,0" Text="Remote Port:" VerticalAlignment="Top" Height="16"/>
            <TextBox DockPanel.Dock="Top" VerticalAlignment="Top" HorizontalAlignment="Stretch" Text="3000" Margin="2,0,2,0" Height="23" />
            <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="2,3,2,0" Text="Local Port:" VerticalAlignment="Top" Height="16"/>
            <TextBox DockPanel.Dock="Top" VerticalAlignment="Top" HorizontalAlignment="Stretch"  Margin="2,0,2,0" Height="23" />-->
        </DockPanel>

        <DockPanel Grid.ColumnSpan="2" Grid.RowSpan="4">
            <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="4,4,0,0" TextWrapping="Wrap" Text="Generator state:" VerticalAlignment="Top" FontWeight="Bold"/>
            <StackPanel DockPanel.Dock="Left" Orientation="Vertical" HorizontalAlignment="Stretch">
                <TextBlock HorizontalAlignment="Left" Margin="10,0,0,0" TextWrapping="Wrap" Text="3.3V good:" VerticalAlignment="Top"/>
                <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="10,0,0,0" TextWrapping="Wrap" Text="5V good:" VerticalAlignment="Top"/>
                <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="10,0,0,0" TextWrapping="Wrap" Text="12V good:" VerticalAlignment="Top"/>
                <TextBlock HorizontalAlignment="Left" Margin="10,20,0,0" TextWrapping="Wrap" Text="Input Voltage:" VerticalAlignment="Top"/>

            </StackPanel>
            <StackPanel DockPanel.Dock="Right">
                <TextBlock x:Name="TextBlock3V3Good" HorizontalAlignment="Center" Margin="0,0,4,0" TextWrapping="Wrap" Text="X" TextAlignment="Center" VerticalAlignment="Top" FontWeight="SemiBold"/>
                <TextBlock x:Name="TextBlock5VGood" HorizontalAlignment="Center" Margin="0,0,4,0" TextWrapping="Wrap" Text="X" TextAlignment="Center" VerticalAlignment="Top" FontWeight="SemiBold"/>
                <TextBlock x:Name="TextBlock12VGood" HorizontalAlignment="Center" Margin="0,0,4,0" TextWrapping="Wrap" Text="X" TextAlignment="Center" VerticalAlignment="Top" FontWeight="SemiBold"/>
                <TextBlock x:Name="TextBlockInputVoltage" HorizontalAlignment="Center" Margin="0,20,4,0" TextWrapping="Wrap" Text="0.00 V" VerticalAlignment="Top" FontWeight="SemiBold"/>
            </StackPanel>
        </DockPanel>



        <DockPanel Grid.Column="2" Grid.ColumnSpan="3" Grid.RowSpan="4">

            <StackPanel DockPanel.Dock="Left" Orientation="Vertical" HorizontalAlignment="Stretch" Margin="10,0,0,0">
                <TextBlock HorizontalAlignment="Left" Margin="5,20,0,0" TextWrapping="Wrap" Text="Exciter ON:" VerticalAlignment="Top"/>
                <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="5,0,0,0" TextWrapping="Wrap" Text="Exciter Ready:" VerticalAlignment="Top"/>
                <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="5,0,0,0" TextWrapping="Wrap" Text="Overheat:" VerticalAlignment="Top"/>
                <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="5,0,0,0" TextWrapping="Wrap" Text="Overcurrent:" VerticalAlignment="Top"/>
                <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Left" Margin="5,5,0,0" TextWrapping="Wrap" Text="Exciter temperature" VerticalAlignment="Top"/>
            </StackPanel>
            <StackPanel DockPanel.Dock="Right">
                <TextBlock x:Name="TextBlockGenOn" HorizontalAlignment="Center" Margin="0,20,2,0" TextWrapping="Wrap" Text="No" TextAlignment="Center" VerticalAlignment="Top" FontWeight="SemiBold"/>
                <TextBlock x:Name="TextBlockGenReady" HorizontalAlignment="Center" Margin="0,0,2,0" TextWrapping="Wrap" Text="No" TextAlignment="Center" VerticalAlignment="Top" FontWeight="SemiBold"/>
                <TextBlock x:Name="TextBlockGenOverheat" HorizontalAlignment="Center" Margin="0,0,2,0" TextWrapping="Wrap" Text="No" TextAlignment="Center" VerticalAlignment="Top" FontWeight="SemiBold"/>
                <TextBlock x:Name="TextBlockGenOvercurret" HorizontalAlignment="Center" Margin="0,0,2,0" TextWrapping="Wrap" Text="No" TextAlignment="Center" VerticalAlignment="Top" FontWeight="SemiBold"/>
                <TextBlock x:Name="TextBlockGenTemp" HorizontalAlignment="Center" Margin="0,5,2,0" TextWrapping="Wrap" Text="00°C" TextAlignment="Center" VerticalAlignment="Top" FontWeight="SemiBold"/>
            </StackPanel>
        </DockPanel>



        <TextBlock x:Name="TextBlockConnection" Grid.Column="9" HorizontalAlignment="Stretch" Margin="0,24,0,0" TextWrapping="Wrap" Text="not connected" VerticalAlignment="Stretch" FontSize="16" FontWeight="Bold" Grid.RowSpan="2" Grid.ColumnSpan="2"/>
        <CheckBox x:Name="CheckBoxAutoMan" Content="Manual Connect" Grid.Column="7" HorizontalAlignment="Left" Margin="0,5" Grid.Row="0" Checked="CheckBoxAutoMan_Checked" Unchecked="CheckBoxAutoMan_Unchecked" Width="107"/>
        <DockPanel Grid.Column="10" Grid.Row="5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.RowSpan="3">
            <TextBlock DockPanel.Dock="Top" Text="Ampl." HorizontalAlignment="Center"/>
            <TextBlock x:Name="TextBlockScaleValue" DockPanel.Dock="Bottom" Text="0" HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
            <Slider x:Name="SliderScale" DockPanel.Dock="Top" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="40" Orientation="Vertical"  Maximum="1956" Style="{DynamicResource SliderStyle1}" ValueChanged="Slider_ValueChanged" SmallChange="1" IsSnapToTickEnabled="True"/>
        </DockPanel>

        <CheckBox  x:Name="CheckBoxManualOverride" Content="Manual override" Grid.Column="7" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="5" VerticalAlignment="Stretch" Width="110" Unchecked="CheckBoxManualOverride_Unchecked" Checked="CheckBoxManualOverride_Checked" Height="15"/>
        <DockPanel Grid.Column="7" Grid.Row="6" Grid.ColumnSpan="3" Grid.RowSpan="2">




            <Grid DockPanel.Dock="Top" x:Name="ManualOverride" Grid.Column="7" Grid.Row="7" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Visibility="Collapsed" VerticalAlignment="Stretch">

                <StackPanel Orientation="Vertical" Margin="5,0,5,0">
                    <StackPanel Orientation="Horizontal">
                        <Button x:Name="ButtonStartGen" Content="Start generator"  Width="110"  Click="ButtonStartGen_Click" Height="20"/>
                        <Button x:Name="Button12VOn" Content="12V On"  Width="55"  Height="20" Click="Button12VOn_Click" Margin="30,0,0,0"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
                        <Button x:Name="ButtonStopGen" Content="Stop generator"  Width="110"  Click="ButtonStopGen_Click" Height="20"/>
                        <Button x:Name="Button12VOff" Content="12V Off"  Width="55"  Height="20" Click="Button12VOff_Click" Margin="30,0,0,0"/>
                    </StackPanel>

                    <TextBlock HorizontalAlignment="Left"  TextWrapping="Wrap" Text="Frequency:" VerticalAlignment="Top"  Height="16" Margin="0,5,0,0"/>
                    <StackPanel Orientation="Horizontal">
                        <TextBox x:Name="TextBoxFrequency" HorizontalAlignment="Left" Height="23"  TextWrapping="Wrap" Text="40" TextAlignment="Right" VerticalAlignment="Top" Width="110" TextChanged="TextBoxFrequency_TextChanged" KeyDown="TextBoxFrequency_KeyDown" Margin="0,0,0,0"/>
                        <Button x:Name="ButtonSetFrequency" Content="Set" HorizontalAlignment="Right" VerticalAlignment="Top" Width="55" Click="ButtonSetFrequency_Click" Height="20"  Margin="30,0,0,2"/>
                    </StackPanel>
                </StackPanel>


            </Grid>
            <RichTextBox x:Name="TextBoxOutput" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  AllowDrop="False" IsReadOnly="True" IsUndoEnabled="False" IsHitTestVisible="True" AcceptsReturn="False" Margin="5,5,5,0" VerticalScrollBarVisibility="Visible" Style="{DynamicResource RichTextBoxStyle1}" />
        </DockPanel>

        <TextBlock Grid.Column="9" Grid.Row="2" Text="Network Interface:" Margin="0,0,0,0" VerticalAlignment="Top" Height="16" Grid.ColumnSpan="2" />
        <ComboBox x:Name="ComboBoxInterfaces" Grid.ColumnSpan="2" Grid.Column="9" HorizontalAlignment="Stretch" Margin="0,0,10,0" Grid.Row="2" VerticalAlignment="Top" Height="22" MouseEnter="ComboBoxInterfaces_MouseEnter">
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding netDescription}" Margin="0,0,10,0"/>
                        <TextBlock Text="{Binding netIp}"/>
                    </StackPanel>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>
        <Button x:Name="ButtonTakeControl" Content="Take control" Grid.Column="9" HorizontalAlignment="Stretch" Margin="0,50,10,0" Grid.Row="4" VerticalAlignment="Top" Height="20" Grid.ColumnSpan="2" IsEnabled="False" Click="ButtonTakeControl_Click"/>
        <Slider Name="SliderSweepSpeed" Grid.Column="4" HorizontalAlignment="Left" Margin="2,30,0,0" Grid.Row="4" VerticalAlignment="Top" Grid.ColumnSpan="2" Width="127" LostMouseCapture="SliderSweepSpeed_LostMouseCapture" Maximum="4" Minimum="0.1" ValueChanged="SliderSweepSpeed_ValueChanged" Value="1" SmallChange="0.025" SelectionEnd="1" SelectionStart="1" TickFrequency="0.025" IsSnapToTickEnabled="True"/>
        <TextBlock Name="TextBlockSweepSpeed" Grid.Column="4" Grid.ColumnSpan="2" HorizontalAlignment="Left" Margin="5,10,0,0" Grid.Row="4" TextWrapping="Wrap" Text="Sweep speed: 1.00" VerticalAlignment="Top"/>
        <Button Name="ButtonCSVSave" Content="Save to CSV" HorizontalAlignment="Stretch" Margin="0,0,0,3" Grid.Row="9" VerticalAlignment="Top" Click="ButtonCSVSave_Click"/>
        <Button Name="ButtonCSVLoad" Content="Load from CSV" HorizontalAlignment="Stretch" Margin="0,0,0,3" Grid.Row="9" Grid.Column="2" VerticalAlignment="Top" Click="ButtonCSVLoad_Click"/>
        <Button Name="ButtonPlotChange" Content="Show Amplitude" HorizontalAlignment="Left" Margin="0,0,0,3" Grid.Row="9" Grid.Column="4" Grid.ColumnSpan="2" VerticalAlignment="Top" Width="122" Click="PlotChange_Click"/>
        <Slider Name="SliderDispBrig" Grid.Column="6" HorizontalAlignment="Stretch" Grid.Row="1" VerticalAlignment="Center" Margin="0,0,5,0" ValueChanged="Slider_ValueChanged_1" Maximum="127" SmallChange="1" Value="30" IsSnapToTickEnabled="True"/>
        <TextBlock Name="TextBlockDispBrig" Grid.Column="6" HorizontalAlignment="Left" TextWrapping="Wrap" Text="Display Brightness: 30" VerticalAlignment="Bottom"/>
        <CheckBox Name="CheckBoxAmplitudeInUm" Content="Amplitude in um" Grid.Column="9" HorizontalAlignment="Right" Margin="0,0,0,0" Grid.Row="5" VerticalAlignment="Top" IsChecked="false" Unchecked="CheckBoxAmplitudeInUm_Unchecked" Checked="CheckBoxAmplitudeInUm_Checked"/>



    </Grid>
</Window>
