<commit_before>﻿<Window x:Class="Monitorian.Core.Views.MainWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
		xmlns:sys="clr-namespace:System;assembly=mscorlib"
		xmlns:models="clr-namespace:Monitorian.Core.Models"
		xmlns:behaviors="clr-namespace:Monitorian.Core.Views.Behaviors"
		xmlns:controls="clr-namespace:Monitorian.Core.Views.Controls"
		xmlns:properties="clr-namespace:Monitorian.Core.Properties"
		Width="360" Height="200"
		ResizeMode="NoResize" SizeToContent="WidthAndHeight"
		ShowInTaskbar="False"
		AllowsTransparency="True" WindowStyle="None"
		Background="{StaticResource App.Background.Plain}">
	<Window.Resources>
		<sys:Double x:Key="ButtonHeight">60</sys:Double>
		<sys:Double x:Key="ThumbHeight">44</sys:Double>
		<sys:Double x:Key="BracketHeight">8</sys:Double>

		<!-- Slider -->
		<Color x:Key="Slider.Filled.Static.BackgroundColor">#FF2982CC</Color>
		<Color x:Key="Slider.Filled.MouseOver.BackgroundColor">#FF1A5280</Color>
		<Color x:Key="Slider.Filled.Pressed.BackgroundColor">#FF5CA4DE</Color>
		<Color x:Key="Slider.Disabled.BackgroundColor">#FFF0F0F0</Color>
		<Color x:Key="Slider.Vacant.BackgroundColor">#FF999999</Color>

		<SolidColorBrush x:Key="Slider.Filled.Static.Background" Color="{StaticResource Slider.Filled.Static.BackgroundColor}"/>
		<SolidColorBrush x:Key="Slider.Filled.MouseOver.Background" Color="{StaticResource Slider.Filled.MouseOver.BackgroundColor}"/>
		<SolidColorBrush x:Key="Slider.Filled.Pressed.Background" Color="{StaticResource Slider.Filled.Pressed.BackgroundColor}"/>
		<SolidColorBrush x:Key="Slider.Disabled.Background" Color="{StaticResource Slider.Disabled.BackgroundColor}"/>
		<SolidColorBrush x:Key="Slider.Vacant.Background" Color="{StaticResource Slider.Vacant.BackgroundColor}"/>

		<Style x:Key="SliderHorizontal" TargetType="{x:Type controls:CompoundSlider}">
			<Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
			<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type controls:CompoundSlider}">
						<ControlTemplate.Resources>
							<Style TargetType="{x:Type ToolTip}">
								<Setter Property="OverridesDefaultStyle" Value="True"/>
								<Setter Property="Padding" Value="5,3"/>
								<Setter Property="Background" Value="{StaticResource App.Background.Plain}"/>
								<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
								<Setter Property="FontSize" Value="13"/>
								<Setter Property="Template">
									<Setter.Value>
										<ControlTemplate TargetType="{x:Type ToolTip}">
											<Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
													BorderThickness="0"
													Background="{TemplateBinding Background}">
												<ContentPresenter Margin="{TemplateBinding Padding}"/>
											</Border>
										</ControlTemplate>
									</Setter.Value>
								</Setter>
							</Style>

							<Style x:Key="SliderButtonHorizontal" TargetType="{x:Type RepeatButton}">
								<Setter Property="OverridesDefaultStyle" Value="True"/>
								<Setter Property="Focusable" Value="False"/>
								<Setter Property="IsTabStop" Value="False"/>
							</Style>

							<Style x:Key="SliderThumbHorizontal" TargetType="{x:Type Thumb}">
								<Setter Property="OverridesDefaultStyle" Value="True"/>
								<Setter Property="Focusable" Value="False"/>
								<Setter Property="Background" Value="Transparent"/>
								<Setter Property="Template">
									<Setter.Value>
										<ControlTemplate TargetType="{x:Type Thumb}">
											<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
												<Rectangle Height="{DynamicResource BracketHeight}"
														   VerticalAlignment="Top"
														   Fill="{TemplateBinding Background}"/>
												<Rectangle Height="{DynamicResource BracketHeight}"
														   VerticalAlignment="Bottom"
														   Fill="{TemplateBinding Background}"/>

												<Rectangle x:Name="grip"
														   Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
														   Margin="2">
													<Rectangle.Fill>
														<SolidColorBrush Color="{StaticResource Slider.Filled.Static.BackgroundColor}"/>
													</Rectangle.Fill>
												</Rectangle>

												<VisualStateManager.VisualStateGroups>
													<VisualStateGroup x:Name="CommonStates">
														<VisualState x:Name="Normal"/>
														<VisualState x:Name="MouseOver">
															<Storyboard>
																<ColorAnimation	Storyboard.TargetName="grip"
																				Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
																				Duration="0:0:0.1"
																				To="{StaticResource Slider.Filled.MouseOver.BackgroundColor}"/>
															</Storyboard>
														</VisualState>
														<VisualState x:Name="Pressed">
															<Storyboard>
																<ColorAnimation	Storyboard.TargetName="grip"
																				Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
																				Duration="0:0:0.1"
																				To="{StaticResource Slider.Filled.Pressed.BackgroundColor}"/>
															</Storyboard>
														</VisualState>
														<VisualState x:Name="Disabled">
															<Storyboard>
																<ColorAnimation Storyboard.TargetName="grip"
																				Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
																				Duration="0:0:0.1"
																				To="{StaticResource Slider.Disabled.BackgroundColor}"/>
															</Storyboard>
														</VisualState>
													</VisualStateGroup>
												</VisualStateManager.VisualStateGroups>
											</Grid>
										</ControlTemplate>
									</Setter.Value>
								</Setter>
							</Style>
						</ControlTemplate.Resources>

						<Border x:Name="border"
								Background="{TemplateBinding Background}"
								SnapsToDevicePixels="True" UseLayoutRounding="True">
							<Grid>
								<Grid>
									<Grid.ColumnDefinitions>
										<ColumnDefinition x:Name="PART_ShadowLeft" Width="*"/>
										<ColumnDefinition Width="Auto"/>
										<ColumnDefinition x:Name="PART_ShadowRight" Width="*"/>
									</Grid.ColumnDefinitions>

									<Rectangle Grid.Column="1"
											   x:Name="PART_ShadowThumb"
											   Width="8"
											   controls:FrameworkElementMargin.Vertical="{DynamicResource BracketHeight}"
											   Fill="{StaticResource Slider.Vacant.Background}"
											   IsHitTestVisible="False"/>
								</Grid>

								<Rectangle Height="3" Margin="5,0" VerticalAlignment="Center"
										   Fill="{StaticResource Slider.Vacant.Background}"/>
								<Rectangle Width="{Binding ElementName=TrackLeft, Path=ActualWidth}"
										   Height="3" Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center"
										   Fill="{StaticResource Slider.Filled.Static.Background}"/>

								<Track x:Name="PART_Track">
									<Track.DecreaseRepeatButton>
										<RepeatButton x:Name="TrackLeft"
													  Style="{StaticResource SliderButtonHorizontal}"
													  Command="{x:Static Slider.DecreaseLarge}"/>
									</Track.DecreaseRepeatButton>
									<Track.IncreaseRepeatButton>
										<RepeatButton x:Name="TrackRight"
													  Style="{StaticResource SliderButtonHorizontal}"
													  Command="{x:Static Slider.IncreaseLarge}"/>
									</Track.IncreaseRepeatButton>
									<Track.Thumb>
										<Thumb x:Name="thumb"
											   Width="15" Height="{DynamicResource ThumbHeight}"
											   Style="{StaticResource SliderThumbHorizontal}"/>
									</Track.Thumb>
								</Track>
							</Grid>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsUnison" Value="True">
								<Setter Property="Background" TargetName="thumb" Value="{StaticResource App.Foreground.Shadow}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- Pulse Label -->
		<Style x:Key="PulseLabelStyle" TargetType="{x:Type controls:PulseLabel}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type controls:PulseLabel}">
						<Grid>
							<Border>
								<TextBlock HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
										   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
										   Text="{TemplateBinding ContentPresenter.Content}">
									<TextBlock.Foreground>
										<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
											<GradientStop x:Name="head" Color="{StaticResource App.ForegroundColor}" Offset="0.0"/>
											<GradientStop x:Name="middle" Color="{StaticResource App.ForegroundColor}" Offset="0.0"/>
											<GradientStop x:Name="tail" Color="{StaticResource App.ForegroundColor}" Offset="0.0"/>
										</LinearGradientBrush>
									</TextBlock.Foreground>
								</TextBlock>
							</Border>

							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup Name="PulseStates">
									<VisualState x:Name="Off"/>
									<VisualState x:Name="On">
										<Storyboard>
											<ColorAnimation Storyboard.TargetName="middle"
															Storyboard.TargetProperty="(GradientStop.Color)"
															Duration="0"
															To="{StaticResource App.ShadowColor}"/>
											<DoubleAnimation Storyboard.TargetName="head"
															 Storyboard.TargetProperty="(GradientStop.Offset)"
															 Duration="0:0:1.2"
															 From="0.0" To="1.8"
															 RepeatBehavior="Forever"/>
											<DoubleAnimation Storyboard.TargetName="middle"
															 Storyboard.TargetProperty="(GradientStop.Offset)"
															 Duration="0:0:1.2"
															 From="-0.4" To="1.4"
															 RepeatBehavior="Forever"/>
											<DoubleAnimation Storyboard.TargetName="tail"
															 Storyboard.TargetProperty="(GradientStop.Offset)"
															 Duration="0:0:1.2"
															 From="-0.8" To="1.0"
															 RepeatBehavior="Forever"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- Name TextBox -->
		<Style x:Key="NameTextBoxStyle" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
			<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
			<Setter Property="CaretBrush" Value="{StaticResource App.Foreground}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TextBox}">
						<Border x:Name="border"
								BorderBrush="Transparent" BorderThickness="1"
								Background="Transparent"
								SnapsToDevicePixels="True">
							<ScrollViewer x:Name="PART_ContentHost"
										  VerticalScrollBarVisibility="Hidden"
										  Focusable="False"/>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsReadOnly" Value="False">
								<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Text.Border.Writable}"/>
								<Setter Property="Background" TargetName="border" Value="{StaticResource Text.Background.Writable}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- Brightness Button -->
		<Style x:Key="BrightnessButtonStyle" TargetType="{x:Type Button}">
			<Setter Property="Focusable" Value="False"/>
			<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<Grid x:Name="base">
								<Grid.Background>
									<SolidColorBrush Color="{StaticResource Access.Background.NormalColor}"/>
								</Grid.Background>
								<Border x:Name="border"
										BorderThickness="2">
									<Border.BorderBrush>
										<SolidColorBrush Color="{StaticResource Access.Border.NormalColor}"/>
									</Border.BorderBrush>
									<ContentPresenter Content="{TemplateBinding Content}"/>
								</Border>
							</Grid>

							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver">
										<Storyboard>
											<ColorAnimation Storyboard.TargetName="border"
															Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
															Duration="0"
															To="{StaticResource Access.Border.MouseOverColor}"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Storyboard.TargetName="base"
															Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
															Duration="0"
															To="{StaticResource Access.Background.PressedColor}"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- Unison Button -->
		<Style x:Key="UnisonButtonStyle" TargetType="{x:Type ToggleButton}">
			<Setter Property="Focusable" Value="False"/>
			<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Grid>
							<Grid x:Name="base">
								<Grid.Background>
									<SolidColorBrush Color="{StaticResource Access.Background.NormalColor}"/>
								</Grid.Background>
								<Border x:Name="border"
										BorderThickness="2">
									<Border.BorderBrush>
										<SolidColorBrush Color="{StaticResource Access.Border.NormalColor}"/>
									</Border.BorderBrush>
									<Grid Height="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}"
										  Margin="2" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
										  RenderOptions.EdgeMode="Aliased">
										<Path x:Name="horizontalLine"
											  Data="M 0,0 1,0" Stretch="Uniform"
											  Stroke="{TemplateBinding Foreground}" StrokeThickness="1"/>
										<Path x:Name="verticalLine"
											  Data="M 0,0 0,1" Stretch="Uniform"
											  Stroke="{TemplateBinding Foreground}" StrokeThickness="1"
											  Opacity="1"/>
									</Grid>
								</Border>
							</Grid>

							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver">
										<Storyboard>
											<ColorAnimation Storyboard.TargetName="border"
															Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
															Duration="0"
															To="{StaticResource Access.Border.MouseOverColor}"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Storyboard.TargetName="base"
															Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
															Duration="0"
															To="{StaticResource Access.Background.PressedColor}"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="CheckStates">
									<VisualState x:Name="Checked">
										<Storyboard>
											<DoubleAnimation Storyboard.TargetName="verticalLine"
															 Storyboard.TargetProperty="(UIElement.Opacity)"
															 Duration="0"
															 To="0"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Unchecked"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>

	<Grid Width="360">
		<!-- Pulse -->
		<controls:PulseLabel Margin="6,4"
							 Style="{StaticResource PulseLabelStyle}"
							 Content="{Binding Source={x:Static models:ProductInfo.Title}, Mode=OneTime}"
							 IsPulsing="{Binding IsScanning, Mode=OneWay}"
							 Visibility="{Binding IsMonitorsEmpty, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverterKey}}"/>

		<!-- Monitors-->
		<ListView ItemsSource="{Binding MonitorsView}"
				  SelectionMode="Single">
			<ListView.Template>
				<ControlTemplate TargetType="{x:Type ListView}">
					<Border BorderThickness="0">
						<ScrollViewer CanContentScroll="False"
									  HorizontalScrollBarVisibility="Disabled"
									  VerticalScrollBarVisibility="Auto">
							<VirtualizingStackPanel IsItemsHost="True"/>
						</ScrollViewer>
					</Border>
				</ControlTemplate>
			</ListView.Template>
			<ListView.ItemTemplate>
				<DataTemplate>
					<Grid Background="Transparent">
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>

						<!-- Name -->
						<controls:SwitchTextBox Grid.Row="0"
												Margin="6,5,2,5" HorizontalAlignment="Left" VerticalAlignment="Center"
												Style="{StaticResource NameTextBoxStyle}"
												TextWrapping="Wrap" MaxLength="96"
												Text="{Binding Name, Mode=TwoWay}"/>

						<!-- Brightness -->
						<Grid Grid.Row="1"
							  x:Name="BrightnessBox"
							  Margin="0,0,0,6"
							  Visibility="{Binding IsControllable, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverterKey}}">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="3"/>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="4"/>
							</Grid.ColumnDefinitions>

							<Rectangle Grid.Column="0"
									   Fill="{StaticResource App.Background.Accent}"
									   Visibility="{Binding IsSelectedByKey, Converter={StaticResource BooleanToVisibilityConverterKey}}"/>

							<Button Grid.Column="1"
									Width="80" Height="{DynamicResource ButtonHeight}" Margin="3,0,0,0"
									Style="{StaticResource BrightnessButtonStyle}">
								<TextBlock Margin="2" HorizontalAlignment="Left" VerticalAlignment="Bottom"
										   Text="{Binding Brightness, Mode=OneWay, StringFormat={}{0}%}"/>
								<i:Interaction.Triggers>
									<i:EventTrigger EventName="Click">
										<behaviors:MouseDownParentAction/>
										<i:CallMethodAction TargetObject="{Binding}"
															MethodName="IncrementBrightness"/>
									</i:EventTrigger>
								</i:Interaction.Triggers>
							</Button>

							<controls:CompoundSlider Grid.Column="2"
													 Margin="8,0,6,0" VerticalAlignment="Center"
													 Style="{StaticResource SliderHorizontal}"
													 AutoToolTipPlacement="TopLeft"
													 Minimum="0" Maximum="100"
													 Value="{Binding Brightness, Mode=TwoWay, Delay=50}"
													 IsShadowVisible="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Settings.ShowsAdjusted}"
													 ValueShadow="{Binding BrightnessSystemAdjusted, Mode=OneWay}"
													 IsUnison="{Binding IsUnison, Mode=TwoWay}"
													 ValueUnison="{Binding BrightnessSystemChanged, Mode=OneWay}">
								<i:Interaction.Behaviors>
									<behaviors:ItemSliderBehavior IsSelected="{Binding IsSelected, Mode=OneWay}"
																  IsByKey="{Binding IsByKey, Mode=TwoWay}"/>
								</i:Interaction.Behaviors>
							</controls:CompoundSlider>

							<ToggleButton Grid.Column="3"
										  Width="16" Height="{DynamicResource ButtonHeight}" Margin="0,0,2,0"
										  Style="{StaticResource UnisonButtonStyle}"
										  VerticalContentAlignment="Bottom"
										  IsChecked="{Binding IsUnison, Mode=TwoWay}"
										  Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Settings.EnablesUnison, Converter={StaticResource BooleanToVisibilityConverterKey}}"/>
						</Grid>

						<!-- Alternative -->
						<Grid Grid.Row="1"
							  Visibility="{Binding ElementName=BrightnessBox, Path=Visibility, Mode=OneWay, Converter={StaticResource VisibilityInverseConverterKey}}">
							<Border Margin="6,4"
									Padding="3"
									BorderThickness="1"
									BorderBrush="{StaticResource App.Foreground.Invalid}">
								<TextBlock Foreground="{StaticResource App.Foreground.Invalid}"
										   Text="{x:Static properties:Resources.NotControllable}"/>
							</Border>
						</Grid>
					</Grid>
				</DataTemplate>
			</ListView.ItemTemplate>
			<ListView.ItemContainerStyle>
				<Style TargetType="{x:Type ListViewItem}">
					<Setter Property="OverridesDefaultStyle" Value="True"/>
					<Setter Property="Margin" Value="0"/>
					<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
					<Setter Property="Template">
						<Setter.Value>
							<ControlTemplate TargetType="{x:Type ContentControl}">
								<ContentPresenter/>
							</ControlTemplate>
						</Setter.Value>
					</Setter>
				</Style>
			</ListView.ItemContainerStyle>

			<i:Interaction.Behaviors>
				<behaviors:ItemSelectorBehavior/>
			</i:Interaction.Behaviors>
		</ListView>
	</Grid>
