Esempio n. 1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            positioner   = GetTemplateChild("positioner") as Rectangle;
            dragRange    = GetTemplateChild("dragRange") as Grid;
            scrollBar    = GetTemplateChild("scrollBar") as ScrollBar;
            visualTracks = GetTemplateChild("visualTracks") as StackPanel;
            otherTracks  = GetTemplateChild("otherTracks") as StackPanel;


            this.MouseWheel  += TimeLine_MouseWheel;
            scrollBar.Scroll += ScrollBar_Scroll;

            dragRange.MouseLeftButtonDown += DragRange_MouseLeftButtonDown;
            dragRange.MouseLeftButtonUp   += DragRange_MouseLeftButtonUp;
            dragRange.MouseMove           += DragRange_MouseMove;

            this.PreviewMouseDown += TimeLine_PreviewMouseDown;

            this.SizeChanged += (s, e) =>
            {
                Tracks.ForEach(i => i.RelocationTrackItems());
                Track_ItemsMaxWidthChanged(null, null);
            };
        }
Esempio n. 2
0
        public void ImportData(List <ItemPosition> items, IEnumerable <StageComponent> MediaItems)
        {
            Dictionary <string, StageComponent> dictionary = MediaItems.ToDictionary(i => i.Id, i => i);

            foreach (ItemPosition item in items)
            {
                StageComponent component = dictionary[item.ItemId];
                AddItem(component, item);
            }

            Tracks.ForEach(i => i.RelocationTrackItems());
            Track_ItemsMaxWidthChanged(null, null);
        }
Esempio n. 3
0
 public void SetPosition(int position)
 {
     Tracks.ForEach(x => x.SetPosition(position));
 }