Batch flip-view range updates for programmatic calendar navigation (#805)
* Batch calendar range updates during programmatic navigation * Refine programmatic calendar navigation batching state
This commit is contained in:
@@ -142,7 +142,14 @@ public partial class WinoCalendarControl : Control
|
||||
}
|
||||
|
||||
private void ManageHighlightedDateRange()
|
||||
=> SelectedFlipViewDayRange = InternalFlipView.SelectedItem as DayRangeRenderModel;
|
||||
{
|
||||
if (InternalFlipView?.IsProgrammaticNavigationInProgress == true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SelectedFlipViewDayRange = InternalFlipView?.SelectedItem as DayRangeRenderModel;
|
||||
}
|
||||
|
||||
private void DeregisterCanvas(WinoDayTimelineCanvas canvas)
|
||||
{
|
||||
@@ -190,14 +197,29 @@ public partial class WinoCalendarControl : Control
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
|
||||
if (InternalFlipView != null)
|
||||
{
|
||||
InternalFlipView.ProgrammaticNavigationCompleted -= InternalFlipViewProgrammaticNavigationCompleted;
|
||||
}
|
||||
|
||||
InternalFlipView = GetTemplateChild(PART_WinoFlipView) as WinoCalendarFlipView;
|
||||
IdleGrid = GetTemplateChild(PART_IdleGrid) as Grid;
|
||||
|
||||
if (InternalFlipView != null)
|
||||
{
|
||||
InternalFlipView.ProgrammaticNavigationCompleted += InternalFlipViewProgrammaticNavigationCompleted;
|
||||
}
|
||||
|
||||
UpdateIdleState();
|
||||
ManageCalendarOrientation();
|
||||
ManageDisplayType();
|
||||
}
|
||||
|
||||
private void InternalFlipViewProgrammaticNavigationCompleted(object? sender, ProgrammaticNavigationCompletedEventArgs e)
|
||||
{
|
||||
SelectedFlipViewDayRange = e.DayRange;
|
||||
}
|
||||
|
||||
private void UpdateIdleState()
|
||||
{
|
||||
InternalFlipView.Opacity = IsFlipIdle ? 0 : 1;
|
||||
|
||||
Reference in New Issue
Block a user