mirror of
https://github.com/k1tbyte/Wand-Enhancer.git
synced 2026-08-29 20:01:16 +00:00
e04e313fa3
Introduce IShellView and IFileDialogs so MainWindowVm no longer holds the concrete window or reaches through MainWindow.Instance, and file pickers are injectable. Run Restore off the UI thread like Patch and gate both buttons on IsBusy. Gate the log commands on a non-empty log. Move runtime log messages into the locale dictionaries and add the 14 new keys to all 12 languages. Track the injected locale dictionary so switching language replaces it instead of appending a new one each time. Remove the unused InfoItem control, ToVisibilityInvertedConverter, mw_title and the popup placeholder title.
27 lines
979 B
C#
27 lines
979 B
C#
using System.Windows;
|
|
|
|
namespace WandEnhancer.View.MainWindow
|
|
{
|
|
/// <summary>
|
|
/// What the view model needs from the shell window. Exists so the view model does not
|
|
/// hold the concrete window or reach through a static Instance, which made every command
|
|
/// untestable and crashed whenever the singleton was not set yet.
|
|
/// </summary>
|
|
public interface IShellView
|
|
{
|
|
void OpenPopup(FrameworkElement content, string title);
|
|
void ClosePopup();
|
|
void ScrollLogIntoView(LogEntry entry);
|
|
}
|
|
|
|
/// <summary>Modal file/folder pickers, kept behind a seam so commands stay headless-testable.</summary>
|
|
public interface IFileDialogs
|
|
{
|
|
/// <summary>Chosen folder, or null when cancelled.</summary>
|
|
string PickFolder(string description, string initialPath);
|
|
|
|
/// <summary>Chosen file path, or null when cancelled.</summary>
|
|
string PickSaveFile(string filter, string suggestedFileName);
|
|
}
|
|
}
|