- modificato stile slider

- modificato TFSEditor
This commit is contained in:
Emmanuele Sassi
2023-01-09 15:38:10 +01:00
parent a52227b1ea
commit 0be02be5f7
19 changed files with 817 additions and 115 deletions
@@ -7,7 +7,6 @@
Margin="5,0,0,0">
<Grid.Resources>
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
</Grid.Resources>
@@ -307,26 +307,6 @@ Public Class DispositionPanelVM
End Class
Public Class CenterToolTipConverter
Implements IMultiValueConverter
Public Function Convert(ByVal values As Object(), ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
For Each value In values
If TypeOf (value) IsNot Double Then
Return Double.NaN
End If
Next
Dim placementTargetHeight As Double = CDbl(values(0))
Dim toolTipHeight As Double = CDbl(values(1))
Return (placementTargetHeight / 2.0) - (toolTipHeight / 2.0)
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetTypes As Type(), ByVal parameter As Object, ByVal culture As CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
Throw New NotSupportedException()
End Function
End Class
Public Class FromBooleanToVisibility
Implements IValueConverter
+5
View File
@@ -681,6 +681,11 @@
<ItemGroup>
<Resource Include="Resources\TFSEditor\Expand.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SliderManager\FromSelected.png" />
<Resource Include="Resources\SliderManager\OnlySelected.png" />
<Resource Include="Resources\SliderManager\UntilSelected.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR32.exe
+22 -9
View File
@@ -7,8 +7,7 @@
<PrintApp:TopPanelV Grid.Column="1"
DataContext="{StaticResource TopPanelVM }"/>
</Grid>
<Grid DockPanel.Dock="Bottom"
Height="67">
<Grid DockPanel.Dock="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="315"/>
<ColumnDefinition Width="1*"/>
@@ -18,32 +17,46 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="315"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="67"/>
</Grid.RowDefinitions>
<PrintApp:LayerAdvancementSliderV Grid.Column="2"
Grid.ColumnSpan="3"
DockPanel.Dock="Bottom"
DataContext="{StaticResource SliderManagerVM}"
HorizontalAlignment="Stretch"/>
<!--StatusBar -->
<PrintApp:ControllerInputPanelV Grid.ColumnSpan="2"
<PrintApp:ControllerInputPanelV Grid.Row="1"
Grid.ColumnSpan="2"
DataContext="{StaticResource ControllerInputPanelVM}"
HorizontalAlignment="Center"/>
<PrintApp:ShowPanelV Grid.Column="2"
Grid.Row="1"
DataContext="{StaticResource ShowPanelVM}"/>
<PrintApp:ViewPanelV Grid.Column="3"
Grid.Row="1"
DataContext="{StaticResource ViewPanelVM}"/>
<PrintApp:InstrumentPanelV Grid.Column="4"
Grid.Row="1"
DataContext="{StaticResource InstrumentPanelVM}"/>
<PrintApp:StatusBarV Grid.Column="6"
Grid.Row="1"
DataContext="{StaticResource StatusBarVM}"/>
</Grid>
<DockPanel DockPanel.Dock="Bottom"
<!--<DockPanel DockPanel.Dock="Bottom"
LastChildFill="False">
<PrintApp:LayerAdvancementSliderV DockPanel.Dock="Bottom"
DataContext="{StaticResource SliderManagerVM}"
HorizontalAlignment="Center"/>
<!--<Grid DockPanel.Dock="Bottom"
--><!--<Grid DockPanel.Dock="Bottom"
HorizontalAlignment="Stretch">
<PrintApp:ControllerInputPanelV Grid.Column="3"
DataContext="{StaticResource ControllerInputPanelVM}"
HorizontalAlignment="Center"/>
</Grid>-->
</DockPanel>
</Grid>--><!--
</DockPanel>-->
<Grid DockPanel.Dock="Left">
@@ -72,9 +85,9 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="40"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.ColumnSpan="2"
Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

-1
View File
@@ -5,7 +5,6 @@
xmlns:PrintApp="clr-namespace:Icarus"
Margin="5">
<Grid.Resources>
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
</Grid.Resources>
<Grid.ColumnDefinitions>
+4 -2
View File
@@ -3,10 +3,12 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:PrintApp="clr-namespace:Icarus"
Margin="5">
Margin="5,0,5,0">
<TabControl SelectedIndex="{Binding SelPanel}"
Background="Transparent"
BorderThickness="0">
BorderThickness="0"
Margin="0"
Padding="0">
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/>
@@ -5,7 +5,6 @@
xmlns:PrintApp="clr-namespace:Icarus"
Margin="5">
<Grid.Resources>
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
</Grid.Resources>
<Grid.ColumnDefinitions>
@@ -22,5 +22,26 @@
End Set
End Property
Public Shared ReadOnly ValueIndexProperty As DependencyProperty = DependencyProperty.Register("ValueIndex", GetType(String), GetType(ShowValueSlider), New FrameworkPropertyMetadata(""))
Public Shadows Property ValueIndex As String
Get
Return CStr(MyBase.GetValue(ValueIndexProperty))
End Get
Set(value As String)
MyBase.SetValue(ValueIndexProperty, value)
End Set
End Property
Public Shared ReadOnly ValueHeightProperty As DependencyProperty = DependencyProperty.Register("ValueHeight", GetType(String), GetType(ShowValueSlider), New FrameworkPropertyMetadata(""))
Public Shadows Property ValueHeight As String
Get
Return CStr(MyBase.GetValue(ValueHeightProperty))
End Get
Set(value As String)
MyBase.SetValue(ValueHeightProperty, value)
End Set
End Property
End Class
@@ -1,12 +1,14 @@
<Slider x:Class="LayerAdvancementSliderV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400"
Value="{Binding dLayerAdvancement}"
Minimum="0"
Maximum="100"
SmallChange="1"
TickPlacement="TopLeft"
TickFrequency="5"
IsEnabled="{Binding LayerAdvancement_IsEnabled}"
Visibility="{Binding LayerAdvancement_Visibility}"
Margin="0,10,0,10"/>
Margin="0,10,0,10"
Style="{StaticResource LayerIndex_Slider}"/>
+51 -12
View File
@@ -4,28 +4,67 @@
xmlns:Icarus="clr-namespace:Icarus"
IsEnabled="{Binding LayerIndex_IsEnabled}"
Visibility="{Binding LayerIndex_Visibility}">
<Grid VerticalAlignment="Center">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="20"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="View Slider"
HorizontalAlignment="Center"/>
<ComboBox Grid.Row="1"
ItemsSource="{Binding ViewSliderList}"
SelectedIndex="{Binding ghSelViewSlider}"
Width="100"/>
<ComboBox SelectedIndex="{Binding ghSelViewSlider}"
Height="40"
Width="40"
Style="{StaticResource SelViewSlider_ComboBox}">
<ComboBoxItem>
<Image Source="\Resources\SliderManager\FromSelected.png"
Style="{StaticResource ComboBox.Image}"/>
</ComboBoxItem>
<ComboBoxItem>
<Image Source="\Resources\SliderManager\OnlySelected.png"
Style="{StaticResource ComboBox.Image}"/>
</ComboBoxItem>
<ComboBoxItem>
<Image Source="\Resources\SliderManager\UntilSelected.png"
Style="{StaticResource ComboBox.Image}"/>
</ComboBoxItem>
</ComboBox>
<Grid Grid.Row="1"
Margin="0,5,0,5"
HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ghMaximumIndex}"
HorizontalAlignment="Center"
Style="{StaticResource BaseTextBlock}"/>
<Border Grid.Row="1"
Height="2"
Background="{StaticResource Icarus_Gray}"
BorderBrush="{StaticResource Icarus_Gray}"
BorderThickness="0"
Padding="0"
Visibility="{Binding Height_Visibility}"/>
<TextBlock Grid.Row="2"
Text="{Binding ghMaximumHeight}"
Visibility="{Binding Height_Visibility}"
HorizontalAlignment="Center"
Style="{StaticResource BaseTextBlock}"/>
</Grid>
<Icarus:ShowValueSlider Grid.Row="3"
Orientation="Vertical"
Height="400"
Value="{Binding nLayerIndex}"
Minimum="{Binding nLayerIndex_Minimum}"
Maximum="{Binding nLayerIndex_Maximum}"
ShowValue="{Binding ghShowValue}"
ShowMaximum="{Binding ghShowMaximum}"
ValueIndex="{Binding ghValueIndex}"
ValueHeight="{Binding ghValueHeight}"
SmallChange="1"
TickPlacement="TopLeft"
TickFrequency="{Binding nLayerIndex_TickFrequency}"
HorizontalAlignment="Right"
Style="{StaticResource LayerIndex_Slider}"/>
</Grid>
+68 -17
View File
@@ -8,9 +8,9 @@ Public Class SliderManagerVM
Public Enum ViewSliderType As Integer
NULL = 0
ONLY_SELECTED = 1
UNTIL_SELECTED = 2
FROM_SELECTED = 3
FROM_SELECTED = 1
ONLY_SELECTED = 2
UNTIL_SELECTED = 3
End Enum
Private m_nLayerIndex As Integer = 0
@@ -65,6 +65,8 @@ Public Class SliderManagerVM
m_nLayerIndex = value
End Select
NotifyPropertyChanged(NameOf(ghShowValue))
NotifyPropertyChanged(NameOf(ghValueIndex))
NotifyPropertyChanged(NameOf(ghValueHeight))
EgtDraw()
End Set
End Property
@@ -83,8 +85,6 @@ Public Class SliderManagerVM
Next
End If
m_nLayerIndex = value
NotifyPropertyChanged(NameOf(ghShowValue))
EgtDraw()
Case ViewSliderType.UNTIL_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
@@ -98,8 +98,6 @@ Public Class SliderManagerVM
Next
End If
m_nLayerIndex = value
NotifyPropertyChanged(NameOf(ghShowValue))
EgtDraw()
Case ViewSliderType.FROM_SELECTED
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
' riporto vecchio strato a visualizzazione di tutti i solidi
@@ -113,10 +111,12 @@ Public Class SliderManagerVM
Next
End If
m_nLayerIndex = value
NotifyPropertyChanged(NameOf(ghShowValue))
EgtDraw()
End Select
NotifyPropertyChanged(NameOf(nLayerIndex))
NotifyPropertyChanged(NameOf(ghShowValue))
NotifyPropertyChanged(NameOf(ghValueIndex))
NotifyPropertyChanged(NameOf(ghValueHeight))
EgtDraw()
End Sub
Public ReadOnly Property ghShowValue As String
@@ -134,9 +134,55 @@ Public Class SliderManagerVM
End Get
End Property
Public ReadOnly Property ghValueIndex As String
Get
Return m_nLayerIndex
End Get
End Property
Public ReadOnly Property ghValueHeight As String
Get
If IsNothing(Map.refTopPanelVM.CurrMachining) OrElse
Map.refTopPanelVM.CurrMachining.dCurrSlicingType = Machining.MPAR_SLICINGTYPE.DEG45 OrElse
Map.refTopPanelVM.CurrMachining.dCurrSlicingType = Machining.MPAR_SLICINGTYPE.DEG45_Y Then
Return ""
Else
Return DoubleToString(m_nLayerIndex * Map.refTopPanelVM.CurrMachining.dCurrStrandH, 0)
End If
End Get
End Property
Public ReadOnly Property ghMaximumIndex As String
Get
Return m_nLayerIndex_Maximum
End Get
End Property
Public ReadOnly Property ghMaximumHeight As String
Get
If IsNothing(Map.refTopPanelVM.CurrMachining) OrElse
Map.refTopPanelVM.CurrMachining.dCurrSlicingType = Machining.MPAR_SLICINGTYPE.DEG45 OrElse
Map.refTopPanelVM.CurrMachining.dCurrSlicingType = Machining.MPAR_SLICINGTYPE.DEG45_Y Then
Return ""
Else
Return DoubleToString(m_nLayerIndex_Maximum * Map.refTopPanelVM.CurrMachining.dCurrStrandH, 0)
End If
End Get
End Property
Public ReadOnly Property Height_Visibility As Visibility
Get
If IsNothing(Map.refTopPanelVM.CurrMachining) Then
Return Visibility.Collapsed
Else
Return If(Map.refTopPanelVM.CurrMachining.dCurrSlicingType = Machining.MPAR_SLICINGTYPE.DEG45 OrElse
Map.refTopPanelVM.CurrMachining.dCurrSlicingType = Machining.MPAR_SLICINGTYPE.DEG45_Y, Visibility.Collapsed, Visibility.Visible)
End If
End Get
End Property
Public ReadOnly Property ghShowMaximum As String
Get
Dim dH As Double = 0
If Not IsNothing(Map.refTopPanelVM.CurrMachining) Then
If Map.refTopPanelVM.CurrMachining.dCurrSlicingType = Machining.MPAR_SLICINGTYPE.DEG45 Then
Return m_nLayerIndex_Maximum
@@ -251,6 +297,13 @@ Public Class SliderManagerVM
NotifyPropertyChanged(NameOf(LayerAdvancement_IsEnabled))
End Sub
Private m_nLayerIndex_TickFrequency As Double
Public ReadOnly Property nLayerIndex_TickFrequency As Double
Get
Return If(m_nLayerIndex_Maximum > 0, m_nLayerIndex_Maximum / 100, m_nLayerIndex_Maximum)
End Get
End Property
Private m_nLayerIndex_Minimum As Double
Public Property nLayerIndex_Minimum As Double
Get
@@ -268,16 +321,10 @@ Public Class SliderManagerVM
End Get
Set(value As Double)
m_nLayerIndex_Maximum = value
NotifyPropertyChanged(NameOf(nLayerIndex_TickFrequency))
End Set
End Property
Private m_ViewSliderList As New List(Of String)({"Only Selected", "Till Selected", "From Selected"})
Public ReadOnly Property ViewSliderList As List(Of String)
Get
Return m_ViewSliderList
End Get
End Property
Private m_nSelViewSlider As ViewSliderType
Public Property ghSelViewSlider As Integer
Get
@@ -358,6 +405,10 @@ Public Class SliderManagerVM
m_nLayerIndex_Maximum = nMax
NotifyPropertyChanged(NameOf(nLayerIndex_Minimum))
NotifyPropertyChanged(NameOf(nLayerIndex_Maximum))
NotifyPropertyChanged(NameOf(nLayerIndex_TickFrequency))
NotifyPropertyChanged(NameOf(ghMaximumHeight))
NotifyPropertyChanged(NameOf(ghMaximumIndex))
NotifyPropertyChanged(NameOf(Height_Visibility))
NotifyPropertyChanged(NameOf(ghShowMaximum))
SetLayerIndex(If(m_nLayerIndex < nMax, m_nLayerIndex, nMax))
End Sub
@@ -5,7 +5,6 @@
xmlns:PrintApp="clr-namespace:Icarus"
Margin="5">
<Grid.Resources>
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
</Grid.Resources>
<Grid.ColumnDefinitions>
+10 -3
View File
@@ -26,11 +26,16 @@
</Grid.RowDefinitions>
<ContentControl x:Name="TFSEditorStackPanel">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal"
<StackPanel Grid.ColumnSpan="2"
Orientation="Horizontal"
HorizontalAlignment="Center"
Margin="0,2.5,0,2.5">
<TextBlock Text="Modify"
@@ -71,10 +76,12 @@
Margin="2.5,0,0,0"
Style="{StaticResource RightPanel_Button}"/>
</StackPanel>
<Button Grid.Row="1"
<Button Grid.Column="1"
Grid.RowSpan="2"
Content="Reset"
Command="{Binding Reset_Command}"
HorizontalAlignment="Right"
Height="45"
Width="45"
Margin="0,2.5,5,2.5"
Style="{StaticResource RightPanel_Button}"/>
</Grid>
+2 -2
View File
@@ -746,9 +746,9 @@ Public Class TFSLayer
If m_bFCurr_IsModified OrElse m_bTWait_IsModified Then
Return Brushes.Black
ElseIf m_dSpeed <= Map.refTFSEditorVM.dSpeedMin OrElse m_dSpeed >= Map.refTFSEditorVM.dSpeedMax Then
Return Brushes.White
Return New BrushConverter().ConvertFrom("#402918")
Else
Return Brushes.Black
Return Brushes.White
End If
End Get
End Property
+607 -43
View File
@@ -134,7 +134,7 @@
<SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
<SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
<SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
<ControlTemplate x:Key="Button.HalfRoundButton" TargetType="{x:Type Button}">
<Border x:Name="border" CornerRadius="4,4,0,0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
@@ -933,7 +933,7 @@
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- TopLevelItem -->
<ControlTemplate x:Key="{x:Static MenuItem.TopLevelItemTemplateKey}" TargetType="MenuItem">
<Border Name="Border">
@@ -1197,7 +1197,7 @@
<Setter Property="Padding" Value="0,0,0,0"/>
<Setter Property="Margin" Value="0,0,0,0"/>
</Style>
<Style x:Key="TopPanel_Border" TargetType="{x:Type Border}">
<Setter Property="Background" Value="White" />
<Setter Property="BorderBrush" Value="White"/>
@@ -1237,7 +1237,7 @@
<Setter Property="CornerRadius" Value="4" />
<Setter Property="Padding" Value="5" />
</Style>
<Style x:Key="StatusBar_Border" TargetType="Border">
<Setter Property="Background" Value="White" />
<Setter Property="BorderBrush" Value="White" />
@@ -1758,17 +1758,6 @@
</Style.Triggers>
</Style>
<!--<Style TargetType="{x:Type ComboBox}">
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontFamily" Value="/Resources/Fonts/#Roboto"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>-->
<Style x:Key="MachiningsComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
<Setter Property="Margin" Value="0,0,0,10"/>
</Style>
@@ -1808,7 +1797,7 @@
<Setter Property="Width" Value="125"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
<Style x:Key="RightPanel_ComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
<Setter Property="BorderBrush" Value="{StaticResource Icarus_Gray}"/>
<Setter Property="BorderThickness" Value="1"/>
@@ -1817,6 +1806,186 @@
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
<!--SelViewSlider_ComboBox-->
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
<SolidColorBrush x:Key="SelViewSlider_ComboBox.Popup.Background" Color="#92908d"/>
<SolidColorBrush x:Key="SelViewSlider_ComboBox.Popup.Border" Color="White"/>
<SolidColorBrush x:Key="SelViewSlider_ComboBox.Static.Background" Color="#92908d"/>
<SolidColorBrush x:Key="SelViewSlider_ComboBox.Static.Border" Color="White"/>
<SolidColorBrush x:Key="SelViewSlider_ComboBox.Static.Glyph" Color="#FF606060"/>
<Style x:Key="SelViewSlider_ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="ClickMode" Value="Press"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border x:Name="templateRoot"
Background="{StaticResource SelViewSlider_ComboBox.Static.Background}"
BorderBrush="{StaticResource SelViewSlider_ComboBox.Static.Border}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="true">
</Border>
<ControlTemplate.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="false"/>
<Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="false"/>
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="true"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Static.Editable.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Static.Editable.Border}"/>
</MultiDataTrigger>
<Trigger Property="IsMouseOver" Value="true">
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Border}"/>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Border}"/>
</MultiDataTrigger>
<Trigger Property="IsPressed" Value="true">
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Border}"/>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Editable.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Editable.Border}"/>
</MultiDataTrigger>
<Trigger Property="IsEnabled" Value="false">
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Border}"/>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Background}"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Border}"/>
</MultiDataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ControlTemplate x:Key="SelViewSlider_ComboBoxTemplate" TargetType="{x:Type ComboBox}">
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
<Popup x:Name="PART_Popup"
AllowsTransparency="true"
IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Margin="1"
PlacementTarget="{Binding ElementName=toggleButton}"
Placement="Center"
PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
<!--<Popup.HorizontalOffset>
<MultiBinding Converter="{StaticResource CenterToolTipConverter}">
<Binding RelativeSource="{RelativeSource Self}" Path="PlacementTarget.ActualWidth"/>
<Binding RelativeSource="{RelativeSource Self}" Path="Child.ActualWidth"/>
</MultiBinding>
</Popup.HorizontalOffset>-->
<Border x:Name="dropDownBorder"
MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
Background="{StaticResource SelViewSlider_ComboBox.Popup.Background}"
BorderBrush="{StaticResource SelViewSlider_ComboBox.Popup.Border}"
BorderThickness="1">
<ScrollViewer x:Name="DropDownScrollViewer">
<Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
<Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
<Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
</Canvas>
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Grid>
</ScrollViewer>
</Border>
</Popup>
<ToggleButton x:Name="toggleButton"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style="{StaticResource SelViewSlider_ComboBoxToggleButton}"/>
<ContentPresenter x:Name="contentPresenter"
ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
IsHitTestVisible="false"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasItems" Value="false">
<Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsGrouping" Value="true"/>
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</MultiTrigger>
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
<Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
<Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="SelViewSlider_ComboBox" TargetType="{x:Type ComboBox}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Background" Value="{StaticResource SelViewSlider_ComboBox.Static.Background}"/>
<Setter Property="BorderBrush" Value="{StaticResource SelViewSlider_ComboBox.Static.Border}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="Padding" Value="2"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="Template" Value="{StaticResource SelViewSlider_ComboBoxTemplate}"/>
</Style>
<Style x:Key="ComboBox.Image" TargetType="{x:Type Image}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
<Setter Property="Stretch" Value="Uniform"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- ScrollBar -->
@@ -2335,7 +2504,7 @@
<Setter Property="RowHeight" Value="24"/>
<Setter Property="HeadersVisibility" Value="Column"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- CheckBox with text on the left -->
@@ -2357,8 +2526,6 @@
<!-- Popup -->
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
<Style x:Key="LeftPanel_Popup" TargetType="Popup">
<Setter Property="AllowsTransparency" Value="True" />
<Setter Property="StaysOpen" Value="True" />
@@ -2401,7 +2568,7 @@
<!-- Layer Slider -->
<SolidColorBrush x:Key="SliderThumb.Static.Foreground" Color="#FFE5E5E5"/>
<!--<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"/>
@@ -2572,24 +2739,24 @@
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="SliderThumbVerticalDefault" TargetType="{x:Type Thumb}">
<Grid HorizontalAlignment="Right" VerticalAlignment="Top">
<Canvas>
<Grid Canvas.Top="-8" Canvas.Right="0" HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border Height="25"
<Grid HorizontalAlignment="Right" VerticalAlignment="Top">
<Canvas>
<Grid Canvas.Top="-8" Canvas.Right="0" HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border Height="25"
Padding="3,0"
Style="{StaticResource RightPanel_Border}">
<TextBlock HorizontalAlignment="Center"
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Black"
Text="{Binding ShowValue, RelativeSource={RelativeSource AncestorType={x:Type Slider}}}"/>
</Border>
<Ellipse x:Name="grip" Grid.Column="2" Height="18" Width="18" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" Stroke="{StaticResource SliderThumb.Static.Border}"/>
</Grid>
</Border>
<Ellipse x:Name="grip" Grid.Column="2" Height="18" Width="18" Fill="{StaticResource SliderThumb.Static.Background}" Stretch="Fill" Stroke="{StaticResource SliderThumb.Static.Border}"/>
</Grid>
</Canvas>
</Grid>
<ControlTemplate.Triggers>
@@ -2610,27 +2777,27 @@
<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.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1"
<TextBlock Grid.Column="1"
Foreground="Black"
Text="{Binding ShowMaximum, RelativeSource={RelativeSource AncestorType={x:Type Slider}}}"/>
<TickBar x:Name="TopTick" Grid.Column="0" Grid.Row="2" Fill="{TemplateBinding Foreground}" Margin="0,0,2,0" Placement="Left" Visibility="Collapsed" Width="4"/>
<TickBar x:Name="BottomTick" Grid.Column="2" Grid.Row="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" Grid.Row="2" HorizontalAlignment="center" Margin="0,5" Width="4.0">
<TickBar x:Name="TopTick" Grid.Column="0" Grid.Row="2" Fill="{TemplateBinding Foreground}" Margin="0,0,2,0" Placement="Left" Visibility="Collapsed" Width="4"/>
<TickBar x:Name="BottomTick" Grid.Column="2" Grid.Row="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" Grid.Row="2" 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="4.0"/>
</Canvas>
</Border>
<Track x:Name="PART_Track" Grid.Column="1" Grid.Row="2">
<Track x:Name="PART_Track" Grid.Column="1" Grid.Row="2">
<Track.DecreaseRepeatButton>
<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource RepeatButtonTransparent}"/>
</Track.DecreaseRepeatButton>
@@ -2666,6 +2833,403 @@
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="LayerIndex_Slider" 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>-->
<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>
<SolidColorBrush x:Key="SliderThumb.Static.Background" Color="#2e5a81"/>
<SolidColorBrush x:Key="SliderThumb.Static.Border" Color="#2e5a81"/>
<SolidColorBrush x:Key="SliderThumb.Static.Foreground" Color="#92908d"/>
<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.Track.Background" Color="White"/>
<SolidColorBrush x:Key="SliderThumb.Track.Border" Color="White"/>
<SolidColorBrush x:Key="SliderThumb.TickBar.Background" Color="#D0D6DF"/>
<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}" Stroke="{StaticResource SliderThumb.Static.Border}" SnapsToDevicePixels="True" Stretch="Fill" 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="SliderThumbHorizontalTop" TargetType="{x:Type Thumb}">
<Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
<Ellipse x:Name="grip"
Height="18" Width="18"
HorizontalAlignment="Center"
Fill="{StaticResource SliderThumb.Static.Background}"
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="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}" Stroke="{StaticResource SliderThumb.Static.Border}" SnapsToDevicePixels="True" Stretch="Fill" 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"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="True">
<Grid>
<Grid VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border x:Name="TopTick_Border"
Background="{StaticResource SliderThumb.TickBar.Background}"
BorderThickness="0"
Visibility="Collapsed">
<TickBar x:Name="TopTick"
Fill="{TemplateBinding Foreground}"
Height="4"
Placement="Top"
Visibility="Collapsed"/>
</Border>
<Border x:Name="BottomTick_Border"
Grid.Row="2"
Background="{StaticResource SliderThumb.TickBar.Background}"
BorderThickness="0"
Visibility="Collapsed">
<TickBar x:Name="BottomTick"
Fill="{TemplateBinding Foreground}"
Height="4"
Placement="Bottom"
Visibility="Collapsed"/>
</Border>
<Border x:Name="TrackBackground"
Background="{StaticResource SliderThumb.Track.Background}"
BorderBrush="{StaticResource SliderThumb.Track.Border}"
BorderThickness="1"
Height="4.0"
Margin="0"
Padding="0"
Grid.Row="1"
VerticalAlignment="Center">
<Canvas>
<Rectangle x:Name="PART_SelectionRange"
Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
Height="4.0"
Visibility="Hidden"/>
</Canvas>
</Border>
</Grid>
<Track x:Name="PART_Track">
<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="18"/>
</Track.Thumb>
</Track>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="TickPlacement" Value="TopLeft">
<Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
<Setter Property="Visibility" TargetName="TopTick_Border" Value="Visible"/>
<Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbHorizontalTop}"/>
</Trigger>
<Trigger Property="TickPlacement" Value="BottomRight">
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
<Setter Property="Visibility" TargetName="BottomTick_Border" Value="Visible"/>
<Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbHorizontalBottom}"/>
</Trigger>
<Trigger Property="TickPlacement" Value="Both">
<Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
<Setter Property="Visibility" TargetName="TopTick_Border" Value="Visible"/>
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
<Setter Property="Visibility" TargetName="BottomTick_Border" 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="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}"
Stroke="{StaticResource SliderThumb.Static.Border}"
Stretch="Fill"/>
<Ellipse Height="5" Width="5"
Fill="{StaticResource SliderThumb.Static.Background}"
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="SliderThumbVerticalLeft" TargetType="{x:Type Thumb}">
<Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center">
<Canvas Width="{Binding ActualWidth, ElementName=GridCanvas}"
Height="{Binding ActualHeight, ElementName=GridCanvas}"
HorizontalAlignment="Right"
VerticalAlignment="Center">
<Grid x:Name="GridCanvas"
Canvas.Right="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ValueIndex, RelativeSource={RelativeSource AncestorType={x:Type Slider}}}"
Foreground="{StaticResource SliderThumb.Static.Foreground}"
HorizontalAlignment="Center"
Style="{StaticResource BaseTextBlock}"/>
<Border Grid.Row="1"
Grid.ColumnSpan="3"
Background="{StaticResource SliderThumb.Static.Background}"
BorderBrush="{StaticResource SliderThumb.Static.Background}"
BorderThickness="0"
Height="2"/>
<TextBlock Grid.Row="2"
Text="{Binding ValueHeight, RelativeSource={RelativeSource AncestorType={x:Type Slider}}}"
Foreground="{StaticResource SliderThumb.Static.Foreground}"
HorizontalAlignment="Center"
Style="{StaticResource BaseTextBlock}"/>
<Ellipse Grid.Column="2"
Grid.RowSpan="3"
x:Name="grip"
Height="18" Width="18"
VerticalAlignment="Center"
Fill="{StaticResource SliderThumb.Static.Background}"
Stroke="{StaticResource SliderThumb.Static.Border}"/>
</Grid>
</Canvas>
</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}"
Stroke="{StaticResource SliderThumb.Static.Border}"
Stretch="Fill"/>
</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"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="True">
<Grid>
<Grid HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border x:Name="TopTick_Border"
Background="{StaticResource SliderThumb.TickBar.Background}"
BorderThickness="0"
Visibility="Collapsed">
<TickBar x:Name="TopTick"
Fill="{TemplateBinding Foreground}"
Placement="Left"
Visibility="Collapsed"
Width="4"/>
</Border>
<Border x:Name="BottomTick_Border"
Grid.Column="2"
Background="{StaticResource SliderThumb.TickBar.Background}"
BorderThickness="0"
Visibility="Collapsed">
<TickBar x:Name="BottomTick"
Fill="{TemplateBinding Foreground}"
Placement="Right"
Visibility="Collapsed"
Width="4"/>
</Border>
<Border x:Name="TrackBackground"
Background="{StaticResource SliderThumb.Track.Background}"
BorderBrush="{StaticResource SliderThumb.Track.Border}"
BorderThickness="1"
Grid.Column="1"
HorizontalAlignment="Center"
Width="4.0"
Margin="0" Padding="0">
<Canvas>
<Rectangle x:Name="PART_SelectionRange"
Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
Visibility="Hidden"
Width="4.0"/>
</Canvas>
</Border>
</Grid>
<Track x:Name="PART_Track">
<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 SliderThumbVerticalDefault}"
VerticalAlignment="Top"
Width="18"/>
</Track.Thumb>
</Track>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="TickPlacement" Value="TopLeft">
<Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
<Setter Property="Visibility" TargetName="TopTick_Border" Value="Visible"/>
<Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbVerticalLeft}"/>
</Trigger>
<Trigger Property="TickPlacement" Value="BottomRight">
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
<Setter Property="Visibility" TargetName="BottomTick_Border" Value="Visible"/>
<Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbVerticalRight}"/>
</Trigger>
<Trigger Property="TickPlacement" Value="Both">
<Setter Property="Visibility" TargetName="TopTick" Value="Visible"/>
<Setter Property="Visibility" TargetName="TopTick_Border" Value="Visible"/>
<Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/>
<Setter Property="Visibility" TargetName="BottomTick_Border" 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="LayerIndex_Slider" TargetType="{x:Type Slider}">
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
<Setter Property="Background" Value="Transparent"/>
+23 -1
View File
@@ -1,4 +1,6 @@
Public Class Dictionary
Imports System.Globalization
Public Class Dictionary
Public Shared ReadOnly MySceneHostVM As String = "MySceneHostVM"
@@ -78,3 +80,23 @@
#End Region ' Colors
End Class
Public Class CenterToolTipConverter
Implements IMultiValueConverter
Public Function Convert(ByVal values As Object(), ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
For Each value In values
If TypeOf (value) IsNot Double Then
Return Double.NaN
End If
Next
Dim dPlacementTarget As Double = CDbl(values(0))
Dim dToolTip As Double = CDbl(values(1))
Return (dPlacementTarget / 2.0) - (dToolTip / 2.0)
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetTypes As Type(), ByVal parameter As Object, ByVal culture As CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
Throw New NotSupportedException()
End Function
End Class