private static void TryOpenFile(EditorViewModel editor, WindowsFileSystem fileSystem, string fileName, int address) { var loadedFile = fileSystem.LoadFile(fileName); editor.Open.Execute(loadedFile); DebugLog(editor, "Tab Added"); var tab = editor[editor.SelectedIndex] as ViewPort; if (tab != null && address >= 0) { DebugLog(editor, $"Loading at Script {address:X6}."); tab.Model.AfterInitialized(() => fileSystem.DispatchWork(() => tab.CascadeScript(address))); editor.GotoViewModel.ControlVisible = false; } }