From deb565fcc57405616d040276b9edddaa0acab15f Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Wed, 14 Jun 2023 23:07:54 +0200 Subject: [PATCH 01/14] Use proper properties for settings Implement basic setting mvvm --- .../Properties/Properties.Designer.cs | 45 ++++++++ .../Properties/Properties.resx | 15 +++ .../ViewModels/SettingsWindowViewModel.cs | 106 +++++++----------- 3 files changed, 102 insertions(+), 64 deletions(-) diff --git a/src/XmlFormatterOsIndependent/Properties/Properties.Designer.cs b/src/XmlFormatterOsIndependent/Properties/Properties.Designer.cs index 56e8eaf..9ae8a45 100644 --- a/src/XmlFormatterOsIndependent/Properties/Properties.Designer.cs +++ b/src/XmlFormatterOsIndependent/Properties/Properties.Designer.cs @@ -104,5 +104,50 @@ public static string GitHub_Project { return ResourceManager.GetString("GitHub_Project", resourceCulture); } } + + /// + /// Looks up a localized string similar to AskBeforeClosing. + /// + public static string Setting_Ask_Before_Closing_Key { + get { + return ResourceManager.GetString("Setting_Ask_Before_Closing_Key", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Default. + /// + public static string Setting_Default_Scope { + get { + return ResourceManager.GetString("Setting_Default_Scope", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SearchUpdateOnStartup. + /// + public static string Setting_Search_Update_On_Startup_Key { + get { + return ResourceManager.GetString("Setting_Search_Update_On_Startup_Key", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Theme. + /// + public static string Setting_Theme_Key { + get { + return ResourceManager.GetString("Setting_Theme_Key", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to UpdateStrategy. + /// + public static string Setting_Update_Strategy_Key { + get { + return ResourceManager.GetString("Setting_Update_Strategy_Key", resourceCulture); + } + } } } diff --git a/src/XmlFormatterOsIndependent/Properties/Properties.resx b/src/XmlFormatterOsIndependent/Properties/Properties.resx index 47a85d1..84afb87 100644 --- a/src/XmlFormatterOsIndependent/Properties/Properties.resx +++ b/src/XmlFormatterOsIndependent/Properties/Properties.resx @@ -132,4 +132,19 @@ https://github.com/XanatosX/XmlFormatter + + AskBeforeClosing + + + Default + + + SearchUpdateOnStartup + + + Theme + + + UpdateStrategy + \ No newline at end of file diff --git a/src/XmlFormatterOsIndependent/ViewModels/SettingsWindowViewModel.cs b/src/XmlFormatterOsIndependent/ViewModels/SettingsWindowViewModel.cs index 0db5a65..d5832c0 100644 --- a/src/XmlFormatterOsIndependent/ViewModels/SettingsWindowViewModel.cs +++ b/src/XmlFormatterOsIndependent/ViewModels/SettingsWindowViewModel.cs @@ -1,12 +1,13 @@ -using CommunityToolkit.Mvvm.Input; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; using PluginFramework.DataContainer; using PluginFramework.Interfaces.Manager; using PluginFramework.Interfaces.PluginTypes; -using ReactiveUI; +using System; using System.Collections.Generic; using System.Linq; +using System.Reactive.Linq; using XmlFormatterModel.Setting; -using XmlFormatterOsIndependent.Commands; using XmlFormatterOsIndependent.Enums; using XmlFormatterOsIndependent.Services; @@ -15,7 +16,7 @@ namespace XmlFormatterOsIndependent.ViewModels /// /// View model class for the settings window /// - public partial class SettingsWindowViewModel : ViewModelBase + public partial class SettingsWindowViewModel : ObservableObject { /// @@ -23,75 +24,42 @@ public partial class SettingsWindowViewModel : ViewModelBase /// public List List { get; } - /// - /// Ask before closing setting - /// - public bool AskBeforeClosing - { - get => askBeforeClosing; - set => this.RaiseAndSetIfChanged(ref askBeforeClosing, value); - } /// /// Private acces for ask before closing setting /// + [ObservableProperty] private bool askBeforeClosing; - /// - /// The selected theme index - /// - public int ThemeMode - { - get => themeMode; - set => this.RaiseAndSetIfChanged(ref themeMode, value); - } /// /// Private selected theme index /// + [ObservableProperty] private int themeMode; - /// - /// Check for updates on start - /// - public bool CheckUpdateOnStart - { - get => checkUpdateOnStart; - set => this.RaiseAndSetIfChanged(ref checkUpdateOnStart, value); - } /// /// Private check for updates on start /// + [ObservableProperty] private bool checkUpdateOnStart; - /// - /// The current updater to use - /// - public PluginMetaData Updater - { - get => updater; - set => this.RaiseAndSetIfChanged(ref updater, value); - } /// /// Private updater to use /// + [ObservableProperty] private PluginMetaData updater; - /// - /// Index of the selected updater - /// - public int UpdaterIndex - { - get => updaterIndex; - set => this.RaiseAndSetIfChanged(ref updaterIndex, value); - } /// /// Private index of the selected updater /// + [ObservableProperty] private int updaterIndex; /// /// The setting scope of this application /// private readonly ISettingScope applicationScope; + private readonly ISettingsManager settingsManager; + private readonly IPathService pathService; private readonly IWindowApplicationService applicationService; private readonly IThemeService themeService; @@ -101,26 +69,33 @@ public int UpdaterIndex /// The view for this model /// The settings manager to use /// The plugin manager to use - public SettingsWindowViewModel(ISettingsManager settingsManager, IPluginManager pluginManager, IWindowApplicationService applicationService, IThemeService themeService) - : base(settingsManager, pluginManager) + public SettingsWindowViewModel( + ISettingsManager settingsManager, + IPathService pathService, + IPluginManager pluginManager, + IWindowApplicationService applicationService, + IThemeService themeService) { + this.settingsManager = settingsManager; + this.pathService = pathService; + this.applicationService = applicationService; + this.themeService = themeService; - if (this.settingsManager == null || this.pluginManager == null) + if (settingsManager == null || pluginManager == null) { return; } - this.settingsManager.Load(settingsPath); - applicationScope = this.settingsManager.GetScope("Default"); + settingsManager.Load(pathService.GetSettingsFile()); + applicationScope = settingsManager.GetScope(Properties.Properties.Setting_Default_Scope); List = pluginManager.ListPlugins().ToList(); if (applicationScope == null) { - applicationScope = new SettingScope("Default"); - this.settingsManager.AddScope(applicationScope); + applicationScope = new SettingScope(Properties.Properties.Setting_Default_Scope); + settingsManager.AddScope(applicationScope); } LoadSettings(); - this.applicationService = applicationService; - this.themeService = themeService; + } /// @@ -128,13 +103,16 @@ public SettingsWindowViewModel(ISettingsManager settingsManager, IPluginManager /// private void LoadSettings() { - AskBeforeClosing = GetSettingsValue("AskBeforeClosing"); - CheckUpdateOnStart = GetSettingsValue("SearchUpdateOnStartup"); - IDataCommand getTheme = new GetThemeCommand(); - ExecuteCommand(getTheme, settingsManager); - ThemeMode = (int)getTheme.GetData(); + AskBeforeClosing = GetSettingsValue(Properties.Properties.Setting_Ask_Before_Closing_Key); + CheckUpdateOnStart = GetSettingsValue(Properties.Properties.Setting_Search_Update_On_Startup_Key); + + var scope = settingsManager.GetScope(Properties.Properties.Setting_Default_Scope); + string mode = scope.GetSetting(Properties.Properties.Setting_Theme_Key)?.GetValue() ?? ThemeEnum.Light.ToString(); + Enum.TryParse(typeof(ThemeEnum), mode, out var theme); + + ThemeMode = (int)(theme ?? ThemeEnum.Light); - string updater = GetSettingsValue("UpdateStrategy"); + string updater = GetSettingsValue(Properties.Properties.Setting_Update_Strategy_Key); int updaterToUse = -1; if (List.Count > 0) { @@ -181,10 +159,10 @@ public void SaveAndClose() { ThemeEnum theme = ThemeMode == 0 ? ThemeEnum.Light : ThemeEnum.Dark; - ISettingPair askClose = new SettingPair("AskBeforeClosing"); - ISettingPair searchUpdate = new SettingPair("SearchUpdateOnStartup"); - ISettingPair updater = new SettingPair("UpdateStrategy"); - ISettingPair themeMode = new SettingPair("Theme"); + ISettingPair askClose = new SettingPair(Properties.Properties.Setting_Ask_Before_Closing_Key); + ISettingPair searchUpdate = new SettingPair(Properties.Properties.Setting_Search_Update_On_Startup_Key); + ISettingPair updater = new SettingPair(Properties.Properties.Setting_Update_Strategy_Key); + ISettingPair themeMode = new SettingPair(Properties.Properties.Setting_Theme_Key); askClose.SetValue(AskBeforeClosing); searchUpdate.SetValue(CheckUpdateOnStart); updater.SetValue(Updater.Type.ToString()); @@ -196,7 +174,7 @@ public void SaveAndClose() applicationScope.AddSetting(searchUpdate); applicationScope.AddSetting(updater); applicationScope.AddSetting(themeMode); - settingsManager.Save(settingsPath); + settingsManager.Save(pathService.GetSettingsFile()); CloseWindowCommand.Execute(null); } } From 35f9f1540206ad55257d844b14a4ff54b7d91ee5 Mon Sep 17 00:00:00 2001 From: XanatosX <10531466+XanatosX@users.noreply.github.com> Date: Sun, 25 Jun 2023 23:10:46 +0200 Subject: [PATCH 02/14] Start to rework settings window Change orientation Add new window for application settings Move main code for application settings to new window Add translation for main window Prepare view for import and export funcations --- .../DepenendyInjectionExtensions.cs | 6 +- .../Properties/Resources.Designer.cs | 63 +++++++++ .../Properties/Resources.resx | 21 +++ .../ApplicationSettingsViewModel.cs | 85 ++++++++++++ .../ViewModels/PluginMetaDataViewModel.cs | 23 ++++ .../ViewModels/SettingsWindowViewModel.cs | 122 ++---------------- .../Views/ApplicationSettingsView.axaml | 26 ++++ .../Views/ApplicationSettingsView.axaml.cs | 16 +++ .../Views/PluginMetaDataView.axaml | 8 ++ .../Views/PluginMetaDataView.axaml.cs | 15 +++ .../Views/SettingsWindow.xaml | 53 +++----- 11 files changed, 292 insertions(+), 146 deletions(-) create mode 100644 src/XmlFormatterOsIndependent/ViewModels/ApplicationSettingsViewModel.cs create mode 100644 src/XmlFormatterOsIndependent/ViewModels/PluginMetaDataViewModel.cs create mode 100644 src/XmlFormatterOsIndependent/Views/ApplicationSettingsView.axaml create mode 100644 src/XmlFormatterOsIndependent/Views/ApplicationSettingsView.axaml.cs create mode 100644 src/XmlFormatterOsIndependent/Views/PluginMetaDataView.axaml create mode 100644 src/XmlFormatterOsIndependent/Views/PluginMetaDataView.axaml.cs diff --git a/src/XmlFormatterOsIndependent/DependencyInjection/DepenendyInjectionExtensions.cs b/src/XmlFormatterOsIndependent/DependencyInjection/DepenendyInjectionExtensions.cs index 4eac892..a549753 100644 --- a/src/XmlFormatterOsIndependent/DependencyInjection/DepenendyInjectionExtensions.cs +++ b/src/XmlFormatterOsIndependent/DependencyInjection/DepenendyInjectionExtensions.cs @@ -70,7 +70,8 @@ public static IServiceCollection AddViews(this IServiceCollection collection) return collection.AddTransient() .AddTransient() .AddTransient() - .AddTransient(); + .AddTransient() + .AddTransient(); } /// @@ -83,6 +84,7 @@ public static IServiceCollection AddViewModels(this IServiceCollection collectio return collection.AddTransient() .AddTransient() .AddTransient() - .AddTransient(); + .AddTransient() + .AddTransient(); } } diff --git a/src/XmlFormatterOsIndependent/Properties/Resources.Designer.cs b/src/XmlFormatterOsIndependent/Properties/Resources.Designer.cs index a9a87b8..ff6dfe5 100644 --- a/src/XmlFormatterOsIndependent/Properties/Resources.Designer.cs +++ b/src/XmlFormatterOsIndependent/Properties/Resources.Designer.cs @@ -212,5 +212,68 @@ public static string PluginManagerWindow_Title { return ResourceManager.GetString("PluginManagerWindow_Title", resourceCulture); } } + + /// + /// Looks up a localized string similar to Close. + /// + public static string SettingsWindow_Close { + get { + return ResourceManager.GetString("SettingsWindow_Close", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Save and Close. + /// + public static string SettingsWindow_SaveAndClose { + get { + return ResourceManager.GetString("SettingsWindow_SaveAndClose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Application. + /// + public static string SettingsWindow_Tab_Application { + get { + return ResourceManager.GetString("SettingsWindow_Tab_Application", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Backup. + /// + public static string SettingsWindow_Tab_Backup { + get { + return ResourceManager.GetString("SettingsWindow_Tab_Backup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hotfolder. + /// + public static string SettingsWindow_Tab_Hotfolder { + get { + return ResourceManager.GetString("SettingsWindow_Tab_Hotfolder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Logging. + /// + public static string SettingsWindow_Tab_Logging { + get { + return ResourceManager.GetString("SettingsWindow_Tab_Logging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Settings. + /// + public static string SettingsWindow_Title { + get { + return ResourceManager.GetString("SettingsWindow_Title", resourceCulture); + } + } } } diff --git a/src/XmlFormatterOsIndependent/Properties/Resources.resx b/src/XmlFormatterOsIndependent/Properties/Resources.resx index e24dafd..427912b 100644 --- a/src/XmlFormatterOsIndependent/Properties/Resources.resx +++ b/src/XmlFormatterOsIndependent/Properties/Resources.resx @@ -168,4 +168,25 @@ Plugin Manager + + Close + + + Save and Close + + + Application + + + Backup + + + Hotfolder + + + Logging + + + Settings + \ No newline at end of file diff --git a/src/XmlFormatterOsIndependent/ViewModels/ApplicationSettingsViewModel.cs b/src/XmlFormatterOsIndependent/ViewModels/ApplicationSettingsViewModel.cs new file mode 100644 index 0000000..e8fd3fa --- /dev/null +++ b/src/XmlFormatterOsIndependent/ViewModels/ApplicationSettingsViewModel.cs @@ -0,0 +1,85 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using PluginFramework.DataContainer; +using PluginFramework.Interfaces.Manager; +using PluginFramework.Interfaces.PluginTypes; +using System; +using System.Collections.Generic; +using System.Linq; +using XmlFormatterModel.Setting; +using XmlFormatterOsIndependent.Enums; +using XmlFormatterOsIndependent.Services; + +namespace XmlFormatterOsIndependent.ViewModels; +internal partial class ApplicationSettingsViewModel : ObservableObject +{ + [ObservableProperty] + private List availableUpdaters; + + [ObservableProperty] + private PluginMetaDataViewModel? updater; + + /// + /// Private acces for ask before closing setting + /// + [ObservableProperty] + private bool askBeforeClosing; + + /// + /// Private selected theme index + /// + [ObservableProperty] + private int themeMode; + + /// + /// Private check for updates on start + /// + [ObservableProperty] + private bool checkUpdateOnStart; + + private readonly ISettingScope applicationScope; + private readonly ISettingsManager settingsManager; + + public ApplicationSettingsViewModel(ISettingsManager settingsManager, + IPathService pathService, + IPluginManager pluginManager) + { + this.settingsManager = settingsManager; + + AvailableUpdaters = pluginManager.ListPlugins() + .OfType() + .Select(entry => new PluginMetaDataViewModel(entry)) + .ToList(); + + Updater = AvailableUpdaters.FirstOrDefault(); + applicationScope = settingsManager.GetScope(Properties.Properties.Setting_Default_Scope); + + LoadSettings(); + } + + private void LoadSettings() + { + AskBeforeClosing = GetSettingsValue(Properties.Properties.Setting_Ask_Before_Closing_Key); + CheckUpdateOnStart = GetSettingsValue(Properties.Properties.Setting_Search_Update_On_Startup_Key); + + var scope = settingsManager.GetScope(Properties.Properties.Setting_Default_Scope); + string mode = scope.GetSetting(Properties.Properties.Setting_Theme_Key)?.GetValue() ?? ThemeEnum.Light.ToString(); + Enum.TryParse(typeof(ThemeEnum), mode, out var theme); + + ThemeMode = (int)(theme ?? ThemeEnum.Light); + string storedUpdater = GetSettingsValue(Properties.Properties.Setting_Update_Strategy_Key); + + Updater = AvailableUpdaters?.FirstOrDefault(item => item.UpdaterType.ToString() == storedUpdater); + } + + /// + /// Get a specific settings value + /// + /// Type of the value to get + /// Name of the value to get + /// The value casted to the given type + private T GetSettingsValue(string name) + { + ISettingPair settingPair = applicationScope.GetSetting(name); + return settingPair == null ? default : settingPair.GetValue(); + } +} diff --git a/src/XmlFormatterOsIndependent/ViewModels/PluginMetaDataViewModel.cs b/src/XmlFormatterOsIndependent/ViewModels/PluginMetaDataViewModel.cs new file mode 100644 index 0000000..92d53ab --- /dev/null +++ b/src/XmlFormatterOsIndependent/ViewModels/PluginMetaDataViewModel.cs @@ -0,0 +1,23 @@ +using Avalonia.Data.Core; +using CommunityToolkit.Mvvm.ComponentModel; +using PluginFramework.DataContainer; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace XmlFormatterOsIndependent.ViewModels; +internal class PluginMetaDataViewModel : ObservableObject +{ + private readonly PluginMetaData metaData; + + public string DisplayName => metaData.Information.Name; + + public Type UpdaterType => metaData.Type; + + public PluginMetaDataViewModel(PluginMetaData metaData) + { + this.metaData = metaData; + } +} diff --git a/src/XmlFormatterOsIndependent/ViewModels/SettingsWindowViewModel.cs b/src/XmlFormatterOsIndependent/ViewModels/SettingsWindowViewModel.cs index d5832c0..e52c8f9 100644 --- a/src/XmlFormatterOsIndependent/ViewModels/SettingsWindowViewModel.cs +++ b/src/XmlFormatterOsIndependent/ViewModels/SettingsWindowViewModel.cs @@ -1,14 +1,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -using PluginFramework.DataContainer; using PluginFramework.Interfaces.Manager; -using PluginFramework.Interfaces.PluginTypes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Linq; using XmlFormatterModel.Setting; -using XmlFormatterOsIndependent.Enums; using XmlFormatterOsIndependent.Services; namespace XmlFormatterOsIndependent.ViewModels @@ -18,48 +11,18 @@ namespace XmlFormatterOsIndependent.ViewModels /// public partial class SettingsWindowViewModel : ObservableObject { - - /// - /// A list with all the update strategies - /// - public List List { get; } - - /// - /// Private acces for ask before closing setting - /// [ObservableProperty] - private bool askBeforeClosing; + private ObservableObject? settingsBackupContent; - /// - /// Private selected theme index - /// [ObservableProperty] - private int themeMode; + private ObservableObject? applicationSettingsContent; - /// - /// Private check for updates on start - /// [ObservableProperty] - private bool checkUpdateOnStart; + private ObservableObject? loggingContent; - /// - /// Private updater to use - /// [ObservableProperty] - private PluginMetaData updater; + private ObservableObject? hotfolderContent; - /// - /// Private index of the selected updater - /// - [ObservableProperty] - private int updaterIndex; - - /// - /// The setting scope of this application - /// - private readonly ISettingScope applicationScope; - private readonly ISettingsManager settingsManager; - private readonly IPathService pathService; private readonly IWindowApplicationService applicationService; private readonly IThemeService themeService; @@ -70,80 +33,14 @@ public partial class SettingsWindowViewModel : ObservableObject /// The settings manager to use /// The plugin manager to use public SettingsWindowViewModel( - ISettingsManager settingsManager, - IPathService pathService, - IPluginManager pluginManager, IWindowApplicationService applicationService, - IThemeService themeService) + IThemeService themeService, + IDependecyInjectionResolverService resolverService) { - this.settingsManager = settingsManager; - this.pathService = pathService; this.applicationService = applicationService; this.themeService = themeService; - if (settingsManager == null || pluginManager == null) - { - return; - } - settingsManager.Load(pathService.GetSettingsFile()); - applicationScope = settingsManager.GetScope(Properties.Properties.Setting_Default_Scope); - List = pluginManager.ListPlugins().ToList(); - - if (applicationScope == null) - { - applicationScope = new SettingScope(Properties.Properties.Setting_Default_Scope); - settingsManager.AddScope(applicationScope); - } - LoadSettings(); - - } - - /// - /// Load all the settings - /// - private void LoadSettings() - { - AskBeforeClosing = GetSettingsValue(Properties.Properties.Setting_Ask_Before_Closing_Key); - CheckUpdateOnStart = GetSettingsValue(Properties.Properties.Setting_Search_Update_On_Startup_Key); - - var scope = settingsManager.GetScope(Properties.Properties.Setting_Default_Scope); - string mode = scope.GetSetting(Properties.Properties.Setting_Theme_Key)?.GetValue() ?? ThemeEnum.Light.ToString(); - Enum.TryParse(typeof(ThemeEnum), mode, out var theme); - - ThemeMode = (int)(theme ?? ThemeEnum.Light); - - string updater = GetSettingsValue(Properties.Properties.Setting_Update_Strategy_Key); - int updaterToUse = -1; - if (List.Count > 0) - { - updaterToUse = 0; - } - - for (int i = 0; i < List.Count; i++) - { - if (List[i].Type.ToString() == updater) - { - updaterToUse = i; - break; - } - } - - if (updaterToUse >= 0) - { - UpdaterIndex = updaterToUse; - } - } - - /// - /// Get a specific settings value - /// - /// Type of the value to get - /// Name of the value to get - /// The value casted to the given type - private T GetSettingsValue(string name) - { - ISettingPair settingPair = applicationScope.GetSetting(name); - return settingPair == null ? default : settingPair.GetValue(); + applicationSettingsContent = resolverService.GetService(); } [RelayCommand] @@ -157,6 +54,8 @@ public void CloseWindow() /// public void SaveAndClose() { + /** + * @TODO: Mode this into the ApplicationSettingsViewModel Triggered via message! ThemeEnum theme = ThemeMode == 0 ? ThemeEnum.Light : ThemeEnum.Dark; ISettingPair askClose = new SettingPair(Properties.Properties.Setting_Ask_Before_Closing_Key); @@ -169,12 +68,13 @@ public void SaveAndClose() themeMode.SetValue(theme.ToString()); themeService.ChangeTheme(theme); - applicationScope.AddSetting(askClose); applicationScope.AddSetting(searchUpdate); applicationScope.AddSetting(updater); applicationScope.AddSetting(themeMode); settingsManager.Save(pathService.GetSettingsFile()); + + */ CloseWindowCommand.Execute(null); } } diff --git a/src/XmlFormatterOsIndependent/Views/ApplicationSettingsView.axaml b/src/XmlFormatterOsIndependent/Views/ApplicationSettingsView.axaml new file mode 100644 index 0000000..6d69e15 --- /dev/null +++ b/src/XmlFormatterOsIndependent/Views/ApplicationSettingsView.axaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/XmlFormatterOsIndependent/Views/ApplicationSettingsView.axaml.cs b/src/XmlFormatterOsIndependent/Views/ApplicationSettingsView.axaml.cs new file mode 100644 index 0000000..5223cfe --- /dev/null +++ b/src/XmlFormatterOsIndependent/Views/ApplicationSettingsView.axaml.cs @@ -0,0 +1,16 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace XmlFormatterOsIndependent.Views; +public partial class ApplicationSettingsView : UserControl +{ + public ApplicationSettingsView() + { + InitializeComponent(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } +} diff --git a/src/XmlFormatterOsIndependent/Views/PluginMetaDataView.axaml b/src/XmlFormatterOsIndependent/Views/PluginMetaDataView.axaml new file mode 100644 index 0000000..48abc89 --- /dev/null +++ b/src/XmlFormatterOsIndependent/Views/PluginMetaDataView.axaml @@ -0,0 +1,8 @@ + + + diff --git a/src/XmlFormatterOsIndependent/Views/PluginMetaDataView.axaml.cs b/src/XmlFormatterOsIndependent/Views/PluginMetaDataView.axaml.cs new file mode 100644 index 0000000..a4b5be9 --- /dev/null +++ b/src/XmlFormatterOsIndependent/Views/PluginMetaDataView.axaml.cs @@ -0,0 +1,15 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace XmlFormatterOsIndependent.Views; +public partial class PluginMetaDataView : UserControl +{ + public PluginMetaDataView() + { + InitializeComponent(); + } + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } +} diff --git a/src/XmlFormatterOsIndependent/Views/SettingsWindow.xaml b/src/XmlFormatterOsIndependent/Views/SettingsWindow.xaml index 66bb594..3c69ff9 100644 --- a/src/XmlFormatterOsIndependent/Views/SettingsWindow.xaml +++ b/src/XmlFormatterOsIndependent/Views/SettingsWindow.xaml @@ -5,50 +5,37 @@ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="XmlFormatterOsIndependent.Views.SettingsWindow" Icon="/Assets/XmlFormatterSettingsIcon.ico" - Title="Settings" + Title="{x:Static p:Resources.SettingsWindow_Title}" SizeToContent="WidthAndHeight" + xmlns:p="clr-namespace:XmlFormatterOsIndependent.Properties" CanResize="False"> + + + + + + + - - + + + + + + - - - +