Click Events - WPF Timeline Control

Feb 21, 2012 at 5:35 PM
Edited Feb 21, 2012 at 5:36 PM

Is there anyway to know when an event has the mouse down occur?

I am using the WPF timeline control and the only event i can when adding an event is the Propertychanged event.

If this requires editing the actual source does anybody have the wpf control compiled with this event already implemented? 

Thanks,

Coordinator
Feb 23, 2012 at 5:22 PM

subscribe to events you need using these 2 events of TimelineTray:

        public event TimelineEventDelegate              OnEventCreated;
        public event TimelineEventDelegate              OnEventDeleted;

 

Feb 23, 2012 at 6:05 PM

OK thanks. So these events should fire when you click on an event in the timeline?

Coordinator
Feb 24, 2012 at 7:21 PM

They fire when event is created (meaning it is in, or close, to visible area), and when it is destroyed (meaning it is off the visible area). You can += / -= any even, you interested in, from these events.

Mar 14, 2012 at 2:10 PM
Edited Mar 14, 2012 at 2:56 PM

Thanks for the reply.. I was able to get the mouse down event working but i was unable to cast back to get the id of the timelinedisplayevent that was clicked.

This is the code that i am using to get the mouse down event working when a timeline event is clicked:

 

 

addhandler mytimeline.oneventcreated, addressof myeventcreated

Private sub myeventcreated(byval element as frameworkelement, de as timeline displayevent)

Addhandler element.mouseleftbuttonup, addressof individualeventclicked

end sub

Private sub individualeventclicked

'This fires when i click on a timeline event but i cant seem to get hold of the timelineevents id (or anything for that matter).
End Sub

 

Is there a way to get to the events.id or description from here?

 

Thanks,

 

**EDIT**

I found that this would get me the timelineevent id = 

 

Dim temp1 = Directcast(sender, Grid)
Dim temp2 = temp1.datacontext
Dim myid = temp2.id

Is this the correct way to do it or is there a better way?

 

thanks again.

Coordinator
Mar 14, 2012 at 5:32 PM

de is of TimelineDisplayEvent type and it has property Event which give you access to original even which has Id, etc. Let me know. Also DataContext of element should also be set to TimelineDisplayEvent.