Improve multi-line text, logo, and version display
- Enhance ImageCreatorAlternate to support multi-line text rendering with correct sizing, spacing, and shadow for each line. - Only draw logos on non-thumbnail images to match GDI behavior. - Add a status bar to MainWindow showing the app version at runtime. - Upgrade MinVer to 7.0.0 and adjust versioning to avoid WPF/XAML assembly identity issues. - Refactor XAML layout to accommodate the new status bar.
This commit is contained in:
parent
8db7ee8075
commit
f4893a39e9
4 changed files with 70 additions and 23 deletions
|
|
@ -3,6 +3,7 @@ using Microsoft.Extensions.DependencyInjection;
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.Win32;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
|
@ -16,6 +17,27 @@ namespace ImageCatalog_2
|
|||
InitializeComponent();
|
||||
_model = model;
|
||||
DataContext = _model;
|
||||
// Set product version in status bar (use ProductVersion rather than AssemblyVersion)
|
||||
try
|
||||
{
|
||||
var entry = System.Reflection.Assembly.GetEntryAssembly();
|
||||
string version = string.Empty;
|
||||
if (entry is not null && !string.IsNullOrEmpty(entry.Location))
|
||||
{
|
||||
try
|
||||
{
|
||||
version = FileVersionInfo.GetVersionInfo(entry.Location).ProductVersion ?? string.Empty;
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(version))
|
||||
{
|
||||
// fallback to assembly version
|
||||
version = entry?.GetName().Version?.ToString() ?? string.Empty;
|
||||
}
|
||||
VersionTextBlock.Text = string.IsNullOrWhiteSpace(version) ? string.Empty : $"v{version}";
|
||||
}
|
||||
catch { }
|
||||
// Apply theme based on user preference or system setting (default to light)
|
||||
ApplyTheme(isDark: false);
|
||||
// Subscribe to DataModel events that require UI dialogs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue