ai优化11

This commit is contained in:
tanglong 2026-05-13 12:10:49 +08:00
parent b1ce0f4f62
commit daa1160c23
3 changed files with 18 additions and 6 deletions

View File

@ -114,7 +114,8 @@
Width="1474"
Height="580"
Background="Transparent"
RenderOptions.BitmapScalingMode="LowQuality"
RenderOptions.BitmapScalingMode="Linear"
UseLayoutRounding="True"
Focusable="True"
PreviewKeyDown="Carousel_PreviewKeyDown"
PreviewMouseWheel="Carousel_PreviewMouseWheel">

View File

@ -23,7 +23,7 @@ namespace Wpf_AiSportsMicrospace.MyUserControl
private const double CardWidth = 368;
private const double CardHeight = 534;
private const double CardGap = 30; // 卡片之间水平间距
private const double SlideDurationMs = 130; // 动画时长
private const double SlideDurationMs = 180; // 动画时长
private const double ProgressDurationMs = 2600;
public int SelectedIndex
@ -297,7 +297,7 @@ namespace Wpf_AiSportsMicrospace.MyUserControl
SetCard(CardSpare, incomingRight, XOffRight, 1);
var sb = new Storyboard { FillBehavior = FillBehavior.Stop };
var ease = new CubicEase { EasingMode = EasingMode.EaseOut };
var ease = new SineEase { EasingMode = EasingMode.EaseInOut };
var dur = TimeSpan.FromMilliseconds(SlideDurationMs);
void AddMove(FrameworkElement fe, double toX)
@ -379,7 +379,7 @@ namespace Wpf_AiSportsMicrospace.MyUserControl
SetCard(CardSpare, incomingFarLeft, XOffLeft, 1);
var sb = new Storyboard { FillBehavior = FillBehavior.Stop };
var ease = new CubicEase { EasingMode = EasingMode.EaseOut };
var ease = new SineEase { EasingMode = EasingMode.EaseInOut };
var dur = TimeSpan.FromMilliseconds(SlideDurationMs);
void AddMove(FrameworkElement fe, double toX)

View File

@ -136,7 +136,7 @@ namespace Wpf_AiSportsMicrospace
_lastMenuSlideTime = now;
_menuWaveConsumed = true;
_lastGestureAction = wavingaction;
Dispatcher.BeginInvoke(() => coverFlow.SlideRight(), DispatcherPriority.Input);
ExecuteMenuSlide(() => coverFlow.SlideRight());
break;
case WavingAction.RightWave: // 右手挥动
@ -149,7 +149,7 @@ namespace Wpf_AiSportsMicrospace
_lastMenuSlideTime = now;
_menuWaveConsumed = true;
_lastGestureAction = wavingaction;
Dispatcher.BeginInvoke(() => coverFlow.SlideLeft(), DispatcherPriority.Input);
ExecuteMenuSlide(() => coverFlow.SlideLeft());
break;
case WavingAction.FirstHand: // 举手开始
@ -183,6 +183,17 @@ namespace Wpf_AiSportsMicrospace
}
//测试点击
private void ExecuteMenuSlide(Action slideAction)
{
if (Dispatcher.CheckAccess())
{
slideAction();
return;
}
Dispatcher.BeginInvoke(slideAction, DispatcherPriority.Send);
}
private async void GoNew(object sender, MouseButtonEventArgs e)
{
RouterGoNew();