using Microsoft.UI.Xaml.Automation.Peers; using Microsoft.UI.Xaml.Automation.Provider; using Microsoft.UI.Xaml.Media; using XFEEDToolBox.Controls; namespace XFEEDToolBox; public partial class App { private static async Task RunEngineeringGradeProbeAsync(string directory) { static void Require(bool value,string message){if(!value)throw new InvalidOperationException(message);} Require(ViewModel.OfflinePreview,"Grade inspection requires an isolated offline preview."); var shell=Views.AppShellPage.Current!;shell.Navigate(typeof(Views.RefitPage));await Task.Delay(180); ViewModel.RefitEdsyLink="https://edsy.org/#/L=K100000H4C0S00,FBR00FBR00,,9p300A4Y00AKA00AZo00Ans00B1U00BH600BWQ00,,7Og0003w00mpU0nG0-0nF0-"; await ViewModel.ImportEdsyCommand.ExecuteAsync(null);ViewModel.RefitCategoryIndex=2;await Task.Delay(150); ViewModel.RefitSlot=ViewModel.RefitVisibleSlots.First(s=>s.Module?.Slot=="FrameShiftDrive"); var refit=(Views.RefitPage)shell.CurrentPage!;var tabs=(SelectorBar)refit.FindName("InspectorTabs");tabs.SelectedItem=tabs.Items[1]; MainWindow.AppWindow.Resize(new(2200,1500));MainWindow.AppWindow.Show(false);await Task.Delay(250);refit.UpdateLayout(); var bound=(EngineeringGradePicker)refit.FindName("EngineeringGrade");ViewModel.RefitGrade=5;await Task.Delay(100); Require(bound.IsEnabled&&bound.Value==5,"Editor target grade did not reach the real picker."); ((IInvokeProvider)new ButtonAutomationPeer(Descendants(bound).OfType