feat(06-03): add global site picker button and count label to toolbar

- Add Separator + Select Sites button (bound to OpenGlobalSitePickerCommand) to ToolBar
- Add TextBlock bound to GlobalSitesSelectedLabel for site count display
- Wire viewModel.OpenGlobalSitePickerDialog factory in MainWindow.xaml.cs using DI
- Add using SharepointToolbox.Core.Models for TenantProfile in code-behind
This commit is contained in:
Dev
2026-04-07 10:07:35 +02:00
parent 467a940c6f
commit 45eb531128
2 changed files with 15 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
using System.Windows;
using System.Windows.Controls;
using Microsoft.Extensions.DependencyInjection;
using SharepointToolbox.Core.Models;
using SharepointToolbox.ViewModels;
using SharepointToolbox.Views.Dialogs;
using SharepointToolbox.Views.Tabs;
@@ -20,6 +21,13 @@ public partial class MainWindow : Window
// Wire profile management dialog factory
viewModel.OpenProfileManagementDialog = () => serviceProvider.GetRequiredService<ProfileManagementDialog>();
// Wire global site picker dialog factory (same pattern as PermissionsView)
viewModel.OpenGlobalSitePickerDialog = () =>
{
var factory = serviceProvider.GetRequiredService<Func<TenantProfile, SitePickerDialog>>();
return factory(viewModel.SelectedProfile ?? new TenantProfile());
};
// Replace Permissions tab placeholder with the DI-resolved PermissionsView
PermissionsTabItem.Content = serviceProvider.GetRequiredService<PermissionsView>();