diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.cs | 22 |
1 files changed, 18 insertions, 4 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; } } |
