fix(launcher): Campaign LA — MainWindow must call InitializeComponent, not AvaloniaXamlLoader.Load
Every click in the launcher exited the process. MainWindow ctor called AvaloniaXamlLoader.Load(this), which loads the XAML tree but never assigns the generated x:Name backing fields, so ProfilesTree, ServerNameTextBox, AccountNameTextBox, CharacterNameTextBox, EditorSubmitButton, FirstRunDatDirectoryTextBox and UpdateCloseButton were all null. Opening or closing any modal calls Focus() on one of them via OnViewModelPropertyChanged, so the NullReferenceException escaped the dispatcher and Program's top-level guard exited 74. A fresh isolated-root start auto-opens the first-run wizard and hit the same line with no click at all. App.axaml.cs keeps AvaloniaXamlLoader.Load - that is the correct idiom for Application.Initialize(), which has no named controls. Verified live: the isolated-root launch that died instantly now stays up with the first-run wizard open and the window responding. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
c25545e8d6
commit
d54b8a789e
1 changed files with 7 additions and 1 deletions
|
|
@ -18,7 +18,13 @@ public sealed partial class MainWindow : Window
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
AvaloniaXamlLoader.Load(this);
|
// InitializeComponent(), not AvaloniaXamlLoader.Load(this): only the
|
||||||
|
// generated method assigns the x:Name backing fields. Loading the XAML
|
||||||
|
// directly leaves every named control (ProfilesTree, the editor text
|
||||||
|
// boxes, FirstRunDatDirectoryTextBox, UpdateCloseButton, ...) null, so
|
||||||
|
// the first modal open or close threw NullReferenceException out of the
|
||||||
|
// dispatcher and took the whole process down through Program's guard.
|
||||||
|
InitializeComponent();
|
||||||
_statusTimer = new DispatcherTimer
|
_statusTimer = new DispatcherTimer
|
||||||
{
|
{
|
||||||
Interval = TimeSpan.FromMilliseconds(250),
|
Interval = TimeSpan.FromMilliseconds(250),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue