using XFEEDToolBox.ViewModels; namespace XFEEDToolBox.Views; public sealed partial class GalaxyMapPage : Page { public ToolboxViewModel ViewModel=>App.ViewModel; public GalaxyMapPage(){InitializeComponent();NavigationCacheMode=Microsoft.UI.Xaml.Navigation.NavigationCacheMode.Required;Map.SystemSelected+=(_,s)=>ViewModel.GalaxySelection=s;} protected override void OnNavigatedTo(Microsoft.UI.Xaml.Navigation.NavigationEventArgs e){base.OnNavigatedTo(e);Map.ResumePage();} protected override void OnNavigatedFrom(Microsoft.UI.Xaml.Navigation.NavigationEventArgs e){base.OnNavigatedFrom(e);Map.SuspendPage();} private async void SearchSubmitted(AutoSuggestBox sender,AutoSuggestBoxQuerySubmittedEventArgs e)=>await ViewModel.SearchGalaxyCommand.ExecuteAsync(null); private void ZoomIn(object sender,RoutedEventArgs e)=>Map.Zoom(1.5); private void ZoomOut(object sender,RoutedEventArgs e)=>Map.Zoom(1/1.5); private void ResetCamera(object sender,RoutedEventArgs e)=>Map.ResetCamera(); }