/// <summary> /// 模板触发路由事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void viewBox_LeftMouseButtonDown(object sender, MouseButtonEventArgs e) { Viewbox viewBox = sender as Viewbox; VideoStateItem videoState = viewBox.DataContext as VideoStateItem; if (videoState != null && viewBox != null) { VideoStateAxisRoutedEventArgs args = new VideoStateAxisRoutedEventArgs(AxisDownRoutedEvent, this) { CameraChecked = videoState.CameraChecked, DownAndFavoirteHaveVideo = DownAndFavoriteHaveVideo(videoState.AxisHistoryTimeList) }; switch ((VideoAxisActionType)Enum.Parse(typeof(VideoAxisActionType), viewBox.Name)) { case VideoAxisActionType.Dwon: args.ActionType = VideoAxisActionType.Dwon; break; case VideoAxisActionType.Favorite: args.ActionType = VideoAxisActionType.Favorite; break; case VideoAxisActionType.Open: args.ActionType = VideoAxisActionType.Open; break; } this.RaiseEvent(args); } }
/// <summary> /// 发布指针拖动路由事件 /// </summary> private void SendDragTimeLineRoutedEvent() { VideoStateAxisRoutedEventArgs args = new VideoStateAxisRoutedEventArgs(DragTimeLineRoutedEvent, this) { TimeLine = AxisTime }; this.RaiseEvent(args); }