Ejemplo n.º 1
0
        private void UpdateItems()
        {
            IEnumerable <object> items = ItemsSource as IEnumerable <object>;

            if (items == null)
            {
                return;
            }

            if (TimelinePanel == null)
            {
                return;
            }

            TimelinePanel.Children.Clear();
            if (HeaderContent != null)
            {
                TimelinePanel.AddElementToPanel(HeaderContent);
            }

            foreach (var item in items)
            {
                TimelinePanel.AddElementToPanel(CreateItem(item));
            }
        }
Ejemplo n.º 2
0
        protected override void OnApplyTemplate()
        {
            if (TimelinePanel != null)
            {
                // clean up
                TimelinePanel.Children.Clear();
            }

            TimelinePanel = this.GetTemplateChild(PartTimelinePanel) as TimelinePanel;

            if (TimelinePanel != null)
            {
                TimelinePanel.Orientation = Orientation;
                UpdateItems();
                TimelinePanel.ItemIndex = CurrentItemIndex;
            }

            KeyDown += Timeline_KeyDown;
            KeyUp   += Timeline_KeyUp;

            base.OnApplyTemplate();
        }