using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media.Animation; using RblxTool.Services; using RblxTool.Views; namespace RblxTool; public sealed partial class MainWindow : Window { public MainWindow() { InitializeComponent(); ExtendsContentIntoTitleBar = true; SetTitleBar(TitleBarArea); Title = "rblxtool"; AppState.Current.AccountsChanged += RefreshActiveAccount; RefreshActiveAccount(); Nav.SelectedItem = Nav.MenuItems[0]; } private void RefreshActiveAccount() { var active = AppState.Current.Active; ActiveAccountText.Text = active is null ? "no account selected" : $"{active.Username} ({active.UserId})"; } private void OnNavSelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) { if (args.SelectedItem is not NavigationViewItem item || item.Tag is not string tag) { return; } var target = tag switch { "accounts" => typeof(AccountsPage), "sweep" => typeof(SweepPage), "sniper" => typeof(SniperPage), "groups" => typeof(GroupsPage), _ => typeof(DashboardPage), }; if (ContentFrame.CurrentSourcePageType != target) { ContentFrame.Navigate(target, null, new EntranceNavigationTransitionInfo()); } } }