Move files for better organization

This commit is contained in:
2026-02-18 09:24:20 +09:00
parent 6e23371858
commit b197f43341
60 changed files with 32 additions and 63 deletions
+50
View File
@@ -0,0 +1,50 @@
using ReceiptPDFBuilder.Helpers;
using ReceiptPDFBuilder.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
namespace ReceiptPDFBuilder.ViewModels
{
class MainWindowViewModel : ChangeNotifier, IChangeViewModel
{
BaseViewModel _currentViewModel;
Stack<BaseViewModel> _viewModels;
public MainWindowViewModel(ITopLevelGrabber topLevelGrabber)
{
_viewModels = new Stack<BaseViewModel>();
var initialViewModel = new MainViewModel(this)
{
TopLevelGrabber = topLevelGrabber
};
_viewModels.Push(initialViewModel);
_currentViewModel = initialViewModel;
}
public BaseViewModel CurrentViewModel
{
get { return _currentViewModel; }
set { _currentViewModel = value; NotifyPropertyChanged(); }
}
#region IChangeViewModel
public void PushViewModel(BaseViewModel model)
{
_viewModels.Push(model);
CurrentViewModel = model;
}
public void PopViewModel()
{
if (_viewModels.Count > 1)
{
_viewModels.Pop();
CurrentViewModel = _viewModels.Peek();
}
}
#endregion
}
}