diff --git a/Wpf_AiSportsMicrospace/Resources/Img/gif/1.gif b/Wpf_AiSportsMicrospace/Resources/Img/gif/1.gif new file mode 100644 index 0000000..fa54d10 Binary files /dev/null and b/Wpf_AiSportsMicrospace/Resources/Img/gif/1.gif differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/gif/2.gif b/Wpf_AiSportsMicrospace/Resources/Img/gif/2.gif new file mode 100644 index 0000000..e514ee7 Binary files /dev/null and b/Wpf_AiSportsMicrospace/Resources/Img/gif/2.gif differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/gif/3.gif b/Wpf_AiSportsMicrospace/Resources/Img/gif/3.gif new file mode 100644 index 0000000..22f0150 Binary files /dev/null and b/Wpf_AiSportsMicrospace/Resources/Img/gif/3.gif differ diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml index 5778430..56423cc 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml +++ b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml @@ -4,19 +4,21 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Wpf_AiSportsMicrospace.Views" - mc:Ignorable="d"> + mc:Ignorable="d" Height="500" Width="800"> + + - + />--> diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs index 84cbb01..e8da202 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -10,8 +11,8 @@ using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; -using System.Windows.Shapes; using Wpf_AiSportsMicrospace.Common; +using WpfAnimatedGif; namespace Wpf_AiSportsMicrospace.Views { @@ -23,6 +24,14 @@ namespace Wpf_AiSportsMicrospace.Views public GroupJumpRope() { InitializeComponent(); + + var image = new BitmapImage(); + image.BeginInit(); + image.UriSource = new Uri("../../Resources/Img/gif/1.gif", UriKind.Relative); // 替换成你的 GIF 路径 + image.EndInit(); + + // 设置动画源 + ImageBehavior.SetAnimatedSource(GifImage, image); } } } diff --git a/Wpf_AiSportsMicrospace/Views/Main.xaml.cs b/Wpf_AiSportsMicrospace/Views/Main.xaml.cs index 0ead876..ec41cfe 100644 --- a/Wpf_AiSportsMicrospace/Views/Main.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/Main.xaml.cs @@ -25,7 +25,7 @@ namespace Wpf_AiSportsMicrospace.Views InitializeComponent(); // 默认显示首页 - MainContent.Content = new Home(); + MainContent.Content = new GroupJumpRope(); } public void SwitchPage(UserControl newPage, bool fromRight) { diff --git a/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj b/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj index 195ad12..c66c5f6 100644 --- a/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj +++ b/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj @@ -32,6 +32,9 @@ + + + @@ -55,6 +58,7 @@ + @@ -145,6 +149,15 @@ Always + + Always + + + Always + + + Always + Always