aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Styles/TouchScrollViewer.xaml91
-rw-r--r--Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj6
-rw-r--r--Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml3
3 files changed, 98 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchScrollViewer.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchScrollViewer.xaml
new file mode 100644
index 000000000..cd37a5b6a
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchScrollViewer.xaml
@@ -0,0 +1,91 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:controls="clr-namespace:Tango.Touch.Controls"
+ xmlns:components="clr-namespace:Tango.Touch.Components"
+ xmlns:local="clr-namespace:Tango.Touch.Styles">
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="../Resources/Colors.xaml" />
+ <ResourceDictionary Source="../Resources/Fonts.xaml" />
+ <ResourceDictionary>
+ <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
+ </ResourceDictionary>
+ </ResourceDictionary.MergedDictionaries>
+ <Style x:Key="TouchScrollBarThumb" TargetType="{x:Type Thumb}">
+ <Setter Property="OverridesDefaultStyle" Value="true"/>
+ <Setter Property="IsTabStop" Value="false"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type Thumb}">
+ <Border Height="{TemplateBinding Height}" SnapsToDevicePixels="True" Width="{TemplateBinding Width}" CornerRadius="5" Background="#90000000" />
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="TouchScrollBar" TargetType="{x:Type ScrollBar}">
+ <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
+ <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
+ <Setter Property="Background" Value="#33000000"/>
+ <Setter Property="BorderBrush" Value="#33000000"/>
+ <Setter Property="Foreground" Value="Gray"/>
+ <Setter Property="BorderThickness" Value="0"/>
+ <Setter Property="Width" Value="5"/>
+ <Setter Property="MinWidth" Value="5"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type ScrollBar}">
+ <Grid x:Name="Bg" SnapsToDevicePixels="true" Background="{TemplateBinding Background}">
+ <Border BorderBrush="{TemplateBinding BorderBrush}" HorizontalAlignment="Right" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Row="1"/>
+ <Track x:Name="PART_Track" IsDirectionReversed="true" HorizontalAlignment="Right" Width="5" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="1">
+ <Track.Thumb>
+ <Thumb Style="{StaticResource TouchScrollBarThumb}"></Thumb>
+ </Track.Thumb>
+ </Track>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="TouchVerticalScrollViewer" TargetType="{x:Type controls:TouchScrollViewer}">
+ <Setter Property="HorizontalScrollBarVisibility" Value="Disabled"></Setter>
+ <Setter Property="PanningMode" Value="VerticalOnly"></Setter>
+ <Setter Property="VerticalScrollBarVisibility" Value="Visible"></Setter>
+ <Setter Property="Focusable" Value="False"></Setter>
+ <Setter Property="CanContentScroll" Value="true"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type controls:TouchScrollViewer}">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+
+ <DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Visibility="Hidden"/>
+ <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.Row="1"/>
+ <ScrollBar Opacity="0" Grid.Row="1" x:Name="PART_VerticalScrollBar" Style="{StaticResource TouchScrollBar}" HorizontalAlignment="Right" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
+ </Grid>
+
+ <ControlTemplate.Triggers>
+ <EventTrigger RoutedEvent="ScrollViewer.ScrollChanged">
+ <EventTrigger.Actions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_VerticalScrollBar" Storyboard.TargetProperty="Opacity" Duration="00:00:03" FillBehavior="Stop">
+ <EasingDoubleKeyFrame KeyTime="00:00:0.2" Value="1"></EasingDoubleKeyFrame>
+ <DiscreteDoubleKeyFrame KeyTime="00:00:2.5" Value="1"></DiscreteDoubleKeyFrame>
+ <EasingDoubleKeyFrame KeyTime="00:00:03" Value="0"></EasingDoubleKeyFrame>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </BeginStoryboard>
+ </EventTrigger.Actions>
+ </EventTrigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+
+</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj
index ae5ac91e3..58eb68e45 100644
--- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj
+++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj
@@ -155,6 +155,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Styles\TouchScrollViewer.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="TouchColorPickerControls\MultiRangeSlider.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -488,7 +492,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml
index c2c6c0bc9..0a9ce1282 100644
--- a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml
@@ -62,7 +62,8 @@
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchCheckBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchExpander.xaml" />
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchNumericUpDownControl.xaml"/>
-
+ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchScrollViewer.xaml"/>
+
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchPanel.xaml" />
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/TouchColorPickerControls/TouchColorPickerSlider.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/TouchColorPickerControls/TouchColorPickerControl.xaml"/>