aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-01 12:17:44 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-01 12:17:44 +0300
commitb2ecc74067ad29c0bb4d267fb966ceb7cb8cbbdb (patch)
treebb06ad367fdcbaac6b7428d6daedeb03e30e24e4 /Software/Visual_Studio/Tango.Touch
parent125af20c03bcf1904166e9858a3a54ef4fcb1f05 (diff)
downloadTango-b2ecc74067ad29c0bb4d267fb966ceb7cb8cbbdb.tar.gz
Tango-b2ecc74067ad29c0bb4d267fb966ceb7cb8cbbdb.zip
Working on PPC.
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs15
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs17
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.xaml40
-rw-r--r--Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml15
-rw-r--r--Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml6
5 files changed, 70 insertions, 23 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs
index cc696aa99..8d1504f48 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs
+++ b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs
@@ -156,6 +156,15 @@ namespace Tango.Touch.Controls
public static readonly DependencyProperty BottomArcSizeProperty =
DependencyProperty.Register("BottomArcSize", typeof(Size), typeof(LightTouchScrollViewer), new PropertyMetadata(default(Size)));
+ public bool DisableScrolling
+ {
+ get { return (bool)GetValue(DisableScrollingProperty); }
+ set { SetValue(DisableScrollingProperty, value); }
+ }
+ public static readonly DependencyProperty DisableScrollingProperty =
+ DependencyProperty.Register("DisableScrolling", typeof(bool), typeof(LightTouchScrollViewer), new PropertyMetadata(false));
+
+
#endregion
#region Constructors
@@ -356,6 +365,8 @@ namespace Tango.Touch.Controls
/// <param name="e">The <see cref="MouseOrTouchEventArgs"/> instance containing the event data.</param>
protected virtual void OnMouseTouchDown(object sender, MouseOrTouchEventArgs e)
{
+ if (DisableScrolling) return;
+
IsAfterScrolling = false;
if (_move_timer != null)
@@ -398,6 +409,8 @@ namespace Tango.Touch.Controls
/// <param name="e">The <see cref="MouseOrTouchEventArgs"/> instance containing the event data.</param>
protected virtual void OnMouseTouchMove(object sender, MouseOrTouchEventArgs e)
{
+ if (DisableScrolling) return;
+
if (_down_element is DragThumb)
{
if (e.Location.Y > ActualHeight - 100)
@@ -496,6 +509,8 @@ namespace Tango.Touch.Controls
/// <param name="e">The <see cref="MouseOrTouchEventArgs"/> instance containing the event data.</param>
protected virtual void OnMouseTouchUp(object sender, MouseOrTouchEventArgs e)
{
+ if (DisableScrolling) return;
+
if (_is_dragging_off_view)
{
_is_dragging_off_view = false;
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs
index 2cefd411e..55a1118fd 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs
@@ -113,6 +113,23 @@ namespace Tango.Touch.Controls
public static readonly DependencyProperty ListBoxItemLoadedCommandProperty =
DependencyProperty.Register("ListBoxItemLoadedCommand", typeof(RelayCommand<TouchListBoxItem>), typeof(TouchListBox), new PropertyMetadata(null));
+ public bool DisableScrolling
+ {
+ get { return (bool)GetValue(DisableScrollingProperty); }
+ set { SetValue(DisableScrollingProperty, value); }
+ }
+ public static readonly DependencyProperty DisableScrollingProperty =
+ DependencyProperty.Register("DisableScrolling", typeof(bool), typeof(TouchListBox), new PropertyMetadata(false));
+
+ public bool DisableRipple
+ {
+ get { return (bool)GetValue(DisableRippleProperty); }
+ set { SetValue(DisableRippleProperty, value); }
+ }
+ public static readonly DependencyProperty DisableRippleProperty =
+ DependencyProperty.Register("DisableRipple", typeof(bool), typeof(TouchListBox), new PropertyMetadata(false));
+
+
public TouchListBox()
{
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.xaml
index f57f6b32f..be03f498c 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.xaml
@@ -14,29 +14,30 @@
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
- <Style TargetType="local:TouchListBoxItem">
- <Setter Property="Background" Value="Transparent"></Setter>
- <Setter Property="IsManipulationEnabled" Value="True"></Setter>
- <Style.Triggers>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}" Value="True" />
- <Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=SelectionMode,Converter={StaticResource SelectionModesToBooleanConverter},ConverterParameter='Single,Multiple'}" Value="True" />
- </MultiDataTrigger.Conditions>
- <Setter Property="Background" Value="{StaticResource TangoLightSelectedBrush}"></Setter>
- </MultiDataTrigger>
- </Style.Triggers>
- </Style>
-
<Style TargetType="{x:Type local:TouchListBox}">
- <Setter Property="IsManipulationEnabled" Value="True"></Setter>
<Setter Property="local:TouchPanel.PreventFocusSteal" Value="True"></Setter>
+ <Setter Property="ItemContainerStyle">
+ <Setter.Value>
+ <Style TargetType="local:TouchListBoxItem">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ <Style.Triggers>
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}" Value="True" />
+ <Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=SelectionMode,Converter={StaticResource SelectionModesToBooleanConverter},ConverterParameter='Single,Multiple'}" Value="True" />
+ </MultiDataTrigger.Conditions>
+ <Setter Property="Background" Value="{StaticResource TangoLightSelectedBrush}"></Setter>
+ </MultiDataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Setter.Value>
+ </Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:TouchListBox}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
- <local:LightTouchScrollViewer x:Name="PART_ScrollViewer">
- <ItemsControl VirtualizingPanel.IsVirtualizing="False" x:Name="PART_ItemsControl" Style="{x:Null}" ItemsSource="{TemplateBinding ItemsSource}" ItemContainerStyle="{TemplateBinding ItemContainerStyle}" VerticalAlignment="Top" ClipToBounds="True">
+ <local:LightTouchScrollViewer x:Name="PART_ScrollViewer" DisableScrolling="{TemplateBinding DisableScrolling}">
+ <ItemsControl VirtualizingPanel.IsVirtualizing="False" x:Name="PART_ItemsControl" Style="{x:Null}" ItemsSource="{TemplateBinding ItemsSource}" VerticalAlignment="Top" ClipToBounds="True">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel VirtualizingPanel.IsVirtualizing="False" Orientation="Vertical" VerticalAlignment="Top" />
@@ -44,7 +45,7 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
- <local:TouchListBoxItem>
+ <local:TouchListBoxItem Style="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=ItemContainerStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=ListBoxItemLoadedCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBoxItem}}" />
@@ -61,6 +62,9 @@
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=IsMultiSelecting}" Value="True">
<Setter Property="Disabled" Value="True"></Setter>
</DataTrigger>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=DisableRipple}" Value="True">
+ <Setter Property="Disabled" Value="True"></Setter>
+ </DataTrigger>
</Style.Triggers>
</Style>
</components:Ripple.Style>
diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
index e62404309..fea5c541c 100644
--- a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
@@ -26,13 +26,24 @@
<Setter Property="RippleFactor" Value="10"></Setter>
</Style>
- <Style x:Key="TangoHollowButton" TargetType="{x:Type controls:TouchButton}">
+ <Style x:Key="TangoLinkButton" TargetType="{x:Type controls:TouchButton}">
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="CornerRadius" Value="20"></Setter>
+ <Setter Property="BorderThickness" Value="0"></Setter>
+ <Setter Property="EnableDropShadow" Value="False"></Setter>
+ <Setter Property="Padding" Value="10 5"></Setter>
+ <Setter Property="RippleBrush" Value="{StaticResource TangoRippleDarkBrush}"></Setter>
+ <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"></Setter>
+ </Style>
+
+ <Style x:Key="TangoHollowButton" TargetType="{x:Type controls:TouchButton}">
+ <Setter Property="Background" Value="Transparent"></Setter>
+ <Setter Property="CornerRadius" Value="30"></Setter>
<Setter Property="TextElement.Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
- <Setter Property="BorderThickness" Value="1"></Setter>
+ <Setter Property="BorderThickness" Value="2"></Setter>
<Setter Property="BorderBrush" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
<Setter Property="RippleBrush" Value="{StaticResource TangoRippleDarkBrush}"></Setter>
+ <Setter Property="EnableDropShadow" Value="False"></Setter>
</Style>
</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml
index dece0f8ba..ccfbc6feb 100644
--- a/Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml
@@ -11,14 +11,14 @@
<localConverters:SelectionModesToBooleanConverter x:Key="SelectionModesToBooleanConverter" />
- <Style x:Key="TangoBasicListBox" TargetType="{x:Type local:TouchListBox}">
- <Setter Property="IsManipulationEnabled" Value="True"></Setter>
+ <Style x:Key="TangoNoRippleListBox" TargetType="{x:Type local:TouchListBox}">
<Setter Property="local:TouchPanel.PreventFocusSteal" Value="True"></Setter>
+ <Setter Property="DisableScrolling" Value="True"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:TouchListBox}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
- <local:LightTouchScrollViewer x:Name="PART_ScrollViewer">
+ <local:LightTouchScrollViewer x:Name="PART_ScrollViewer" DisableScrolling="{TemplateBinding DisableScrolling}">
<ItemsControl VirtualizingPanel.IsVirtualizing="False" x:Name="PART_ItemsControl" Style="{x:Null}" ItemsSource="{TemplateBinding ItemsSource}" VerticalAlignment="Top" ClipToBounds="True">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>