- Ui/LauncherForm: schlanke Startleiste, rendert Buttons dynamisch aus den registrierten Views (gruppiert) + Legacy-Button fuer das alte Tab-frm_main. - Ui/ViewHostForm: generisches Host-Fenster fuer eine View (Control docked fill). - Ui/ShellUiHost : IModuleUiHost: sammelt Views, oeffnet Einzelinstanz-Fenster. - Ui/Views/TerminalView: erste designbare View (UserControl + Designer.cs); Terminal-Logik aus frm_main extrahiert; DI via Initialize(TerminalLogger) -> parameterloser Ctor bleibt fuer den VS-Designer nutzbar. - Program.cs: startet jetzt LauncherForm (statt frm_main), registriert die Terminal-View; App bleibt via Legacy-Button voll bedienbar. - Build 0 Fehler. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
29 lines
863 B
C#
29 lines
863 B
C#
using System.Windows.Forms;
|
|
using PolyTrader.Core.Modularity;
|
|
|
|
namespace PolyTraderSharp.Ui
|
|
{
|
|
/// <summary>
|
|
/// Generisches Host-Fenster für genau eine <see cref="ModuleView"/>. Erzeugt das
|
|
/// (designbare) Control der View und dockt es formfüllend. Die Shell öffnet je View
|
|
/// höchstens eine Instanz (siehe <see cref="ShellUiHost"/>).
|
|
/// </summary>
|
|
public class ViewHostForm : Form
|
|
{
|
|
public string ViewId { get; }
|
|
|
|
public ViewHostForm(ModuleView view)
|
|
{
|
|
ViewId = view.Id;
|
|
Text = view.Title;
|
|
Width = view.PreferredWidth;
|
|
Height = view.PreferredHeight;
|
|
StartPosition = FormStartPosition.CenterScreen;
|
|
|
|
var control = view.CreateControl();
|
|
control.Dock = DockStyle.Fill;
|
|
Controls.Add(control);
|
|
}
|
|
}
|
|
}
|