Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
523
Axis Selection on Entry Title Click
posted

Is it possible to cause an entries Axis Thumb to be selected when the corresponding entries title is clicked?

  • 17605
    Verified Answer
    posted

    You can try handling the Timeline MouseLeftButtonDown event and using this code:

    private void Timeline_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)

            {

                IEnumerable<UIElement> uiElements = VisualTreeHelper.FindElementsInHostCoordinates(e.GetPosition(null), this.Timeline);

     

                foreach (UIElement uiElement in uiElements)

                {

                    EventTitle eventTitle = uiElement as EventTitle;

                    if (eventTitle != null)

                    {

                        NumericTimeAxis axis = this.Timeline.Axis as NumericTimeAxis;

                        NumericTimeEntry entry = eventTitle.EventEntry as NumericTimeEntry;

     

                        axis.SelectedTime = entry.Time;

                    }

                }

            }