コード例 #1
0
        private void TimelinePanel_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
        {
            List <UIElement> elements = new List <UIElement>(
                VisualTreeHelper.FindElementsInHostCoordinates(
                    e.GetPosition(Window.Current.Content), this));

            TimelineItem item = elements.Where(el => el is TimelineItem).FirstOrDefault() as TimelineItem;

            if (item != null)
            {
                ItemIndex = Children.IndexOf(item);
            }
        }
コード例 #2
0
        public UIElement AddElementToPanel(UIElement element)
        {
            if (!(element is TimelineItem))
            {
                var item = new TimelineItem();
                item.IsActionable = false;
                item.Content      = element;
                element           = item;
            }

            Children.Add(element);

            return(element);
        }