XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEEDToolBox

【WinUI】XFE精英危险工具箱

公开
关注 0 Fork 0 Star 0
UTF-8
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();
}