diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-27 19:33:15 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-27 19:33:15 +0300 |
| commit | e571f20e27c4fca6bb6efe03d6427a1f332f9830 (patch) | |
| tree | b16041b76ea3b4e8368039c9396f9bbf9624dcc2 /Software/Visual_Studio/Tango.Touch | |
| parent | 157e0685abb2e7b22b6584cdc7d6f5838ed0a808 (diff) | |
| download | Tango-e571f20e27c4fca6bb6efe03d6427a1f332f9830.tar.gz Tango-e571f20e27c4fca6bb6efe03d6427a1f332f9830.zip | |
Working on panel pc.
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch')
22 files changed, 923 insertions, 8 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchBusyIndicator.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchBusyIndicator.cs new file mode 100644 index 000000000..eb3ceb85c --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchBusyIndicator.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Touch.Controls +{ + public class TouchBusyIndicator : ProgressBar + { + public double StrokeThickness + { + get { return (double)GetValue(StrokeThicknessProperty); } + set { SetValue(StrokeThicknessProperty, value); } + } + public static readonly DependencyProperty StrokeThicknessProperty = + DependencyProperty.Register("StrokeThickness", typeof(double), typeof(TouchBusyIndicator), new PropertyMetadata(3.0)); + + static TouchBusyIndicator() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchBusyIndicator), new FrameworkPropertyMetadata(typeof(TouchBusyIndicator))); + } + } +} diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchBusyIndicator.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchBusyIndicator.xaml new file mode 100644 index 000000000..fa6a83d50 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchBusyIndicator.xaml @@ -0,0 +1,140 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:converters="clr-namespace:Tango.Touch.Converters" + xmlns:local="clr-namespace:Tango.Touch.Controls"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary> + <converters:ArcEndPointConverter x:Key="ArcEndPointConverter" /> + <converters:ArcSizeConverter x:Key="ArcSizeConverter" /> + <converters:RotateTransformCentreConverter x:Key="RotateTransformCentreConverter" /> + <converters:NotZeroConverter x:Key="NotZeroConverter" /> + <converters:RotateTransformConverter x:Key="RotateTransformConverter" /> + <converters:StartPointConverter x:Key="StartPointConverter" /> + <converters:LargeArcConverter x:Key="LargeArcConverter" /> + </ResourceDictionary> + + <ResourceDictionary Source="../Resources/Colors.xaml" /> + </ResourceDictionary.MergedDictionaries> + + + <Style TargetType="{x:Type local:TouchBusyIndicator}"> + <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" /> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="Width" Value="20" /> + <Setter Property="Height" Value="20" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:TouchBusyIndicator}"> + <ControlTemplate.Resources> + <Storyboard x:Key="IsIndeterminateStoryboard" TargetName="RotateTransform" TargetProperty="Angle" RepeatBehavior="Forever"> + <DoubleAnimation From="0" To="359" Duration="0:0:2" /> + </Storyboard> + <Storyboard x:Key="IsFullyIndeterminateScaleStoryboard"> + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FullyIndeterminateGridScaleTransform" + Storyboard.TargetProperty="ScaleX" + RepeatBehavior="Forever"> + <SplineDoubleKeyFrame KeyTime="0" Value="0.0" /> + <SplineDoubleKeyFrame KeyTime="0:0:1" Value="1.0" /> + <SplineDoubleKeyFrame KeyTime="0:0:4" Value="0.0" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimation Storyboard.TargetName="RotateTransform" + Storyboard.TargetProperty="Angle" + RepeatBehavior="Forever" + From="00" To="359" Duration="0:0:1.25" /> + </Storyboard> + </ControlTemplate.Resources> + <Grid x:Name="TemplateRoot" ClipToBounds="False"> + <Grid x:Name="FullyIndeterminateGrid"> + <Grid.RenderTransform> + <ScaleTransform x:Name="FullyIndeterminateGridScaleTransform" ScaleX="0" /> + </Grid.RenderTransform> + </Grid> + <Grid x:Name="PathGrid" Margin="2" /> + <Canvas> + <Ellipse Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" /> + <Path x:Name="Path" Stroke="{TemplateBinding Foreground}" StrokeThickness="{Binding RelativeSource={RelativeSource TemplatedParent},Path=StrokeThickness}" + Canvas.Top="2" Canvas.Left="2" + RenderTransformOrigin="0, 0"> + <Path.Data> + <PathGeometry> + <PathFigure StartPoint="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={StaticResource StartPointConverter}, Mode=OneWay}"> + <ArcSegment Size="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={StaticResource ArcSizeConverter}, Mode=OneWay}" + SweepDirection="Clockwise"> + <ArcSegment.IsLargeArc> + <MultiBinding Converter="{StaticResource LargeArcConverter}"> + <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Value" /> + <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Minimum" /> + <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Maximum" /> + <Binding ElementName="FullyIndeterminateGridScaleTransform" Path="ScaleX" /> + </MultiBinding> + </ArcSegment.IsLargeArc> + <ArcSegment.Point> + <MultiBinding Converter="{StaticResource ArcEndPointConverter}"> + <Binding ElementName="PathGrid" Path="ActualWidth" /> + <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Value" /> + <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Minimum" /> + <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Maximum" /> + <Binding ElementName="FullyIndeterminateGridScaleTransform" Path="ScaleX" /> + </MultiBinding> + </ArcSegment.Point> + </ArcSegment> + </PathFigure> + </PathGeometry> + </Path.Data> + <Path.RenderTransform> + <TransformGroup> + <RotateTransform x:Name="RotateTransform" + CenterX="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={StaticResource RotateTransformCentreConverter}, Mode=OneWay}" + CenterY="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={StaticResource RotateTransformCentreConverter}, Mode=OneWay}"> + <RotateTransform.Angle> + <MultiBinding Converter="{StaticResource RotateTransformConverter}"> + <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Value" /> + <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Minimum" /> + <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Maximum" /> + </MultiBinding> + </RotateTransform.Angle> + </RotateTransform> + </TransformGroup> + </Path.RenderTransform> + </Path> + </Canvas> + </Grid> + <ControlTemplate.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsIndeterminate, RelativeSource={RelativeSource Self}}" Value="True" /> + <Condition Binding="{Binding IsVisible, RelativeSource={RelativeSource Self}}" Value="True" /> + <Condition Binding="{Binding Value, RelativeSource={RelativeSource Self}, Converter={StaticResource NotZeroConverter}}" Value="True" /> + </MultiDataTrigger.Conditions> + <MultiDataTrigger.EnterActions> + <RemoveStoryboard BeginStoryboardName="IsFullyIndeterminateStoryboard" /> + <BeginStoryboard Storyboard="{StaticResource IsIndeterminateStoryboard}" + Name="IsIndeterminateStoryboard"/> + </MultiDataTrigger.EnterActions> + <MultiDataTrigger.ExitActions> + <RemoveStoryboard BeginStoryboardName="IsIndeterminateStoryboard" /> + </MultiDataTrigger.ExitActions> + </MultiDataTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsIndeterminate" Value="True" /> + <Condition Property="Value" Value="0" /> + <Condition Property="IsVisible" Value="True" /> + </MultiTrigger.Conditions> + <MultiTrigger.EnterActions> + <RemoveStoryboard BeginStoryboardName="IsIndeterminateStoryboard" /> + <BeginStoryboard Storyboard="{StaticResource IsFullyIndeterminateScaleStoryboard}" + Name="IsFullyIndeterminateStoryboard"/> + </MultiTrigger.EnterActions> + <MultiTrigger.ExitActions> + <RemoveStoryboard BeginStoryboardName="IsFullyIndeterminateStoryboard" /> + </MultiTrigger.ExitActions> + </MultiTrigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.cs index f1009d579..1974a9156 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.cs @@ -55,6 +55,12 @@ namespace Tango.Touch.Controls #endregion + public TouchButton() + { + + } + + static TouchButton() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchButton), new FrameworkPropertyMetadata(typeof(TouchButton))); diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchDataGrid.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchDataGrid.xaml index 2cf2fbbb2..454171eb8 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchDataGrid.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchDataGrid.xaml @@ -7,6 +7,7 @@ <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="../Resources/Colors.xaml" /> + <ResourceDictionary Source="../Resources/Fonts.xaml" /> <ResourceDictionary Source="../Controls/Shared.xaml" /> </ResourceDictionary.MergedDictionaries> @@ -33,6 +34,7 @@ <Style TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"></Setter> + <Setter Property="FontSize" Value="{StaticResource TangoColumnHeaderFontSize}"></Setter> <Setter Property="FontWeight" Value="SemiBold"></Setter> <Setter Property="Template"> <Setter.Value> diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs index 504b97d9c..bc1a63124 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs @@ -52,17 +52,17 @@ namespace Tango.Touch.Controls { var container = ItemContainerGenerator.ContainerFromItem(SelectedItem) as FrameworkElement; - ContentPresenter presenter = UIHelper.FindChild<ContentPresenter>(container); + ContentPresenter presenter = UIHelper.FindChild<ContentPresenter>(container).FindChild<ContentPresenter>(); if (presenter != null) { Point relativePoint = presenter.TransformToAncestor(this).Transform(new Point(0, 0)); - Size size = presenter.RenderSize; + double width = presenter.ActualWidth; if (_lastSelectedItem != null && Items.IndexOf(SelectedItem) > Items.IndexOf(_lastSelectedItem)) { DoubleAnimation aniX2 = new DoubleAnimation(); - aniX2.To = relativePoint.X + size.Width; + aniX2.To = relativePoint.X + width; aniX2.Duration = TimeSpan.FromSeconds(0.2); _line.BeginAnimation(Line.X2Property, aniX2); @@ -80,7 +80,7 @@ namespace Tango.Touch.Controls _line.BeginAnimation(Line.X1Property, aniX1); DoubleAnimation aniX2 = new DoubleAnimation(); - aniX2.To = relativePoint.X + size.Width; + aniX2.To = relativePoint.X + width; aniX2.BeginTime = TimeSpan.FromSeconds(0.2); aniX2.Duration = TimeSpan.FromSeconds(0.1); _line.BeginAnimation(Line.X2Property, aniX2); diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchSideMenu.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchSideMenu.cs new file mode 100644 index 000000000..3f94b2a4a --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchSideMenu.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Touch.Controls +{ + [ContentProperty(nameof(Content))] + public class TouchSideMenu : Control + { + public FrameworkElement Content + { + get { return (FrameworkElement)GetValue(ContentProperty); } + set { SetValue(ContentProperty, value); } + } + public static readonly DependencyProperty ContentProperty = + DependencyProperty.Register("Content", typeof(FrameworkElement), typeof(TouchSideMenu), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender,(d,e) => (d as TouchSideMenu).OnContentChanged())); + + public FrameworkElement MenuContent + { + get { return (FrameworkElement)GetValue(MenuContentProperty); } + set { SetValue(MenuContentProperty, value); } + } + public static readonly DependencyProperty MenuContentProperty = + DependencyProperty.Register("MenuContent", typeof(FrameworkElement), typeof(TouchSideMenu), new PropertyMetadata(null,(d,e) => (d as TouchSideMenu).OnMenuContentChanged())); + + public bool IsOpened + { + get { return (bool)GetValue(IsOpenedProperty); } + set { SetValue(IsOpenedProperty, value); } + } + public static readonly DependencyProperty IsOpenedProperty = + DependencyProperty.Register("IsOpened", typeof(bool), typeof(TouchSideMenu), new PropertyMetadata(false)); + + static TouchSideMenu() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchSideMenu), new FrameworkPropertyMetadata(typeof(TouchSideMenu))); + } + + private void OnContentChanged() + { + RemoveLogicalChild(Content); + AddLogicalChild(Content); + } + + private void OnMenuContentChanged() + { + RemoveLogicalChild(MenuContent); + AddLogicalChild(MenuContent); + } + } +} diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchSideMenu.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchSideMenu.xaml new file mode 100644 index 000000000..309a317b9 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchSideMenu.xaml @@ -0,0 +1,68 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.Touch.Controls"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary> + <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> + </ResourceDictionary> + </ResourceDictionary.MergedDictionaries> + + <Style TargetType="{x:Type local:TouchSideMenu}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:TouchSideMenu}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <Grid> + + <!--Main Content--> + <ContentControl Content="{TemplateBinding Content}"/> + + <!--Menu Opened Mask--> + <Border Background="#83000000" IsHitTestVisible="True" Visibility="{TemplateBinding IsOpened,Converter={StaticResource BooleanToVisibilityConverter}}"> + <ToggleButton Style="{x:Null}" Opacity="0" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsOpened}" /> + </Border> + + <!--Menu Content--> + <ContentControl Content="{TemplateBinding MenuContent}" HorizontalAlignment="Left"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleY="1" ScaleX="0"></ScaleTransform> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsOpened}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </Grid> + + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleButton.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleButton.cs new file mode 100644 index 000000000..bc4e6994f --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleButton.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Touch.Controls +{ + public class TouchToggleButton : ToggleButton, ITouchControl + { + private Object _uncheckedContent; + + #region ITouchControl + + public CornerRadius CornerRadius + { + get { return (CornerRadius)GetValue(CornerRadiusProperty); } + set { SetValue(CornerRadiusProperty, value); } + } + public static readonly DependencyProperty CornerRadiusProperty = + DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(TouchToggleButton), new PropertyMetadata(new CornerRadius())); + + public bool EnableDropShadow + { + get { return (bool)GetValue(EnableDropShadowProperty); } + set { SetValue(EnableDropShadowProperty, value); } + } + public static readonly DependencyProperty EnableDropShadowProperty = + DependencyProperty.Register("EnableDropShadow", typeof(bool), typeof(TouchToggleButton), new PropertyMetadata(true)); + + public double BlurRadius + { + get { return (double)GetValue(BlurRadiusProperty); } + set { SetValue(BlurRadiusProperty, value); } + } + public static readonly DependencyProperty BlurRadiusProperty = + DependencyProperty.Register("BlurRadius", typeof(double), typeof(TouchToggleButton), new PropertyMetadata(10.0)); + + public double ShadowDepth + { + get { return (double)GetValue(ShadowDepthProperty); } + set { SetValue(ShadowDepthProperty, value); } + } + public static readonly DependencyProperty ShadowDepthProperty = + DependencyProperty.Register("ShadowDepth", typeof(double), typeof(TouchToggleButton), new PropertyMetadata(1.0)); + + public Color ShadowColor + { + get { return (Color)GetValue(ShadowColorProperty); } + set { SetValue(ShadowColorProperty, value); } + } + public static readonly DependencyProperty ShadowColorProperty = + DependencyProperty.Register("ShadowColor", typeof(Color), typeof(TouchToggleButton), new PropertyMetadata(Colors.Gray)); + + #endregion + + public Object CheckedContent + { + get { return (Object)GetValue(CheckedContentProperty); } + set { SetValue(CheckedContentProperty, value); } + } + public static readonly DependencyProperty CheckedContentProperty = + DependencyProperty.Register("CheckedContent", typeof(Object), typeof(TouchToggleButton), new PropertyMetadata(null)); + + static TouchToggleButton() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchToggleButton), new FrameworkPropertyMetadata(typeof(TouchToggleButton))); + } + + public TouchToggleButton() + { + Loaded += (_, __) => _uncheckedContent = Content; + Checked += (_, __) => Content = CheckedContent != null ? CheckedContent : Content; + Unchecked += (_, __) => Content = _uncheckedContent; + } + } +} diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleButton.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleButton.xaml new file mode 100644 index 000000000..d7e7e611c --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleButton.xaml @@ -0,0 +1,40 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:components="clr-namespace:Tango.Touch.Components" + xmlns:local="clr-namespace:Tango.Touch.Controls"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Resources/Colors.xaml" /> + <ResourceDictionary Source="../Controls/Shared.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <Style TargetType="{x:Type local:TouchToggleButton}"> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="Background" Value="{StaticResource TangoPrimaryAccentBrush}"/> + <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"/> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"></Setter> + <Setter Property="HorizontalContentAlignment" Value="Center"/> + <Setter Property="VerticalContentAlignment" Value="Center"/> + <Setter Property="Padding" Value="0"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:TouchToggleButton}"> + <Border x:Name="border" Style="{StaticResource DropShadowBorder}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> + <components:Ripple CornerRadius="{TemplateBinding CornerRadius}"> + <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </components:Ripple> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Background" TargetName="border" Value="{StaticResource TangoDisabledBackgroundBrush}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TangoDisabledBackgroundBrush}"/> + <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource TangoDisabledForegroundBrush}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Converters/ArcEndPointConverter.cs b/Software/Visual_Studio/Tango.Touch/Converters/ArcEndPointConverter.cs new file mode 100644 index 000000000..b5bbfa7de --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Converters/ArcEndPointConverter.cs @@ -0,0 +1,47 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace Tango.Touch.Converters +{ + public class ArcEndPointConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + var actualWidth = values[0].ExtractDouble(); + var value = values[1].ExtractDouble(); + var minimum = values[2].ExtractDouble(); + var maximum = values[3].ExtractDouble(); + + if (new[] {actualWidth, value, minimum, maximum}.AnyNan()) + return Binding.DoNothing; + + if (values.Length == 5) + { + var fullIndeterminateScaling = values[4].ExtractDouble(); + if (!double.IsNaN(fullIndeterminateScaling) && fullIndeterminateScaling > 0.0) + { + value = (maximum - minimum)*fullIndeterminateScaling; + } + } + + var percent = maximum <= minimum ? 1.0 : (value - minimum)/(maximum - minimum); + var degrees = 360*percent; + var radians = degrees*(Math.PI/180); + + var centre = new Point(actualWidth/2, actualWidth/2); + var hypotenuseRadius = (actualWidth/2); + + var adjacent = Math.Cos(radians)*hypotenuseRadius; + var opposite = Math.Sin(radians)*hypotenuseRadius; + + return new Point(centre.X + opposite, centre.Y - adjacent); + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Converters/ArcSizeConverter.cs b/Software/Visual_Studio/Tango.Touch/Converters/ArcSizeConverter.cs new file mode 100644 index 000000000..8bc90b03a --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Converters/ArcSizeConverter.cs @@ -0,0 +1,25 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace Tango.Touch.Converters +{ + public class ArcSizeConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is double && ((double)value > 0.0)) + { + return new Size((double)value / 2, (double)value / 2); + } + + return new Point(); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return Binding.DoNothing; + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Converters/LargeArcConverter.cs b/Software/Visual_Studio/Tango.Touch/Converters/LargeArcConverter.cs new file mode 100644 index 000000000..6ce52afb2 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Converters/LargeArcConverter.cs @@ -0,0 +1,37 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace Tango.Touch.Converters +{ + public class LargeArcConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + var value = values[0].ExtractDouble(); + var minimum = values[1].ExtractDouble(); + var maximum = values[2].ExtractDouble(); + + if (new[] { value, minimum, maximum }.AnyNan()) + return Binding.DoNothing; + + if (values.Length == 4) + { + var fullIndeterminateScaling = values[3].ExtractDouble(); + if (!double.IsNaN(fullIndeterminateScaling) && fullIndeterminateScaling > 0.0) + { + value = (maximum - minimum) * fullIndeterminateScaling; + } + } + + var percent = maximum <= minimum ? 1.0 : (value - minimum) / (maximum - minimum); + + return percent > 0.5; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Converters/LocalEx.cs b/Software/Visual_Studio/Tango.Touch/Converters/LocalEx.cs new file mode 100644 index 000000000..d559ae296 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Converters/LocalEx.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Touch.Converters +{ + internal static class LocalEx + { + public static double ExtractDouble(this object val) + { + var d = val as double? ?? double.NaN; + return double.IsInfinity(d) ? double.NaN : d; + } + + + public static bool AnyNan(this IEnumerable<double> vals) + { + return vals.Any(double.IsNaN); + } + } +} diff --git a/Software/Visual_Studio/Tango.Touch/Converters/NotZeroConverter.cs b/Software/Visual_Studio/Tango.Touch/Converters/NotZeroConverter.cs new file mode 100644 index 000000000..2c206fd9a --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Converters/NotZeroConverter.cs @@ -0,0 +1,23 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace Tango.Touch.Converters +{ + public class NotZeroConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (double.TryParse((value ?? "").ToString(), out double val)) + { + return Math.Abs(val) > 0.0; + } + return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return Binding.DoNothing; + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Converters/RotateTransformCentreConverter.cs b/Software/Visual_Studio/Tango.Touch/Converters/RotateTransformCentreConverter.cs new file mode 100644 index 000000000..63348117e --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Converters/RotateTransformCentreConverter.cs @@ -0,0 +1,20 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace Tango.Touch.Converters +{ + public class RotateTransformCentreConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + //value == actual width + return (double) value/2; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return Binding.DoNothing; + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Converters/RotateTransformConverter.cs b/Software/Visual_Studio/Tango.Touch/Converters/RotateTransformConverter.cs new file mode 100644 index 000000000..ad1155f99 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Converters/RotateTransformConverter.cs @@ -0,0 +1,28 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace Tango.Touch.Converters +{ + public class RotateTransformConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + var value = values[0].ExtractDouble(); + var minimum = values[1].ExtractDouble(); + var maximum = values[2].ExtractDouble(); + + if (new[] { value, minimum, maximum }.AnyNan()) + return Binding.DoNothing; + + var percent = maximum <= minimum ? 1.0 : (value - minimum) / (maximum - minimum); + + return 360*percent; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Converters/StartPointConverter.cs b/Software/Visual_Studio/Tango.Touch/Converters/StartPointConverter.cs new file mode 100644 index 000000000..5b51065a3 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Converters/StartPointConverter.cs @@ -0,0 +1,28 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace Tango.Touch.Converters +{ + public class StartPointConverter : IValueConverter + { + [Obsolete] + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is double && ((double) value > 0.0)) + { + return new Point((double)value / 2, 0); + } + + return new Point(); + } + + [Obsolete] + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return Binding.DoNothing; + } + + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml index 95f884aac..7b3886e4e 100644 --- a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml +++ b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml @@ -8,7 +8,7 @@ <Color x:Key="TangoPrimaryAccentColor">#1c63ea</Color> <Color x:Key="TangoMidAccentColor">#4e556f</Color> - <Color x:Key="TangoLowAccentColor">#62687f</Color> + <Color x:Key="TangoLowAccentColor">#555B76</Color> <Color x:Key="TangoLowerAccentColor">#525971</Color> <Color x:Key="TangoDarkForegroundColor">#2f2f2f</Color> @@ -23,6 +23,8 @@ <Color x:Key="RippleLightColor">#6EFFFFFF</Color> <Color x:Key="RippleDarkColor">#6E000000</Color> + <Color x:Key="TangoColumnDividerColor">#464d67</Color> + <!--Brushes--> <SolidColorBrush x:Key="TangoPrimaryBackgroundBrush" Color="{StaticResource TangoPrimaryBackgroundColor}"></SolidColorBrush> <SolidColorBrush x:Key="TangoMidBackgroundBrush" Color="{StaticResource TangoMidBackgroundColor}"></SolidColorBrush> @@ -44,4 +46,6 @@ <SolidColorBrush x:Key="RippleLightBrush" Color="{StaticResource RippleLightColor}"></SolidColorBrush> <SolidColorBrush x:Key="RippleDarkBrush" Color="{StaticResource RippleDarkColor}"></SolidColorBrush> + <SolidColorBrush x:Key="TangoColumnDividerBrush" Color="{StaticResource TangoColumnDividerColor}"></SolidColorBrush> + </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml new file mode 100644 index 000000000..1935c29f2 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml @@ -0,0 +1,9 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:sys="clr-namespace:System;assembly=mscorlib" + xmlns:local="clr-namespace:Tango.Touch.Resources"> + + <sys:Double x:Key="TangoColumnHeaderFontSize">13</sys:Double> + + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchToggleButton.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchToggleButton.xaml new file mode 100644 index 000000000..36d5e73db --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchToggleButton.xaml @@ -0,0 +1,197 @@ +<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"> + + <Style x:Key="TouchToggleButtonHamburger" TargetType="{x:Type controls:TouchToggleButton}"> + <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="HorizontalContentAlignment" Value="Center"/> + <Setter Property="VerticalContentAlignment" Value="Center"/> + <Setter Property="CornerRadius" Value="50"></Setter> + <Setter Property="Width" Value="37" /> + <Setter Property="Height" Value="37" /> + <Setter Property="Padding" Value="1"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type controls:TouchToggleButton}"> + <Border Background="{TemplateBinding Property=Background}"> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualState Name="Normal"/> + <VisualState Name="Disabled"> + <Storyboard> + <DoubleAnimation Duration="0" To="0.23" Storyboard.TargetProperty="(UIElement.Opacity)" /> + </Storyboard> + </VisualState> + </VisualStateGroup> + <VisualStateGroup x:Name="CheckStates"> + <VisualStateGroup.Transitions> + <VisualTransition From="*" To="Checked"> + <Storyboard> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="rectangle"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="45"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0.581"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="4.875"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1.875"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="rectangle2"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-45"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle2"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0.581"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle2"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="4.832"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle2"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-2.082"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle1"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0.889"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle1"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-1"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="canvas"> + <EasingDoubleKeyFrame KeyTime="0" Value="0"/> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-180"/> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </VisualTransition> + <VisualTransition From="Checked" To="Unchecked"> + <Storyboard> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="rectangle"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="rectangle2"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle2"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle2"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle2"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle1"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle1"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="canvas"> + <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </VisualTransition> + </VisualStateGroup.Transitions> + <VisualState x:Name="Checked"> + <Storyboard> + <DoubleAnimation Duration="0" To="45" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="rectangle" /> + <DoubleAnimation Duration="0" To="0.581" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle" /> + <DoubleAnimation Duration="0" To="4.875" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle" /> + <DoubleAnimation Duration="0" To="1.875" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle" /> + <DoubleAnimation Duration="0" To="-45" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="rectangle2" /> + <DoubleAnimation Duration="0" To="0.581" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle2" /> + <DoubleAnimation Duration="0" To="4.832" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle2" /> + <DoubleAnimation Duration="0" To="-2.082" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle2" /> + <DoubleAnimation Duration="0" To="0.889" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle1" /> + <DoubleAnimation Duration="0" To="-1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle1" /> + <DoubleAnimation Duration="0" To="-180" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="canvas" /> + </Storyboard> + </VisualState> + <VisualState x:Name="Unchecked"> + <Storyboard> + <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="rectangle" /> + <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle" /> + <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle" /> + <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle" /> + <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="rectangle2" /> + <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle2" /> + <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle2" /> + <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle2" /> + <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle1" /> + <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle1" /> + <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="canvas" /> + </Storyboard> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + <components:Ripple CornerRadius="{TemplateBinding CornerRadius}"> + <Viewbox> + <Canvas x:Name="canvas" Width="24" Height="24" RenderTransformOrigin="0.5,0.5"> + <Canvas.RenderTransform> + <TransformGroup> + <ScaleTransform/> + <SkewTransform/> + <RotateTransform/> + <TranslateTransform/> + </TransformGroup> + </Canvas.RenderTransform> + <Rectangle x:Name="rectangle" Fill="{TemplateBinding Foreground}" Height="2" Canvas.Left="3" RadiusY="0" RadiusX="0" Canvas.Top="6" Width="18" RenderTransformOrigin="0.5,0.5" + > + <Rectangle.RenderTransform> + <TransformGroup> + <ScaleTransform/> + <SkewTransform/> + <RotateTransform/> + <TranslateTransform/> + </TransformGroup> + </Rectangle.RenderTransform> + </Rectangle> + <Rectangle x:Name="rectangle1" Fill="{TemplateBinding Foreground}" Height="2" Canvas.Left="3" RadiusY="0" RadiusX="0" Canvas.Top="11" Width="18" RenderTransformOrigin="0.5,0.5" + > + <Rectangle.RenderTransform> + <TransformGroup> + <ScaleTransform/> + <SkewTransform/> + <RotateTransform/> + <TranslateTransform/> + </TransformGroup> + </Rectangle.RenderTransform> + </Rectangle> + <Rectangle x:Name="rectangle2" Fill="{TemplateBinding Foreground}" Height="2" Canvas.Left="3" RadiusY="0" RadiusX="0" Canvas.Top="16" Width="18" RenderTransformOrigin="0.5,0.5" + > + <Rectangle.RenderTransform> + <TransformGroup> + <ScaleTransform/> + <SkewTransform/> + <RotateTransform/> + <TranslateTransform/> + </TransformGroup> + </Rectangle.RenderTransform> + </Rectangle> + </Canvas> + </Viewbox> + </components:Ripple> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="Button.IsDefaulted" Value="true"/> + </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 478d6a52f..547c90cc8 100644 --- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj +++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj @@ -64,6 +64,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Controls\TouchBusyIndicator.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Controls\TouchNavigationLinks.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -80,6 +84,14 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Controls\TouchSideMenu.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Controls\TouchToggleButton.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Keyboard\KeyboardView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -92,6 +104,14 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Resources\Fonts.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Styles\TouchToggleButton.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Themes\Generic.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -101,10 +121,21 @@ </Compile> <Compile Include="Components\Ripple.cs" /> <Compile Include="Controls\ITouchControl.cs" /> + <Compile Include="Controls\TouchBusyIndicator.cs" /> <Compile Include="Controls\TouchNavigationLinks.cs" /> <Compile Include="Controls\TouchButton.cs" /> <Compile Include="Controls\TouchDataGrid.cs" /> + <Compile Include="Controls\TouchSideMenu.cs" /> + <Compile Include="Controls\TouchToggleButton.cs" /> + <Compile Include="Converters\ArcEndPointConverter.cs" /> + <Compile Include="Converters\ArcSizeConverter.cs" /> + <Compile Include="Converters\LargeArcConverter.cs" /> + <Compile Include="Converters\LocalEx.cs" /> + <Compile Include="Converters\NotZeroConverter.cs" /> + <Compile Include="Converters\RotateTransformCentreConverter.cs" /> + <Compile Include="Converters\RotateTransformConverter.cs" /> <Compile Include="Converters\SizeToRectConverter.cs" /> + <Compile Include="Converters\StartPointConverter.cs" /> <Compile Include="Keyboard\CapsLockMode.cs" /> <Compile Include="Keyboard\KeyboardActionKeyMode.cs" /> <Compile Include="Keyboard\KeyboardDefinition.cs" /> diff --git a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml index 425abd0ab..d31d7d550 100644 --- a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml +++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml @@ -3,15 +3,20 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Tango.Touch"> - <ResourceDictionary.MergedDictionaries> + <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Resources/Colors.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Resources/Fonts.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Components/Ripple.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Keyboard/TouchKeyboard.xaml" /> - <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Keyboard/KeyboardView.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Keyboard/KeyboardView.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/Shared.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchButton.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchToggleButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchDataGrid.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchNavigationLinks.xaml" /> - </ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchSideMenu.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchBusyIndicator.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchToggleButton.xaml" /> + </ResourceDictionary.MergedDictionaries> </ResourceDictionary> |
