aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.BL/DTO/ApplicationDisplayPanelVersionDTOBase.cs
blob: 353d08e6569dcd1934542b4a3c6709d53f914a23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Tango Observables Generator
// 
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. Do not modify!
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;

namespace Tango.BL.DTO
{
    public abstract class ApplicationDisplayPanelVersionDTOBase : ObservableEntityDTO<ApplicationDisplayPanelVersionDTO, ApplicationDisplayPanelVersion>
    {

        /// <summary>
        /// version
        /// </summary>
        public Double Version 
        {
            get; set; 
        }

        /// <summary>
        /// name
        /// </summary>
        public String Name 
        {
            get; set; 
        }

    }
}
n> public class TouchNavigationLinks : ListBox { private const string PART_Rectangle = "PART_Rectangle"; private Line _line; private Object _lastSelectedItem; static TouchNavigationLinks() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchNavigationLinks), new FrameworkPropertyMetadata(typeof(TouchNavigationLinks))); } public TouchNavigationLinks() { SelectionChanged += NavigationLinks_SelectionChanged; Loaded += (_, __) => MoveLineToSelectedItem(); } public override void OnApplyTemplate() { _line = GetTemplateChild(PART_Rectangle) as Line; } private void NavigationLinks_SelectionChanged(object sender, SelectionChangedEventArgs e) { MoveLineToSelectedItem(); } private void MoveLineToSelectedItem() { if (SelectedItem != null) { 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)); double width = presenter.ActualWidth; if (_lastSelectedItem != null && Items.IndexOf(SelectedItem) > Items.IndexOf(_lastSelectedItem)) { DoubleAnimation aniX2 = new DoubleAnimation(); aniX2.To = relativePoint.X + width; aniX2.Duration = TimeSpan.FromSeconds(0.2); _line.BeginAnimation(Line.X2Property, aniX2); DoubleAnimation aniX1 = new DoubleAnimation(); aniX1.To = relativePoint.X; aniX1.BeginTime = TimeSpan.FromSeconds(0.2); aniX1.Duration = TimeSpan.FromSeconds(0.1); _line.BeginAnimation(Line.X1Property, aniX1); } else { DoubleAnimation aniX1 = new DoubleAnimation(); aniX1.To = relativePoint.X; aniX1.Duration = TimeSpan.FromSeconds(0.2); _line.BeginAnimation(Line.X1Property, aniX1); DoubleAnimation aniX2 = new DoubleAnimation(); aniX2.To = relativePoint.X + width; aniX2.BeginTime = TimeSpan.FromSeconds(0.2); aniX2.Duration = TimeSpan.FromSeconds(0.1); _line.BeginAnimation(Line.X2Property, aniX2); } } } _lastSelectedItem = SelectedItem; } } }