</Window><commit_msg>Sort out colors<commit_after>﻿<Window x:Class="Monitorian.Core.Views.MainWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
		xmlns:sys="clr-namespace:System;assembly=mscorlib"
		xmlns:models="clr-namespace:Monitorian.Core.Models"
		xmlns:behaviors="clr-namespace:Monitorian.Core.Views.Behaviors"
		xmlns:controls="clr-namespace:Monitorian.Core.Views.Controls"
		xmlns:properties="clr-namespace:Monitorian.Core.Properties"
		Width="360" Height="200"
		ResizeMode="NoResize" SizeToContent="WidthAndHeight"
		ShowInTaskbar="False"
		AllowsTransparency="True" WindowStyle="None"
		Background="{StaticResource App.Background.Plain}">
	<Window.Resources>
		<sys:Double x:Key="ButtonHeight">60</sys:Double>
		<sys:Double x:Key="ThumbHeight">44</sys:Double>
		<sys:Double x:Key="BracketHeight">8</sys:Double>

		<!-- Slider -->
		<Color x:Key="Slider.Background.Filled.StaticColor">#FF2982CC</Color>
		<Color x:Key="Slider.Background.Filled.MouseOverColor">#FF1A5280</Color>
		<Color x:Key="Slider.Background.Filled.PressedColor">#FF5CA4DE</Color>
		<Color x:Key="Slider.Background.DisabledColor">#FFF0F0F0</Color>
		<Color x:Key="Slider.Background.VacantColor">#FF999999</Color>

		<SolidColorBrush x:Key="Slider.Background.Filled.Static" Color="{StaticResource Slider.Background.Filled.StaticColor}"/>
		<SolidColorBrush x:Key="Slider.Background.Vacant" Color="{StaticResource Slider.Background.VacantColor}"/>

		<Style x:Key="SliderHorizontal" TargetType="{x:Type controls:CompoundSlider}">
			<Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
			<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type controls:CompoundSlider}">
						<ControlTemplate.Resources>
							<Style TargetType="{x:Type ToolTip}">
								<Setter Property="OverridesDefaultStyle" Value="True"/>
								<Setter Property="Padding" Value="5,3"/>
								<Setter Property="Background" Value="{StaticResource App.Background.Plain}"/>
								<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
								<Setter Property="FontSize" Value="13"/>
								<Setter Property="Template">
									<Setter.Value>
										<ControlTemplate TargetType="{x:Type ToolTip}">
											<Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
													BorderThickness="0"
													Background="{TemplateBinding Background}">
												<ContentPresenter Margin="{TemplateBinding Padding}"/>
											</Border>
										</ControlTemplate>
									</Setter.Value>
								</Setter>
							</Style>

							<Style x:Key="SliderButtonHorizontal" TargetType="{x:Type RepeatButton}">
								<Setter Property="OverridesDefaultStyle" Value="True"/>
								<Setter Property="Focusable" Value="False"/>
								<Setter Property="IsTabStop" Value="False"/>
							</Style>

							<Style x:Key="SliderThumbHorizontal" TargetType="{x:Type Thumb}">
								<Setter Property="OverridesDefaultStyle" Value="True"/>
								<Setter Property="Focusable" Value="False"/>
								<Setter Property="Background" Value="Transparent"/>
								<Setter Property="Template">
									<Setter.Value>
										<ControlTemplate TargetType="{x:Type Thumb}">
											<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
												<Rectangle Height="{DynamicResource BracketHeight}"
														   VerticalAlignment="Top"
														   Fill="{TemplateBinding Background}"/>
												<Rectangle Height="{DynamicResource BracketHeight}"
														   VerticalAlignment="Bottom"
														   Fill="{TemplateBinding Background}"/>

												<Rectangle x:Name="grip"
														   Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
														   Margin="2">
													<Rectangle.Fill>
														<SolidColorBrush Color="{StaticResource Slider.Background.Filled.StaticColor}"/>
													</Rectangle.Fill>
												</Rectangle>

												<VisualStateManager.VisualStateGroups>
													<VisualStateGroup x:Name="CommonStates">
														<VisualState x:Name="Normal"/>
														<VisualState x:Name="MouseOver">
															<Storyboard>
																<ColorAnimation	Storyboard.TargetName="grip"
																				Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
																				Duration="0:0:0.1"
																				To="{StaticResource Slider.Background.Filled.MouseOverColor}"/>
															</Storyboard>
														</VisualState>
														<VisualState x:Name="Pressed">
															<Storyboard>
																<ColorAnimation	Storyboard.TargetName="grip"
																				Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
																				Duration="0:0:0.1"
																				To="{StaticResource Slider.Background.Filled.PressedColor}"/>
															</Storyboard>
														</VisualState>
														<VisualState x:Name="Disabled">
															<Storyboard>
																<ColorAnimation Storyboard.TargetName="grip"
																				Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
																				Duration="0:0:0.1"
																				To="{StaticResource Slider.Background.DisabledColor}"/>
															</Storyboard>
														</VisualState>
													</VisualStateGroup>
												</VisualStateManager.VisualStateGroups>
											</Grid>
										</ControlTemplate>
									</Setter.Value>
								</Setter>
							</Style>
						</ControlTemplate.Resources>

						<Border x:Name="border"
								Background="{TemplateBinding Background}"
								SnapsToDevicePixels="True" UseLayoutRounding="True">
							<Grid>
								<Grid>
									<Grid.ColumnDefinitions>
										<ColumnDefinition x:Name="PART_ShadowLeft" Width="*"/>
										<ColumnDefinition Width="Auto"/>
										<ColumnDefinition x:Name="PART_ShadowRight" Width="*"/>
									</Grid.ColumnDefinitions>

									<Rectangle Grid.Column="1"
											   x:Name="PART_ShadowThumb"
											   Width="8"
											   controls:FrameworkElementMargin.Vertical="{DynamicResource BracketHeight}"
											   Fill="{StaticResource Slider.Background.Vacant}"
											   IsHitTestVisible="False"/>
								</Grid>

								<Rectangle Height="3" Margin="5,0" VerticalAlignment="Center"
										   Fill="{StaticResource Slider.Background.Vacant}"/>
								<Rectangle Width="{Binding ElementName=TrackLeft, Path=ActualWidth}"
										   Height="3" Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center"
										   Fill="{StaticResource Slider.Background.Filled.Static}"/>

								<Track x:Name="PART_Track">
									<Track.DecreaseRepeatButton>
										<RepeatButton x:Name="TrackLeft"
													  Style="{StaticResource SliderButtonHorizontal}"
													  Command="{x:Static Slider.DecreaseLarge}"/>
									</Track.DecreaseRepeatButton>
									<Track.IncreaseRepeatButton>
										<RepeatButton x:Name="TrackRight"
													  Style="{StaticResource SliderButtonHorizontal}"
													  Command="{x:Static Slider.IncreaseLarge}"/>
									</Track.IncreaseRepeatButton>
									<Track.Thumb>
										<Thumb x:Name="thumb"
											   Width="15" Height="{DynamicResource ThumbHeight}"
											   Style="{StaticResource SliderThumbHorizontal}"/>
									</Track.Thumb>
								</Track>
							</Grid>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsUnison" Value="True">
								<Setter Property="Background" TargetName="thumb" Value="{StaticResource App.Foreground.Shadow}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- Pulse Label -->
		<Style x:Key="PulseLabelStyle" TargetType="{x:Type controls:PulseLabel}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type controls:PulseLabel}">
						<Grid>
							<Border>
								<TextBlock HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
										   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
										   Text="{TemplateBinding ContentPresenter.Content}">
									<TextBlock.Foreground>
										<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
											<GradientStop x:Name="head" Color="{StaticResource App.ForegroundColor}" Offset="0.0"/>
											<GradientStop x:Name="middle" Color="{StaticResource App.ForegroundColor}" Offset="0.0"/>
											<GradientStop x:Name="tail" Color="{StaticResource App.ForegroundColor}" Offset="0.0"/>
										</LinearGradientBrush>
									</TextBlock.Foreground>
								</TextBlock>
							</Border>

							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup Name="PulseStates">
									<VisualState x:Name="Off"/>
									<VisualState x:Name="On">
										<Storyboard>
											<ColorAnimation Storyboard.TargetName="middle"
															Storyboard.TargetProperty="(GradientStop.Color)"
															Duration="0"
															To="{StaticResource App.ShadowColor}"/>
											<DoubleAnimation Storyboard.TargetName="head"
															 Storyboard.TargetProperty="(GradientStop.Offset)"
															 Duration="0:0:1.2"
															 From="0.0" To="1.8"
															 RepeatBehavior="Forever"/>
											<DoubleAnimation Storyboard.TargetName="middle"
															 Storyboard.TargetProperty="(GradientStop.Offset)"
															 Duration="0:0:1.2"
															 From="-0.4" To="1.4"
															 RepeatBehavior="Forever"/>
											<DoubleAnimation Storyboard.TargetName="tail"
															 Storyboard.TargetProperty="(GradientStop.Offset)"
															 Duration="0:0:1.2"
															 From="-0.8" To="1.0"
															 RepeatBehavior="Forever"/>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- Name TextBox -->
		<Style x:Key="NameTextBoxStyle" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
			<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
			<Setter Property="CaretBrush" Value="{StaticResource App.Foreground}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TextBox}">
						<Border x:Name="border"
								BorderBrush="Transparent" BorderThickness="1"
								Background="Transparent"
								SnapsToDevicePixels="True">
							<ScrollViewer x:Name="PART_ContentHost"
										  VerticalScrollBarVisibility="Hidden"
										  Focusable="False"/>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsReadOnly" Value="False">
								<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Text.Border.Writable}"/>
								<Setter Property="Background" TargetName="border" Value="{StaticResource Text.Background.Writable}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- Brightness Button -->
		<Style x:Key="BrightnessButtonStyle" TargetType="{x:Type Button}">
			<Setter Property="Focusable" Value="False"/>
			<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<Grid x:Name="base">
								<Grid.Background>
									<SolidColorBrush Color="{StaticResource Access.Background.NormalColor}"/>
								</Grid.Background>
								<Border x:Name="border"
										BorderThickness="2">
									<Border.BorderBrush>
										<SolidColorBrush Color="{StaticResource Access.Border.NormalColor}"/>
									</Border.BorderBrush>
									<ContentPresenter Content="{TemplateBinding Content}"/>
								</Border>
							</Grid>

							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver">
										<Storyboard>
											<ColorAnimation Storyboard.TargetName="border"
															Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
															Duration="0"
															To="{StaticResource Access.Border.MouseOverColor}"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Storyboard.TargetName="base"
															Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
															Duration="0"
															To="{StaticResource Access.Background.PressedColor}"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<!-- Unison Button -->
		<Style x:Key="UnisonButtonStyle" TargetType="{x:Type ToggleButton}">
			<Setter Property="Focusable" Value="False"/>
			<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Grid>
							<Grid x:Name="base">
								<Grid.Background>
									<SolidColorBrush Color="{StaticResource Access.Background.NormalColor}"/>
								</Grid.Background>
								<Border x:Name="border"
										BorderThickness="2">
									<Border.BorderBrush>
										<SolidColorBrush Color="{StaticResource Access.Border.NormalColor}"/>
									</Border.BorderBrush>
									<Grid Height="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}"
										  Margin="2" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
										  RenderOptions.EdgeMode="Aliased">
										<Path x:Name="horizontalLine"
											  Data="M 0,0 1,0" Stretch="Uniform"
											  Stroke="{TemplateBinding Foreground}" StrokeThickness="1"/>
										<Path x:Name="verticalLine"
											  Data="M 0,0 0,1" Stretch="Uniform"
											  Stroke="{TemplateBinding Foreground}" StrokeThickness="1"
											  Opacity="1"/>
									</Grid>
								</Border>
							</Grid>

							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver">
										<Storyboard>
											<ColorAnimation Storyboard.TargetName="border"
															Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
															Duration="0"
															To="{StaticResource Access.Border.MouseOverColor}"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Storyboard.TargetName="base"
															Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
															Duration="0"
															To="{StaticResource Access.Background.PressedColor}"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="CheckStates">
									<VisualState x:Name="Checked">
										<Storyboard>
											<DoubleAnimation Storyboard.TargetName="verticalLine"
															 Storyboard.TargetProperty="(UIElement.Opacity)"
															 Duration="0"
															 To="0"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Unchecked"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>

	<Grid Width="360">
		<!-- Pulse -->
		<controls:PulseLabel Margin="6,4"
							 Style="{StaticResource PulseLabelStyle}"
							 Content="{Binding Source={x:Static models:ProductInfo.Title}, Mode=OneTime}"
							 IsPulsing="{Binding IsScanning, Mode=OneWay}"
							 Visibility="{Binding IsMonitorsEmpty, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverterKey}}"/>

		<!-- Monitors-->
		<ListView ItemsSource="{Binding MonitorsView}"
				  SelectionMode="Single">
			<ListView.Template>
				<ControlTemplate TargetType="{x:Type ListView}">
					<Border BorderThickness="0">
						<ScrollViewer CanContentScroll="False"
									  HorizontalScrollBarVisibility="Disabled"
									  VerticalScrollBarVisibility="Auto">
							<VirtualizingStackPanel IsItemsHost="True"/>
						</ScrollViewer>
					</Border>
				</ControlTemplate>
			</ListView.Template>
			<ListView.ItemTemplate>
				<DataTemplate>
					<Grid Background="Transparent">
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>

						<!-- Name -->
						<controls:SwitchTextBox Grid.Row="0"
												Margin="6,5,2,5" HorizontalAlignment="Left" VerticalAlignment="Center"
												Style="{StaticResource NameTextBoxStyle}"
												TextWrapping="Wrap" MaxLength="96"
												Text="{Binding Name, Mode=TwoWay}"/>

						<!-- Brightness -->
						<Grid Grid.Row="1"
							  x:Name="BrightnessBox"
							  Margin="0,0,0,6"
							  Visibility="{Binding IsControllable, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverterKey}}">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="3"/>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="4"/>
							</Grid.ColumnDefinitions>

							<Rectangle Grid.Column="0"
									   Fill="{StaticResource App.Background.Accent}"
									   Visibility="{Binding IsSelectedByKey, Converter={StaticResource BooleanToVisibilityConverterKey}}"/>

							<Button Grid.Column="1"
									Width="80" Height="{DynamicResource ButtonHeight}" Margin="3,0,0,0"
									Style="{StaticResource BrightnessButtonStyle}">
								<TextBlock Margin="2" HorizontalAlignment="Left" VerticalAlignment="Bottom"
										   Text="{Binding Brightness, Mode=OneWay, StringFormat={}{0}%}"/>
								<i:Interaction.Triggers>
									<i:EventTrigger EventName="Click">
										<behaviors:MouseDownParentAction/>
										<i:CallMethodAction TargetObject="{Binding}"
															MethodName="IncrementBrightness"/>
									</i:EventTrigger>
								</i:Interaction.Triggers>
							</Button>

							<controls:CompoundSlider Grid.Column="2"
													 Margin="8,0,6,0" VerticalAlignment="Center"
													 Style="{StaticResource SliderHorizontal}"
													 AutoToolTipPlacement="TopLeft"
													 Minimum="0" Maximum="100"
													 Value="{Binding Brightness, Mode=TwoWay, Delay=50}"
													 IsShadowVisible="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Settings.ShowsAdjusted}"
													 ValueShadow="{Binding BrightnessSystemAdjusted, Mode=OneWay}"
													 IsUnison="{Binding IsUnison, Mode=TwoWay}"
													 ValueUnison="{Binding BrightnessSystemChanged, Mode=OneWay}">
								<i:Interaction.Behaviors>
									<behaviors:ItemSliderBehavior IsSelected="{Binding IsSelected, Mode=OneWay}"
																  IsByKey="{Binding IsByKey, Mode=TwoWay}"/>
								</i:Interaction.Behaviors>
							</controls:CompoundSlider>

							<ToggleButton Grid.Column="3"
										  Width="16" Height="{DynamicResource ButtonHeight}" Margin="0,0,2,0"
										  Style="{StaticResource UnisonButtonStyle}"
										  VerticalContentAlignment="Bottom"
										  IsChecked="{Binding IsUnison, Mode=TwoWay}"
										  Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Settings.EnablesUnison, Converter={StaticResource BooleanToVisibilityConverterKey}}"/>
						</Grid>

						<!-- Alternative -->
						<Grid Grid.Row="1"
							  Visibility="{Binding ElementName=BrightnessBox, Path=Visibility, Mode=OneWay, Converter={StaticResource VisibilityInverseConverterKey}}">
							<Border Margin="6,4"
									Padding="3"
									BorderThickness="1"
									BorderBrush="{StaticResource App.Foreground.Invalid}">
								<TextBlock Foreground="{StaticResource App.Foreground.Invalid}"
										   Text="{x:Static properties:Resources.NotControllable}"/>
							</Border>
						</Grid>
					</Grid>
				</DataTemplate>
			</ListView.ItemTemplate>
			<ListView.ItemContainerStyle>
				<Style TargetType="{x:Type ListViewItem}">
					<Setter Property="OverridesDefaultStyle" Value="True"/>
					<Setter Property="Margin" Value="0"/>
					<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
					<Setter Property="Template">
						<Setter.Value>
							<ControlTemplate TargetType="{x:Type ContentControl}">
								<ContentPresenter/>
							</ControlTemplate>
						</Setter.Value>
					</Setter>
				</Style>
			</ListView.ItemContainerStyle>

			<i:Interaction.Behaviors>
				<behaviors:ItemSelectorBehavior/>
			</i:Interaction.Behaviors>
		</ListView>
	</Grid>
</Window>
{'fraction_non_alphanumeric': 0.1330306469920545, 'fraction_numerical': 0.008036322360953462, 'mean_word_length': 2.6139962261055047, 'pattern_counts': {'":': 0, '<': 706, '<?xml version=': 0, '>': 706, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5206808', 'n_tokens_mistral': 19302, 'n_tokens_neox': 12279, 'n_words': 1763}