From e9fc76465008003542bb0d6023e0906a1e732df6 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Mon, 19 Jan 2026 17:49:04 -0500 Subject: [PATCH] feat(configmanager): add MainWindow view --- .../ViewModels/MainWindowViewModel.cs | 77 +++++++++++ .../ViewModels/TreeNodeViewModel.cs | 23 ++++ .../Views/MainWindow.axaml | 124 +++++++++++++++++- 3 files changed, 219 insertions(+), 5 deletions(-) create mode 100644 NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/MainWindowViewModel.cs create mode 100644 NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/TreeNodeViewModel.cs diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/MainWindowViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/MainWindowViewModel.cs new file mode 100644 index 0000000..b28fc71 --- /dev/null +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/MainWindowViewModel.cs @@ -0,0 +1,77 @@ +using System.Collections.ObjectModel; +using System.Windows.Input; +using Avalonia.Media; + +namespace JdeScoping.ConfigManager.ViewModels; + +/// +/// Main window view model. +/// This is a stub implementation for Task 11 - full implementation in Task 13. +/// +public class MainWindowViewModel : ViewModelBase +{ + private string _configFolderPath = "No folder selected"; + private bool _hasUnsavedChanges; + private string _validationStatus = "Valid"; + private IBrush _validationStatusColor = Brushes.LightGreen; + private TreeNodeViewModel? _selectedNode; + private object? _selectedFormViewModel; + + public string ConfigFolderPath + { + get => _configFolderPath; + set => SetProperty(ref _configFolderPath, value); + } + + public bool HasUnsavedChanges + { + get => _hasUnsavedChanges; + set => SetProperty(ref _hasUnsavedChanges, value); + } + + public string ValidationStatus + { + get => _validationStatus; + set => SetProperty(ref _validationStatus, value); + } + + public IBrush ValidationStatusColor + { + get => _validationStatusColor; + set => SetProperty(ref _validationStatusColor, value); + } + + public TreeNodeViewModel? SelectedNode + { + get => _selectedNode; + set => SetProperty(ref _selectedNode, value); + } + + public object? SelectedFormViewModel + { + get => _selectedFormViewModel; + set => SetProperty(ref _selectedFormViewModel, value); + } + + public ObservableCollection TreeNodes { get; } = []; + + public ICommand OpenFolderCommand { get; } + public ICommand SaveCommand { get; } + public ICommand ExitCommand { get; } + public ICommand UndoCommand { get; } + public ICommand RedoCommand { get; } + public ICommand ValidateCommand { get; } + public ICommand TestConnectionCommand { get; } + + public MainWindowViewModel() + { + // Stub commands - full implementation in Task 13 + OpenFolderCommand = new RelayCommand(() => { }); + SaveCommand = new RelayCommand(() => { }); + ExitCommand = new RelayCommand(() => { }); + UndoCommand = new RelayCommand(() => { }); + RedoCommand = new RelayCommand(() => { }); + ValidateCommand = new RelayCommand(() => { }); + TestConnectionCommand = new RelayCommand(() => { }); + } +} diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/TreeNodeViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/TreeNodeViewModel.cs new file mode 100644 index 0000000..1b6f332 --- /dev/null +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/TreeNodeViewModel.cs @@ -0,0 +1,23 @@ +using System.Collections.ObjectModel; + +namespace JdeScoping.ConfigManager.ViewModels; + +/// +/// ViewModel for a tree node in the configuration tree. +/// This is a stub implementation for Task 11 - full implementation in Task 12. +/// +public class TreeNodeViewModel : ViewModelBase +{ + private bool _isModified; + + public string Name { get; set; } = string.Empty; + public string Icon { get; set; } = string.Empty; + public string StatusIcon { get; set; } = string.Empty; + public ObservableCollection Children { get; } = []; + + public bool IsModified + { + get => _isModified; + set => SetProperty(ref _isModified, value); + } +} diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/MainWindow.axaml b/NEW/src/Utils/JdeScoping.ConfigManager/Views/MainWindow.axaml index 3041906..5f62e56 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/MainWindow.axaml +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/MainWindow.axaml @@ -1,11 +1,125 @@ - + MinWidth="900" MinHeight="600" + Background="#0D0F12"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +