11using System ;
2- using System . ComponentModel ;
32using Avalonia . Controls ;
43using AvaloniaEdit ;
54using AvaloniaEdit . TextMate ;
6- using SharpFM . Schema . Editor ;
75using SharpFM . Scripting ;
86using TextMateSharp . Grammars ;
97
@@ -16,7 +14,6 @@ public partial class MainWindow : Window
1614 private TextMate . Installation ? _xmlTextMateInstallation ;
1715 private TextMate . Installation ? _scriptTextMateInstallation ;
1816 private Window ? _xmlWindow ;
19- private TableEditorControl ? _tableEditor ;
2017
2118 public MainWindow ( )
2219 {
@@ -34,18 +31,6 @@ public MainWindow()
3431 _scriptController = new ScriptEditorController ( scriptEditor ) ;
3532 }
3633
37- // Table editor — wire DataContext when selection changes
38- _tableEditor = this . FindControl < TableEditorControl > ( "tableEditorControl" ) ;
39-
40- // Listen for SelectedClip changes to update table editor DataContext
41- DataContextChanged += ( _ , _ ) =>
42- {
43- if ( DataContext is SharpFM . ViewModels . MainWindowViewModel mainVm )
44- {
45- mainVm . PropertyChanged += OnMainVmPropertyChanged ;
46- }
47- } ;
48-
4934 // "View XML" menu item
5035 var viewXmlItem = this . FindControl < MenuItem > ( "viewXmlMenuItem" ) ;
5136 if ( viewXmlItem != null )
@@ -54,16 +39,6 @@ public MainWindow()
5439 }
5540 }
5641
57- private void OnMainVmPropertyChanged ( object ? sender , PropertyChangedEventArgs e )
58- {
59- if ( e . PropertyName != "SelectedClip" || _tableEditor == null ) return ;
60-
61- var mainVm = sender as SharpFM . ViewModels . MainWindowViewModel ;
62- var clip = mainVm ? . SelectedClip ;
63-
64- _tableEditor . DataContext = clip ? . IsTableClip == true ? clip . TableEditor : null ;
65- }
66-
6742 private void ShowXmlWindow ( )
6843 {
6944 var vm = ( DataContext as SharpFM . ViewModels . MainWindowViewModel ) ? . SelectedClip ;
0 commit comments