diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-06-20 16:40:58 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-06-20 16:40:58 +0300 |
| commit | a5de87ea9863c6e7053e09ed1c2eabf58285af48 (patch) | |
| tree | f39ec628a4857a1e3e103cc47c91bbadaa67bcd2 /Software/Visual_Studio/Tango.Touch/Controls | |
| parent | a495866908071d2204c8eab85dc0163308c5e53e (diff) | |
| download | Tango-a5de87ea9863c6e7053e09ed1c2eabf58285af48.tar.gz Tango-a5de87ea9863c6e7053e09ed1c2eabf58285af48.zip | |
PPC. Added Real Time Graph
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs | 22 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml | 5 |
2 files changed, 21 insertions, 6 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs index 3a0d3de9e..5fb4496e0 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs @@ -24,7 +24,18 @@ namespace Tango.Touch.Controls private const string PART_Rectangle = "PART_Rectangle"; private Line _line; private Object _lastSelectedItem; + + public int LineThickness + { + get { return (int)GetValue(LineThicknessProperty); } + set { SetValue(LineThicknessProperty, value); } + } + + // Using a DependencyProperty as the backing store for LineThickness. This enables animation, styling, binding, etc... + public static readonly DependencyProperty LineThicknessProperty = + DependencyProperty.Register("LineThickness", typeof(int), typeof(TouchNavigationLinks), new PropertyMetadata(3)); + static TouchNavigationLinks() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchNavigationLinks), new FrameworkPropertyMetadata(typeof(TouchNavigationLinks))); @@ -48,12 +59,14 @@ namespace Tango.Touch.Controls private void MoveLineToSelectedItem() { - if (SelectedItem != null) + if (SelectedItem != null ) { + if(SelectedItem is UIElement && ((UIElement)SelectedItem).IsEnabled == false) + return; var container = ItemContainerGenerator.ContainerFromItem(SelectedItem) as FrameworkElement; - + ContentPresenter presenter = container.FindChild<ContentPresenter>().FindChild<ContentPresenter>(); - + if (presenter != null) { Point relativePoint = presenter.TransformToAncestor(this).Transform(new Point(0, 0)); @@ -87,8 +100,9 @@ namespace Tango.Touch.Controls _line.BeginAnimation(Line.X2Property, aniX2); } } + _lastSelectedItem = SelectedItem; } - + _lastSelectedItem = SelectedItem; } } diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml index 599dfdf7c..2b8b4ff03 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml @@ -37,10 +37,11 @@ <Setter Property="BorderThickness" Value="1"/> <Setter Property="MinHeight" Value="40"></Setter> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="IsEnabled" Value="true"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListBoxItem}"> - <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true" IsEnabled="{TemplateBinding IsEnabled}"> <components:Ripple CornerRadius="5" RippleBrush="{StaticResource TangoRippleDarkBrush}"> <StackPanel Orientation="Horizontal"> <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> @@ -77,7 +78,7 @@ <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> <StackPanel> <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Stretch"/> - <Line x:Name="PART_Rectangle" X1="0" X2="0" Y1="0" Y2="0" Margin="0 5 0 -3" Stroke="{StaticResource TangoPrimaryAccentBrush}" StrokeThickness="3" HorizontalAlignment="Stretch"></Line> + <Line x:Name="PART_Rectangle" X1="0" X2="0" Y1="0" Y2="0" Margin="0 5 0 -3" Stroke="{StaticResource TangoPrimaryAccentBrush}" StrokeThickness="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNavigationLinks},Path=LineThickness}" HorizontalAlignment="Stretch"></Line> </StackPanel> </Border> </ControlTemplate> |
