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:
@@ -22,6 +22,13 @@
|
||||
<Separator />
|
||||
<Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[toolbar.clear]}"
|
||||
Command="{Binding ClearSessionCommand}" />
|
||||
<Separator />
|
||||
<Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[toolbar.selectSites]}"
|
||||
Command="{Binding OpenGlobalSitePickerCommand}"
|
||||
ToolTip="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[toolbar.selectSites.tooltip]}" />
|
||||
<TextBlock Text="{Binding GlobalSitesSelectedLabel}"
|
||||
VerticalAlignment="Center" Margin="6,0,0,0"
|
||||
Foreground="Gray" />
|
||||
</ToolBar>
|
||||
|
||||
<!-- StatusBar: tenant name | operation status text | progress % -->
|
||||
|
||||
@@ -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>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user