Language ComboBox selection sets TranslationSource.Instance.CurrentCulture
TranslationSource
from
to
via
pattern
SharepointToolbox/Views/MainWindow.xaml
SharepointToolbox/Views/Tabs/SettingsView.xaml
Settings TabItem ContentTemplate or direct UserControl reference
SettingsView
Build the two user-facing views completing Phase 1 UX: ProfileManagementDialog (profile CRUD modal) and SettingsView (language + data folder). Wire SettingsView into the MainWindow Settings tab.
Purpose: These are the last two user-visible pieces before the visual checkpoint. After this plan the application is functional enough for a human to create a tenant profile, connect, and switch language.
Output: ProfileManagementDialog + SettingsView wired into the shell.
@.planning/PROJECT.md
@.planning/phases/01-foundation/01-CONTEXT.md
@.planning/phases/01-foundation/01-06-SUMMARY.md
```csharp
public class ProfileManagementViewModel : ObservableObject
{
public ObservableCollection Profiles { get; }
public TenantProfile? SelectedProfile { get; set; }
public string NewName { get; set; }
public string NewTenantUrl { get; set; }
public string NewClientId { get; set; }
public IAsyncRelayCommand AddCommand { get; }
public IAsyncRelayCommand RenameCommand { get; }
public IAsyncRelayCommand DeleteCommand { get; }
}
```
publicclassSettingsViewModel:FeatureViewModelBase{publicstringSelectedLanguage{get;set;}// "en" or "fr"publicstringDataFolder{get;set;}publicRelayCommandBrowseFolderCommand{get;}}
// ProfileManagementDialog: modal Window, fields: Name + Tenant URL + Client ID
// Profile fields: { name, tenantUrl, clientId } — JSON schema
// SettingsView: language ComboBox (English/French) + DataFolder TextBox + Browse button
// Language switch: immediate, no restart, via TranslationSource.Instance.CurrentCulture
cd "C:\Users\dev\Documents\projets\Sharepoint" && dotnet build SharepointToolbox/SharepointToolbox.csproj 2>&1 | tail -5
Build succeeds. ProfileManagementDialog.xaml contains all three input fields (Name, Tenant URL, Client ID). All labels use TranslationSource bindings.
Task 2: SettingsView XAML and MainWindow Settings tab wiring
SharepointToolbox/Views/Tabs/SettingsView.xaml,
SharepointToolbox/Views/Tabs/SettingsView.xaml.cs,
SharepointToolbox/Views/MainWindow.xaml
Create `Views/Tabs/` directory.
**SettingsView.xaml** — UserControl (embedded in TabItem):
```xml
<UserControl x:Class="SharepointToolbox.Views.Tabs.SettingsView">
<StackPanel Margin="16">
<!-- Language -->
<Label Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[settings.language]}" />
<ComboBox Width="200" HorizontalAlignment="Left"
SelectedValue="{Binding SelectedLanguage}"
SelectedValuePath="Tag">
<ComboBoxItem Tag="en"
Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[settings.lang.en]}" />
<ComboBoxItem Tag="fr"
Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[settings.lang.fr]}" />
</ComboBox>
<Separator Margin="0,12" />
<!-- Data folder -->
<Label Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[settings.folder]}" />
<DockPanel>
<Button DockPanel.Dock="Right"
Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[settings.browse]}"
Command="{Binding BrowseFolderCommand}" Width="80" Margin="8,0,0,0" />
<TextBox Text="{Binding DataFolder, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
</StackPanel>
</UserControl>
```
**SettingsView.xaml.cs**: Constructor receives `SettingsViewModel` via DI. Sets `DataContext = viewModel`. Calls `viewModel.LoadAsync()` in `Loaded` event to populate current settings.
Add `LoadAsync()` to SettingsViewModel if not present — loads current settings from SettingsService and sets `SelectedLanguage` and `DataFolder` properties.
**MainWindow.xaml** — Update Settings TabItem to use SettingsView (replace placeholder TextBlock):
```xml
<TabItem Header="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[tab.settings]}">
<views:SettingsView />
</TabItem>
```
Add namespace: `xmlns:views="clr-namespace:SharepointToolbox.Views.Tabs"`
Also register `SettingsView` in DI in App.xaml.cs (if not already):
```csharp
services.AddTransient<SettingsView>();
```
And resolve it in MainWindow constructor to inject into the Settings TabItem Content, OR use a DataTemplate approach. The simpler approach for Phase 1: resolve `SettingsView` from DI in `MainWindow.xaml.cs` constructor and set it as the TabItem Content directly:
```csharp
SettingsTabItem.Content = serviceProvider.GetRequiredService<SettingsView>();
```
Add `x:Name="SettingsTabItem"` to the Settings TabItem in XAML.
Run `dotnet build` and fix any errors.
cd "C:\Users\dev\Documents\projets\Sharepoint" && dotnet build SharepointToolbox/SharepointToolbox.csproj 2>&1 | tail -5
Build succeeds. SettingsView.xaml contains language ComboBox with "en"/"fr" options and data folder TextBox with Browse button. MainWindow.xaml Settings tab shows SettingsView (not placeholder TextBlock).
- `dotnet build SharepointToolbox.sln` passes with 0 errors
- `dotnet test --filter "Category=Unit"` still passes (no regressions)
- ProfileManagementDialog has all three input fields using TranslationSource keys
- SettingsView language ComboBox has Tag="en" and Tag="fr" items
- MainWindow Settings TabItem Content is SettingsView (not placeholder)
<success_criteria>
All Phase 1 UI is built. Application runs and shows: shell with 8 tabs, log panel, status bar, language switching, profile management dialog, and settings. Ready for the visual checkpoint in plan 01-08.
</success_criteria>
After completion, create `.planning/phases/01-foundation/01-07-SUMMARY.md`