internal CalendarCellModel GetCellModelByPoint(Point lastPointPosition) { var hitTestPoint = TruncateToBounds(this.contentLayer.VisualElement as FrameworkElement, lastPointPosition); CalendarCellModel cellModel = HitTestService.GetCellFromPoint(hitTestPoint, this.Model.CalendarCells); return(cellModel); }
internal void OnContentPanelTapped(TappedRoutedEventArgs e) { if (this.displayModeCache != CalendarDisplayMode.MultiDayView) { CalendarCellModel cellModel = HitTestService.GetCellFromPoint(e.GetPosition(this.contentLayer.VisualElement), this.Model.CalendarCells); if (cellModel == null) { return; } this.RaiseCellTapCommand(cellModel); } else { Point hitPoint = e.GetPosition(this.timeRulerLayer.contentPanel); CalendarMultiDayViewModel multiDayViewModel = this.model.multiDayViewModel; hitPoint.X += multiDayViewModel.timeRulerWidth; var slotContext = this.hitTestService.GetSlotContextFromPoint(hitPoint); if (slotContext != null) { this.commandService.ExecuteCommand(CommandId.TimeSlotTap, slotContext); } } }
internal CalendarCellModel GetCellModelByPosition(PointerRoutedEventArgs e) { Point currentPoint = e.GetCurrentPoint(this.contentLayer.VisualElement).Position; var hitTestPoint = TruncateToBounds(this.contentLayer.VisualElement as FrameworkElement, currentPoint); CalendarCellModel cellModel = HitTestService.GetCellFromPoint(hitTestPoint, this.Model.CalendarCells); return(cellModel); }
internal void OnContentPanelTapped(TappedRoutedEventArgs e) { CalendarCellModel cellModel = HitTestService.GetCellFromPoint(e.GetPosition(this.contentLayer.VisualElement), this.Model.CalendarCells); if (cellModel == null) { return; } this.RaiseCellTapCommand(cellModel); }
internal bool OnContentPanelHolding(HoldingRoutedEventArgs e) { var hitPoint = e.GetPosition(this.calendarViewHost); var cellModel = HitTestService.GetCellFromPoint(hitPoint, this.model.CalendarCells); if (cellModel != null && this.SelectionMode == CalendarSelectionMode.Multiple && this.DisplayMode == CalendarDisplayMode.MonthView) { this.VisualStateService.UpdateHoldDecoration(cellModel); return(true); } return(false); }
internal void OnContentPanelPointerOver(PointerRoutedEventArgs e) { var hitPoint = e.GetCurrentPoint(this.calendarViewHost).Position; var cellModel = HitTestService.GetCellFromPoint(hitPoint, this.model.CalendarCells); if (cellModel != null && e.Pointer.PointerDeviceType != PointerDeviceType.Touch) { this.RaiseCellPointerOverCommand(cellModel); } else { this.VisualStateService.UpdateHoverDecoration(null); } }