diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-15 19:51:07 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-15 19:51:07 +0300 |
| commit | ca293b80c52a54c73251fbf3cd50741fb5653ae9 (patch) | |
| tree | f1168fa167a26bf8455e601291b8a19945a70187 /Software/Visual_Studio/Tango.Visuals | |
| parent | 9ff8293b603f72c5faa8d238b3005524c31cc5a8 (diff) | |
| download | Tango-ca293b80c52a54c73251fbf3cd50741fb5653ae9.tar.gz Tango-ca293b80c52a54c73251fbf3cd50741fb5653ae9.zip | |
Lots Of Work !
Diffstat (limited to 'Software/Visual_Studio/Tango.Visuals')
| -rw-r--r-- | Software/Visual_Studio/Tango.Visuals/Fader/Fader.xaml | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/Software/Visual_Studio/Tango.Visuals/Fader/Fader.xaml b/Software/Visual_Studio/Tango.Visuals/Fader/Fader.xaml index e3313ef43..c7aac0872 100644 --- a/Software/Visual_Studio/Tango.Visuals/Fader/Fader.xaml +++ b/Software/Visual_Studio/Tango.Visuals/Fader/Fader.xaml @@ -13,7 +13,7 @@ <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></converters:BooleanToVisibilityConverter> <converters:DoubleTunerConverter x:Key="DoubleTunerConverter"></converters:DoubleTunerConverter> - + <LinearGradientBrush x:Key="TrackBrush" StartPoint="0,0.5" EndPoint="1,0.5"> <GradientStop Color="#101010" Offset="1"/> <GradientStop Color="#FF252525" Offset="0.5"/> @@ -28,11 +28,27 @@ <SolidColorBrush x:Key="TicksBrush" Color="DimGray"></SolidColorBrush> <SolidColorBrush x:Key="BigTicksBrush" Color="Gray"></SolidColorBrush> + + <DataTemplate x:Key="leftTickTemplate"> + <Rectangle Width="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=TicksWidth,FallbackValue=8}" Height="1" Fill="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=TicksBrush,FallbackValue={StaticResource TicksBrush},TargetNullValue={StaticResource TicksBrush}}" HorizontalAlignment="Left"></Rectangle> + </DataTemplate> + + <DataTemplate x:Key="leftBigTickTemplate"> + <Rectangle Width="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=BigTicksWidth,FallbackValue=20}" Height="1" Fill="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=BigTicksBrush,FallbackValue={StaticResource BigTicksBrush},TargetNullValue={StaticResource BigTicksBrush}}" HorizontalAlignment="Left"></Rectangle> + </DataTemplate> + + <DataTemplate x:Key="rightTickTemplate"> + <Rectangle Width="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=TicksWidth,FallbackValue=8}" Height="1" Fill="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=TicksBrush,FallbackValue={StaticResource TicksBrush},TargetNullValue={StaticResource TicksBrush}}" HorizontalAlignment="Right"></Rectangle> + </DataTemplate> + + <DataTemplate x:Key="rightBigTickTemplate"> + <Rectangle Width="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=BigTicksWidth,FallbackValue=20}" Height="1" Fill="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=BigTicksBrush,FallbackValue={StaticResource BigTicksBrush},TargetNullValue={StaticResource BigTicksBrush}}" HorizontalAlignment="Left"></Rectangle> + </DataTemplate> </UserControl.Resources> <Grid> - <Border x:Name="border" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=TrackWidth,FallbackValue=10}" Margin="0 35 0 35" CornerRadius="10" Background="{Binding ElementName=fader,Path=TrackBrush,FallbackValue={StaticResource TrackBrush},TargetNullValue={StaticResource TrackBrush}}"></Border> - <Border x:Name="borderHighLight" Visibility="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=HighlightTrack,Converter={StaticResource BooleanToVisibilityConverter}}" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=TrackWidth,FallbackValue=8,Converter={StaticResource DoubleTunerConverter},ConverterParameter=-2}" Margin="0 38 0 38" VerticalAlignment="Bottom" CornerRadius="10" Background="{Binding ElementName=fader,Path=TrackHighlighBrush,FallbackValue={StaticResource TrackHighlighBrush},TargetNullValue={StaticResource TrackHighlighBrush}}"></Border> + <Border x:Name="border" Width="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=TrackWidth,FallbackValue=10}" Margin="0 35 0 35" CornerRadius="10" Background="{Binding ElementName=fader,Path=TrackBrush,FallbackValue={StaticResource TrackBrush},TargetNullValue={StaticResource TrackBrush}}"></Border> + <Border x:Name="borderHighLight" Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=HighlightTrack,Converter={StaticResource BooleanToVisibilityConverter}}" Width="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=TrackWidth,FallbackValue=8,Converter={StaticResource DoubleTunerConverter},ConverterParameter=-2}" Margin="0 38 0 38" VerticalAlignment="Bottom" CornerRadius="10" Background="{Binding ElementName=fader,Path=TrackHighlighBrush,FallbackValue={StaticResource TrackHighlighBrush},TargetNullValue={StaticResource TrackHighlighBrush}}"></Border> <Grid Margin="0 10 0 10"> <Grid.ColumnDefinitions> @@ -41,45 +57,27 @@ <ColumnDefinition Width="28*"/> </Grid.ColumnDefinitions> - <Grid Visibility="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=ShowTicks,Converter={StaticResource BooleanToVisibilityConverter}}"> - <local:YAxisTicks DataContext="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=.}" Ticks="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=Ticks}" BigTickInterval="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=BigTicksInterval}" IsHitTestVisible="False"> - <local:YAxisTicks.TickTemplate> - <DataTemplate> - <Rectangle Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.TicksWidth,FallbackValue=8}" Height="1" Fill="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.TicksBrush,FallbackValue={StaticResource TicksBrush},TargetNullValue={StaticResource TicksBrush}}" HorizontalAlignment="Left"></Rectangle> - </DataTemplate> - </local:YAxisTicks.TickTemplate> - <local:YAxisTicks.BigTickTemplate> - <DataTemplate> - <Rectangle Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.BigTicksWidth,FallbackValue=20}" Height="1" Fill="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.BigTicksBrush,FallbackValue={StaticResource BigTicksBrush},TargetNullValue={StaticResource BigTicksBrush}}" HorizontalAlignment="Left"></Rectangle> - </DataTemplate> - </local:YAxisTicks.BigTickTemplate> + <Grid Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=ShowTicks,Converter={StaticResource BooleanToVisibilityConverter}}"> + <local:YAxisTicks TickTemplate="{StaticResource leftTickTemplate}" BigTickTemplate="{StaticResource leftBigTickTemplate}" Ticks="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=Ticks}" BigTickInterval="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=BigTicksInterval}" IsHitTestVisible="False"> + </local:YAxisTicks> </Grid> - <Grid Grid.Column="2" Visibility="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=ShowTicks,Converter={StaticResource BooleanToVisibilityConverter}}"> - <local:YAxisTicks DataContext="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=.}" Ticks="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=Ticks}" BigTickInterval="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=BigTicksInterval}" IsHitTestVisible="False"> - <local:YAxisTicks.TickTemplate> - <DataTemplate> - <Rectangle Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.TicksWidth,FallbackValue=8}" Height="1" Fill="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.TicksBrush,FallbackValue={StaticResource TicksBrush},TargetNullValue={StaticResource TicksBrush}}" HorizontalAlignment="Right"></Rectangle> - </DataTemplate> - </local:YAxisTicks.TickTemplate> - <local:YAxisTicks.BigTickTemplate> - <DataTemplate> - <Rectangle Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.BigTicksWidth,FallbackValue=20}" Height="1" Fill="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.BigTicksBrush,FallbackValue={StaticResource BigTicksBrush},TargetNullValue={StaticResource BigTicksBrush}}" HorizontalAlignment="Right"></Rectangle> - </DataTemplate> - </local:YAxisTicks.BigTickTemplate> + <Grid Grid.Column="2" Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=ShowTicks,Converter={StaticResource BooleanToVisibilityConverter}}"> + <local:YAxisTicks TickTemplate="{StaticResource rightTickTemplate}" BigTickTemplate="{StaticResource rightBigTickTemplate}" Ticks="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=Ticks}" BigTickInterval="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=BigTicksInterval}" IsHitTestVisible="False"> + </local:YAxisTicks> </Grid> </Grid> - <Grid Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=FaderWidth,FallbackValue=40}" VerticalAlignment="Bottom" x:Name="gridThumb"> + <Grid Width="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=FaderWidth,FallbackValue=40}" VerticalAlignment="Bottom" x:Name="gridThumb"> <Grid.RenderTransform> <TranslateTransform x:Name="faderTranslate" Y="0"></TranslateTransform> </Grid.RenderTransform> <Image RenderOptions.BitmapScalingMode="Fant" Source="pack://application:,,,/Tango.Visuals;component/Fader/fader-dark.png"></Image> <Grid> <Grid.Background> - <SolidColorBrush Color="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=FaderColor,TargetNullValue=Transparent}" Opacity="0.3"></SolidColorBrush> + <SolidColorBrush Color="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=FaderColor,TargetNullValue=Transparent}" Opacity="0.3"></SolidColorBrush> </Grid.Background> <Grid.RowDefinitions> <RowDefinition Height="35*"/> @@ -92,10 +90,10 @@ <Setter Property="Fill" Value="Transparent"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=thumbMove,Path=IsMouseOver}" Value="True"> - <Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=FaderLightBrush,FallbackValue=#FF3100,TargetNullValue=#FF3100}"></Setter> + <Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=FaderLightBrush,FallbackValue=#FF3100,TargetNullValue=#FF3100}"></Setter> </DataTrigger> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsKeyDown}" Value="True"> - <Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=FaderLightBrush,FallbackValue=#FF3100,TargetNullValue=#FF3100}"></Setter> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=IsKeyDown}" Value="True"> + <Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=FaderLightBrush,FallbackValue=#FF3100,TargetNullValue=#FF3100}"></Setter> </DataTrigger> </Style.Triggers> </Style> @@ -120,7 +118,7 @@ </Setter.Value> </Setter> <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsFocused}" Value="True"> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:Fader},Path=IsFocused}" Value="True"> <Setter Property="Opacity" Value="0.2"></Setter> </DataTrigger> </Style.Triggers> |
