Modernize versioning and display in app and build output

- Switch to explicit "3.2.0" next-version in GitVersion.yml
- Update NuGet packages and set assembly name to "ImageCatalog"
- Add MSBuild target to rename published exe with year and version
- Add AppVersion property to DataModel, set via IVersionProvider
- Replace static version label with data-bound versionLabel in UI
- Remove manual version label logic from MainForm
- Update DI to inject IVersionProvider into DataModel
- Ensures UI always shows correct version and builds are versioned
This commit is contained in:
MaddoScientisto 2026-02-14 22:18:56 +01:00
commit 69fdf01de3
6 changed files with 106 additions and 21 deletions

View file

@ -45,7 +45,7 @@ namespace ImageCatalog_2
public DataModel(ITestService testService, ISettingsService settingsService,
ImageCreationStuff imageCreationService, PicSettings picSettings,
IMapper mapper, ILogger<DataModel> logger)
IMapper mapper, ILogger<DataModel> logger, MaddoShared.IVersionProvider? versionProvider = null)
{
_service = testService;
_logger = logger;
@ -53,6 +53,8 @@ namespace ImageCatalog_2
_imageCreationService = imageCreationService;
_picSettings = picSettings;
_mapper = mapper;
// Populate AppVersion from version provider when available
AppVersion = versionProvider?.GetVersionString() ?? string.Empty;
TestCommand = new RelayCommand(Test);
AsyncTestCommand = new AsyncCommand(TestAsync);
@ -1123,6 +1125,17 @@ namespace ImageCatalog_2
{
await _settingsService.LoadSettingsAsync(filePath, this);
}
private string _appVersion = string.Empty;
public string AppVersion
{
get => _appVersion;
set
{
_appVersion = value;
NotifyPropertyChanged();
}
}
}
}