diff --git a/ReCodeItGUI_WPF/App.xaml b/ReCodeItGUI_WPF/App.xaml
index d33d2b8..2493fa6 100644
--- a/ReCodeItGUI_WPF/App.xaml
+++ b/ReCodeItGUI_WPF/App.xaml
@@ -1,10 +1,17 @@
-
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/ReCodeItGUI_WPF/App.xaml.cs b/ReCodeItGUI_WPF/App.xaml.cs
index 828021e..52db7ad 100644
--- a/ReCodeItGUI_WPF/App.xaml.cs
+++ b/ReCodeItGUI_WPF/App.xaml.cs
@@ -1,14 +1,94 @@
-using System.Configuration;
-using System.Data;
-using System.Windows;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using ReCodeItGUI_WPF.Services;
+using ReCodeItGUI_WPF.ViewModels.Pages;
+using ReCodeItGUI_WPF.ViewModels.Windows;
+using ReCodeItGUI_WPF.Views.Pages;
+using ReCodeItGUI_WPF.Views.Windows;
+using System.IO;
+using System.Reflection;
+using System.Windows.Threading;
+using Wpf.Ui;
namespace ReCodeItGUI_WPF
{
///
/// Interaction logic for App.xaml
///
- public partial class App : Application
+ public partial class App
{
- }
+ // The.NET Generic Host provides dependency injection, configuration, logging, and other services.
+ // https://docs.microsoft.com/dotnet/core/extensions/generic-host
+ // https://docs.microsoft.com/dotnet/core/extensions/dependency-injection
+ // https://docs.microsoft.com/dotnet/core/extensions/configuration
+ // https://docs.microsoft.com/dotnet/core/extensions/logging
+ private static readonly IHost _host = Host
+ .CreateDefaultBuilder()
+ .ConfigureAppConfiguration(c => { c.SetBasePath(Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)); })
+ .ConfigureServices((context, services) =>
+ {
+ services.AddHostedService();
+ // Page resolver service
+ services.AddSingleton();
+
+ // Theme manipulation
+ services.AddSingleton();
+
+ // TaskBar manipulation
+ services.AddSingleton();
+
+ // Service containing navigation, same as INavigationWindow... but without window
+ services.AddSingleton();
+
+ // Main window with navigation
+ services.AddSingleton();
+ services.AddSingleton();
+
+ services.AddSingleton();
+ services.AddSingleton();
+ services.AddSingleton();
+ services.AddSingleton();
+ services.AddSingleton();
+ services.AddSingleton();
+ }).Build();
+
+ ///
+ /// Gets registered service.
+ ///
+ /// Type of the service to get.
+ /// Instance of the service or .
+ public static T GetService()
+ where T : class
+ {
+ return _host.Services.GetService(typeof(T)) as T;
+ }
+
+ ///
+ /// Occurs when the application is loading.
+ ///
+ private void OnStartup(object sender, StartupEventArgs e)
+ {
+ _host.Start();
+ }
+
+ ///
+ /// Occurs when the application is closing.
+ ///
+ private async void OnExit(object sender, ExitEventArgs e)
+ {
+ await _host.StopAsync();
+
+ _host.Dispose();
+ }
+
+ ///
+ /// Occurs when an exception is thrown by an application but not handled.
+ ///
+ private void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
+ {
+ // For more info see https://docs.microsoft.com/en-us/dotnet/api/system.windows.application.dispatcherunhandledexception?view=windowsdesktop-6.0
+ }
+ }
}
diff --git a/ReCodeItGUI_WPF/AssemblyInfo.cs b/ReCodeItGUI_WPF/AssemblyInfo.cs
index b0ec827..7ad982e 100644
--- a/ReCodeItGUI_WPF/AssemblyInfo.cs
+++ b/ReCodeItGUI_WPF/AssemblyInfo.cs
@@ -1,10 +1,10 @@
using System.Windows;
[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+//(used if a resource is not found in the page,
+// app, or any theme specific resource dictionaries)
)]
diff --git a/ReCodeItGUI_WPF/Assets/wpfui-icon-1024.png b/ReCodeItGUI_WPF/Assets/wpfui-icon-1024.png
new file mode 100644
index 0000000..b70c4ed
Binary files /dev/null and b/ReCodeItGUI_WPF/Assets/wpfui-icon-1024.png differ
diff --git a/ReCodeItGUI_WPF/Assets/wpfui-icon-256.png b/ReCodeItGUI_WPF/Assets/wpfui-icon-256.png
new file mode 100644
index 0000000..6b5cf5d
Binary files /dev/null and b/ReCodeItGUI_WPF/Assets/wpfui-icon-256.png differ
diff --git a/ReCodeItGUI_WPF/Helpers/EnumToBooleanConverter.cs b/ReCodeItGUI_WPF/Helpers/EnumToBooleanConverter.cs
new file mode 100644
index 0000000..5d225a4
--- /dev/null
+++ b/ReCodeItGUI_WPF/Helpers/EnumToBooleanConverter.cs
@@ -0,0 +1,36 @@
+using System.Globalization;
+using System.Windows.Data;
+using Wpf.Ui.Appearance;
+
+namespace ReCodeItGUI_WPF.Helpers
+{
+ internal class EnumToBooleanConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (parameter is not String enumString)
+ {
+ throw new ArgumentException("ExceptionEnumToBooleanConverterParameterMustBeAnEnumName");
+ }
+
+ if (!Enum.IsDefined(typeof(ApplicationTheme), value))
+ {
+ throw new ArgumentException("ExceptionEnumToBooleanConverterValueMustBeAnEnum");
+ }
+
+ var enumValue = Enum.Parse(typeof(ApplicationTheme), enumString);
+
+ return enumValue.Equals(value);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (parameter is not String enumString)
+ {
+ throw new ArgumentException("ExceptionEnumToBooleanConverterParameterMustBeAnEnumName");
+ }
+
+ return Enum.Parse(typeof(ApplicationTheme), enumString);
+ }
+ }
+}
diff --git a/ReCodeItGUI_WPF/Helpers/GUIExtentions.cs b/ReCodeItGUI_WPF/Helpers/GUIExtentions.cs
deleted file mode 100644
index 143c74f..0000000
--- a/ReCodeItGUI_WPF/Helpers/GUIExtentions.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-using Microsoft.Win32;
-using ReCodeIt.Models;
-using System.Windows.Controls;
-using Xceed.Wpf.Toolkit;
-
-namespace ReCodeItGUI_WPF.Helpers
-{
- internal static class GUIExtentions
- {
- #region EXT_METHODS
-
- public static void AddToListView(this ListView listView, TextBox textBox)
- {
- if (!string.IsNullOrWhiteSpace(textBox.Text) && !listView.Items.Contains(textBox.Text))
- {
- listView.Items.Add(textBox.Text);
- textBox.Clear();
- }
- }
-
- public static void RemoveSelectedItem(this ListView listView)
- {
- if (listView.SelectedItem != null)
- {
- listView.Items.RemoveAt(listView.SelectedIndex);
- }
- }
-
- #endregion EXT_METHODS
-
- ///
- /// Returns the string result of the dialog
- ///
- /// Path if valid, or empty string
- public static string OpenFileDialog(bool dll = false)
- {
- var title = dll ? "Select a DLL File" : "Select a Json File";
-
- var defaultExt = dll ? ".dll" : ".jsonc";
-
- var dllFilter = "DLL files (*.dll)|*.dll|All files (*.*)|*.*";
- var jsonFilter = "JSON/JSONC files (*.json;*.jsonc)|*.json;*.jsonc|All files (*.*)|*.*";
-
- var openFileDialog = new OpenFileDialog();
- openFileDialog.Title = title;
- openFileDialog.Filter = dll ? dllFilter : jsonFilter;
- openFileDialog.DefaultExt = defaultExt;
-
- bool? result = openFileDialog.ShowDialog();
-
- if (result == true)
- {
- return openFileDialog.FileName;
- }
-
- return string.Empty;
- }
-
- public static RemapModel CreateRemapFromGui(this MainWindow window)
- {
- var model = new RemapModel
- {
- NewTypeName = window.NewTypeNameTextBox.Text,
- OriginalTypeName = window.OriginalTypeNameTextBox.Text ?? string.Empty,
- UseForceRename = (bool)window.UseForceRenameCheckbox.IsChecked,
- SearchParams = new SearchParams
- {
- IsPublic = window.IsPublicComboBox.IsComboEnabled(),
- IsAbstract = window.IsAbstractComboBox.IsComboEnabled(),
- IsInterface = window.IsInterfaceComboBox.IsComboEnabled(),
- IsEnum = window.IsEnumComboBox.IsComboEnabled(),
- IsNested = window.IsNestedComboBox.IsComboEnabled(),
- IsSealed = window.IsSealedComboBox.IsComboEnabled(),
- HasAttribute = window.HasAttributeComboBox.IsComboEnabled(),
- IsDerived = window.IsDerivedComboBox.IsComboEnabled(),
- HasGenericParameters = window.HasAttributeComboBox.IsComboEnabled(),
- ParentName = window.ParentNameTextBox.GetText(),
- MatchBaseClass = window.IncludeBaseClassTextBox.GetText(),
- IgnoreBaseClass = window.IgnoreBaseClassTextBox.GetText(),
- ConstructorParameterCount = window.CtorParamCountUpDown.GetValIfEnabled(window.CtorCheckbox),
- MethodCount = window.MethodCountUpDown.GetValIfEnabled(window.MethodCheckbox),
- FieldCount = window.FieldCountUpDown.GetValIfEnabled(window.FieldCountCheckbox),
- PropertyCount = window.PropertyCountUpDown.GetValIfEnabled(window.PropertyCountCheckBox),
- NestedTypeCount = window.NestedTypeCountUpDown.GetValIfEnabled(window.NestedTypeCountCheckBox),
- IncludeMethods = window.MethodIncludeListView.GetItems(),
- ExcludeMethods = window.MethodExcludeListView.GetItems(),
- IncludeFields = window.FieldIncludeListView.GetItems(),
- ExcludeFields = window.FieldExcludeListView.GetItems(),
- IncludeProperties = window.PropertyIncludeListBox.GetItems(),
- ExcludeProperties = window.PropertyExcludeListBox.GetItems(),
- IncludeNestedTypes = window.NestedTypeIncludeListView.GetItems(),
- ExcludeNestedTypes = window.NestedTypeExcludeListView.GetItems(),
- }
- };
-
- return model;
- }
-
- ///
- /// True or false if selected, otherwise null
- ///
- ///
- ///
- public static bool? IsComboEnabled(this ComboBox comboBox)
- {
- if (bool.TryParse(comboBox.Text, out var result))
- {
- return result;
- }
-
- return null;
- }
-
- ///
- /// returns the text in the box if exists, or null
- ///
- ///
- ///
- public static string? GetText(this TextBox textBox)
- {
- if (textBox.Text != string.Empty)
- {
- return textBox.Text;
- }
-
- return null;
- }
-
- public static int? GetValIfEnabled(this IntegerUpDown intUpDown, CheckBox cBox)
- {
- if ((bool)cBox.IsChecked)
- {
- return intUpDown.Value;
- }
-
- return null;
- }
-
- ///
- /// Converts list view objects to string list
- ///
- ///
- ///
- public static List GetItems(this ListView listView)
- {
- var tmp = new List();
-
- foreach (var item in listView.Items)
- {
- tmp.Add(item.ToString());
- }
-
- return tmp;
- }
- }
-}
\ No newline at end of file
diff --git a/ReCodeItGUI_WPF/MainWindow.xaml b/ReCodeItGUI_WPF/MainWindow.xaml
deleted file mode 100644
index 6e80674..0000000
--- a/ReCodeItGUI_WPF/MainWindow.xaml
+++ /dev/null
@@ -1,197 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/ReCodeItGUI_WPF/MainWindow.xaml.cs b/ReCodeItGUI_WPF/MainWindow.xaml.cs
deleted file mode 100644
index c6f24cd..0000000
--- a/ReCodeItGUI_WPF/MainWindow.xaml.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-using ReCodeIt.Utils;
-using ReCodeItGUI_WPF.Helpers;
-using System.Windows;
-using System.Windows.Input;
-
-namespace ReCodeItGUI_WPF;
-
-///
-/// Interaction logic for MainWindow.xaml
-///
-public partial class MainWindow : Window
-{
- private ICommand deleteCommand;
-
- public MainWindow()
- {
- InitializeComponent();
- DataProvider.LoadAppSettings();
- DataProvider.LoadMappingFile();
- }
-
- #region MANUAL_REMAPPER
-
- private void SaveRemapButton_Click(object sender, RoutedEventArgs e)
- {
- this.CreateRemapFromGui();
- }
-
- private void MethodIncludeButton_Click(object sender, RoutedEventArgs e)
- {
- MethodIncludeListView.AddToListView(MethodTextBox);
- }
-
- private void MethodExcludeButton_Click(object sender, RoutedEventArgs e)
- {
- MethodExcludeListView.AddToListView(MethodTextBox);
- }
-
- private void MethodRemoveButton_Click(object sender, RoutedEventArgs e)
- {
- MethodIncludeListView.RemoveSelectedItem();
- MethodExcludeListView.RemoveSelectedItem();
- }
-
- private void FieldIncludeButton_Click(object sender, RoutedEventArgs e)
- {
- FieldIncludeListView.AddToListView(FieldTextBox);
- }
-
- private void FieldExcludeButton_Click(object sender, RoutedEventArgs e)
- {
- FieldExcludeListView.AddToListView(FieldTextBox);
- }
-
- private void FieldRemoveButton_Click(object sender, RoutedEventArgs e)
- {
- FieldIncludeListView.RemoveSelectedItem();
- FieldExcludeListView.RemoveSelectedItem();
- }
-
- private void PropertyIncludeButton_Click(object sender, RoutedEventArgs e)
- {
- PropertyIncludeListBox.AddToListView(PropertyTextBox);
- }
-
- private void PropertyExcludeButton_Click(object sender, RoutedEventArgs e)
- {
- PropertyExcludeListBox.AddToListView(PropertyTextBox);
- }
-
- private void PropertyRemoveButton_Click(object sender, RoutedEventArgs e)
- {
- PropertyIncludeListBox.RemoveSelectedItem();
- PropertyExcludeListBox.RemoveSelectedItem();
- }
-
- private void NestedTypeIncludeAddButton_Click(object sender, RoutedEventArgs e)
- {
- NestedTypeIncludeListView.AddToListView(NestTypeTextBox);
- }
-
- private void NestedTypeExcludeButton_Click(object sender, RoutedEventArgs e)
- {
- NestedTypeExcludeListView.AddToListView(NestTypeTextBox);
- }
-
- private void NestedTypeRemoveButton_Click(object sender, RoutedEventArgs e)
- {
- NestedTypeIncludeListView.RemoveSelectedItem();
- NestedTypeExcludeListView.RemoveSelectedItem();
- }
-
- #endregion MANUAL_REMAPPER
-}
\ No newline at end of file
diff --git a/ReCodeItGUI_WPF/Models/AppConfig.cs b/ReCodeItGUI_WPF/Models/AppConfig.cs
new file mode 100644
index 0000000..20f91b3
--- /dev/null
+++ b/ReCodeItGUI_WPF/Models/AppConfig.cs
@@ -0,0 +1,9 @@
+namespace ReCodeItGUI_WPF.Models
+{
+ public class AppConfig
+ {
+ public string ConfigurationsFolder { get; set; }
+
+ public string AppPropertiesFileName { get; set; }
+ }
+}
diff --git a/ReCodeItGUI_WPF/Models/DataColor.cs b/ReCodeItGUI_WPF/Models/DataColor.cs
new file mode 100644
index 0000000..b727552
--- /dev/null
+++ b/ReCodeItGUI_WPF/Models/DataColor.cs
@@ -0,0 +1,9 @@
+using System.Windows.Media;
+
+namespace ReCodeItGUI_WPF.Models
+{
+ public struct DataColor
+ {
+ public Brush Color { get; set; }
+ }
+}
diff --git a/ReCodeItGUI_WPF/ReCodeItGUI_WPF.csproj b/ReCodeItGUI_WPF/ReCodeItGUI_WPF.csproj
index 9af97c5..d38989a 100644
--- a/ReCodeItGUI_WPF/ReCodeItGUI_WPF.csproj
+++ b/ReCodeItGUI_WPF/ReCodeItGUI_WPF.csproj
@@ -1,23 +1,33 @@
-
+
WinExe
net8.0-windows
- disable
- enable
+ app.manifest
+ wpfui-icon.ico
true
+ enable
+ enable
-
+
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/ReCodeItGUI_WPF/Resources/Translations.cs b/ReCodeItGUI_WPF/Resources/Translations.cs
new file mode 100644
index 0000000..61b0ddc
--- /dev/null
+++ b/ReCodeItGUI_WPF/Resources/Translations.cs
@@ -0,0 +1,6 @@
+namespace ReCodeItGUI_WPF.Resources
+{
+ public partial class Translations
+ {
+ }
+}
diff --git a/ReCodeItGUI_WPF/Services/ApplicationHostService.cs b/ReCodeItGUI_WPF/Services/ApplicationHostService.cs
new file mode 100644
index 0000000..40002d6
--- /dev/null
+++ b/ReCodeItGUI_WPF/Services/ApplicationHostService.cs
@@ -0,0 +1,59 @@
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using ReCodeItGUI_WPF.Views.Pages;
+using ReCodeItGUI_WPF.Views.Windows;
+using Wpf.Ui;
+
+namespace ReCodeItGUI_WPF.Services
+{
+ ///
+ /// Managed host of the application.
+ ///
+ public class ApplicationHostService : IHostedService
+ {
+ private readonly IServiceProvider _serviceProvider;
+
+ private INavigationWindow _navigationWindow;
+
+ public ApplicationHostService(IServiceProvider serviceProvider)
+ {
+ _serviceProvider = serviceProvider;
+ }
+
+ ///
+ /// Triggered when the application host is ready to start the service.
+ ///
+ /// Indicates that the start process has been aborted.
+ public async Task StartAsync(CancellationToken cancellationToken)
+ {
+ await HandleActivationAsync();
+ }
+
+ ///
+ /// Triggered when the application host is performing a graceful shutdown.
+ ///
+ /// Indicates that the shutdown process should no longer be graceful.
+ public async Task StopAsync(CancellationToken cancellationToken)
+ {
+ await Task.CompletedTask;
+ }
+
+ ///
+ /// Creates main window during activation.
+ ///
+ private async Task HandleActivationAsync()
+ {
+ if (!Application.Current.Windows.OfType().Any())
+ {
+ _navigationWindow = (
+ _serviceProvider.GetService(typeof(INavigationWindow)) as INavigationWindow
+ )!;
+ _navigationWindow!.ShowWindow();
+
+ _navigationWindow.Navigate(typeof(Views.Pages.DashboardPage));
+ }
+
+ await Task.CompletedTask;
+ }
+ }
+}
diff --git a/ReCodeItGUI_WPF/Services/PageService.cs b/ReCodeItGUI_WPF/Services/PageService.cs
new file mode 100644
index 0000000..94b250a
--- /dev/null
+++ b/ReCodeItGUI_WPF/Services/PageService.cs
@@ -0,0 +1,42 @@
+using Wpf.Ui;
+
+namespace ReCodeItGUI_WPF.Services
+{
+ ///
+ /// Service that provides pages for navigation.
+ ///
+ public class PageService : IPageService
+ {
+ ///
+ /// Service which provides the instances of pages.
+ ///
+ private readonly IServiceProvider _serviceProvider;
+
+ ///
+ /// Creates new instance and attaches the .
+ ///
+ public PageService(IServiceProvider serviceProvider)
+ {
+ _serviceProvider = serviceProvider;
+ }
+
+ ///
+ public T? GetPage()
+ where T : class
+ {
+ if (!typeof(FrameworkElement).IsAssignableFrom(typeof(T)))
+ throw new InvalidOperationException("The page should be a WPF control.");
+
+ return (T?)_serviceProvider.GetService(typeof(T));
+ }
+
+ ///
+ public FrameworkElement? GetPage(Type pageType)
+ {
+ if (!typeof(FrameworkElement).IsAssignableFrom(pageType))
+ throw new InvalidOperationException("The page should be a WPF control.");
+
+ return _serviceProvider.GetService(pageType) as FrameworkElement;
+ }
+ }
+}
diff --git a/ReCodeItGUI_WPF/Usings.cs b/ReCodeItGUI_WPF/Usings.cs
new file mode 100644
index 0000000..5efad98
--- /dev/null
+++ b/ReCodeItGUI_WPF/Usings.cs
@@ -0,0 +1,4 @@
+global using CommunityToolkit.Mvvm.ComponentModel;
+global using CommunityToolkit.Mvvm.Input;
+global using System;
+global using System.Windows;
diff --git a/ReCodeItGUI_WPF/ViewModels/Pages/DashboardViewModel.cs b/ReCodeItGUI_WPF/ViewModels/Pages/DashboardViewModel.cs
new file mode 100644
index 0000000..b25aa1e
--- /dev/null
+++ b/ReCodeItGUI_WPF/ViewModels/Pages/DashboardViewModel.cs
@@ -0,0 +1,14 @@
+namespace ReCodeItGUI_WPF.ViewModels.Pages
+{
+ public partial class DashboardViewModel : ObservableObject
+ {
+ [ObservableProperty]
+ private int _counter = 0;
+
+ [RelayCommand]
+ private void OnCounterIncrement()
+ {
+ Counter++;
+ }
+ }
+}
diff --git a/ReCodeItGUI_WPF/ViewModels/Pages/DataViewModel.cs b/ReCodeItGUI_WPF/ViewModels/Pages/DataViewModel.cs
new file mode 100644
index 0000000..40c5f18
--- /dev/null
+++ b/ReCodeItGUI_WPF/ViewModels/Pages/DataViewModel.cs
@@ -0,0 +1,47 @@
+using ReCodeItGUI_WPF.Models;
+using System.Windows.Media;
+using Wpf.Ui.Controls;
+
+namespace ReCodeItGUI_WPF.ViewModels.Pages
+{
+ public partial class DataViewModel : ObservableObject, INavigationAware
+ {
+ private bool _isInitialized = false;
+
+ [ObservableProperty]
+ private IEnumerable _colors;
+
+ public void OnNavigatedTo()
+ {
+ if (!_isInitialized)
+ InitializeViewModel();
+ }
+
+ public void OnNavigatedFrom() { }
+
+ private void InitializeViewModel()
+ {
+ var random = new Random();
+ var colorCollection = new List();
+
+ for (int i = 0; i < 8192; i++)
+ colorCollection.Add(
+ new DataColor
+ {
+ Color = new SolidColorBrush(
+ Color.FromArgb(
+ (byte)200,
+ (byte)random.Next(0, 250),
+ (byte)random.Next(0, 250),
+ (byte)random.Next(0, 250)
+ )
+ )
+ }
+ );
+
+ Colors = colorCollection;
+
+ _isInitialized = true;
+ }
+ }
+}
diff --git a/ReCodeItGUI_WPF/ViewModels/Pages/SettingsViewModel.cs b/ReCodeItGUI_WPF/ViewModels/Pages/SettingsViewModel.cs
new file mode 100644
index 0000000..edb7ce4
--- /dev/null
+++ b/ReCodeItGUI_WPF/ViewModels/Pages/SettingsViewModel.cs
@@ -0,0 +1,63 @@
+using Wpf.Ui.Appearance;
+using Wpf.Ui.Controls;
+
+namespace ReCodeItGUI_WPF.ViewModels.Pages
+{
+ public partial class SettingsViewModel : ObservableObject, INavigationAware
+ {
+ private bool _isInitialized = false;
+
+ [ObservableProperty]
+ private string _appVersion = String.Empty;
+
+ [ObservableProperty]
+ private ApplicationTheme _currentTheme = ApplicationTheme.Unknown;
+
+ public void OnNavigatedTo()
+ {
+ if (!_isInitialized)
+ InitializeViewModel();
+ }
+
+ public void OnNavigatedFrom() { }
+
+ private void InitializeViewModel()
+ {
+ CurrentTheme = ApplicationThemeManager.GetAppTheme();
+ AppVersion = $"UiDesktopApp1 - {GetAssemblyVersion()}";
+
+ _isInitialized = true;
+ }
+
+ private string GetAssemblyVersion()
+ {
+ return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString()
+ ?? String.Empty;
+ }
+
+ [RelayCommand]
+ private void OnChangeTheme(string parameter)
+ {
+ switch (parameter)
+ {
+ case "theme_light":
+ if (CurrentTheme == ApplicationTheme.Light)
+ break;
+
+ ApplicationThemeManager.Apply(ApplicationTheme.Light);
+ CurrentTheme = ApplicationTheme.Light;
+
+ break;
+
+ default:
+ if (CurrentTheme == ApplicationTheme.Dark)
+ break;
+
+ ApplicationThemeManager.Apply(ApplicationTheme.Dark);
+ CurrentTheme = ApplicationTheme.Dark;
+
+ break;
+ }
+ }
+ }
+}
diff --git a/ReCodeItGUI_WPF/ViewModels/Windows/MainWindowViewModel.cs b/ReCodeItGUI_WPF/ViewModels/Windows/MainWindowViewModel.cs
new file mode 100644
index 0000000..3111ace
--- /dev/null
+++ b/ReCodeItGUI_WPF/ViewModels/Windows/MainWindowViewModel.cs
@@ -0,0 +1,45 @@
+using System.Collections.ObjectModel;
+using Wpf.Ui.Controls;
+
+namespace ReCodeItGUI_WPF.ViewModels.Windows
+{
+ public partial class MainWindowViewModel : ObservableObject
+ {
+ [ObservableProperty]
+ private string _applicationTitle = "WPF UI - ReCodeItGUI_WPF";
+
+ [ObservableProperty]
+ private ObservableCollection