public SchedulerSelectionChangedEventArgs(SchedulerItem selectedItem) { SelectedItem = selectedItem; }
void SchedulerItemsControl_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { var hitTest = VisualTreeHelper.HitTest(this, e.GetPosition(this)); var hitTestResult = VisualTreeHelper.GetParent(VisualTreeHelper.GetParent(VisualTreeHelper.GetParent(hitTest.VisualHit))) as SchedulerItem; if (hitTestResult != null) { SelectedItem = hitTestResult; startDragPosition = e.GetPosition(null); } }
private void OnSelectionChanged(SchedulerItem selectedItem) { var handler = SelectionChanged; if (handler != null) { handler(this, new SchedulerSelectionChangedEventArgs(selectedItem)); } }
void SchedulerItemsControl_MouseUp(object sender, MouseButtonEventArgs e) { var hitTest = VisualTreeHelper.HitTest(this, e.GetPosition(this)); var hitTestResult = VisualTreeHelper.GetParent(VisualTreeHelper.GetParent(VisualTreeHelper.GetParent(hitTest.VisualHit))) as SchedulerItem; if (hitTestResult != null) { SelectedItem = hitTestResult; } }
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); var hitTest = VisualTreeHelper.HitTest(this, e.GetPosition(this)); var hitTestResult = VisualTreeHelper.GetParent(VisualTreeHelper.GetParent(VisualTreeHelper.GetParent(hitTest.VisualHit))) as SchedulerItem; if (hitTestResult != null) { SelectedItem = hitTestResult; startDragPosition = e.GetPosition(null); } }