using Microsoft.UI.Composition; using Microsoft.UI.Xaml.Media; using SpaceEngineersBlueprintEditor.ViewModels; using XFEExtension.NetCore.WinUIHelper.Utilities; namespace SpaceEngineersBlueprintEditor.Views; /// /// 主页面 /// public sealed partial class MainPage : Page { public static MainPage? Current { get; set; } public MainPageViewModel ViewModel { get; set; } = new(); public MainPage() { PageManager.AddOrUpdateCurrentPage(Current = this); this.InitializeComponent(); var compositor = CompositionTarget.GetCompositorForCurrentThread(); ViewModel.FileDropService.Initialize(blueprintDragGrid, compositor); var expressionAnimation = compositor.CreateExpressionAnimation(); expressionAnimation.Expression = "(dragElement.Scale.Y - 1) * 200"; expressionAnimation.Target = "Translation.Y"; expressionAnimation.SetExpressionReferenceParameter("dragElement", blueprintDragGrid); viewBlueprintsList.StartAnimation(expressionAnimation); openLocalFile.StartAnimation(expressionAnimation); } }