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); } }
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); }