- Create Views/Tabs/SettingsView.xaml (UserControl with language ComboBox en/fr, DataFolder TextBox and Browse button using TranslationSource) - Create Views/Tabs/SettingsView.xaml.cs (DI constructor injection of SettingsViewModel, LoadAsync on Loaded) - Update MainWindow.xaml to add xmlns:views namespace and clear placeholder TextBlock from SettingsTabItem - Register SettingsView as Transient in DI; resolve and set as SettingsTabItem.Content from MainWindow constructor - All 42 unit tests pass, 0 build errors
29 lines
1.4 KiB
XML
29 lines
1.4 KiB
XML
<UserControl x:Class="SharepointToolbox.Views.Tabs.SettingsView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:loc="clr-namespace:SharepointToolbox.Localization">
|
|
<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>
|