private void LoadDataContext()
        {
            if (_objectProvider == null || config == null)
            {
                return;
            }
            var response = _objectProvider.TransferObject(config) as VisualizerData;

            if (response == null)
            {
                throw new InvalidOperationException("Unspecified error while serializing/deserializing");
            }
            DataContext = new VisualizerDataViewModel(response);
            if (Config.HasTreeFilter())
            {
                data.Root.SetSubtreeExpanded(true);
            }
            else
            {
                data.Root.IsExpanded = true;
            }
            config = data.Model.Config;
            Config.Write();

            var assemblyLoadErrors = data.Model.AssemblyLoadErrors;

            if (assemblyLoadErrors.Any())
            {
                MessageBox.Show($"Error loading the following assemblies:\n\n{assemblyLoadErrors.Joined("\n")}");
            }
        }
        private void LoadDataContext()
        {
            if (_objectProvider is null || config is null)
            {
                return;
            }
            DataContext = null;
            if (!(_objectProvider.TransferObject(config) is VisualizerData response))
            {
                throw new InvalidOperationException("Unspecified error while serializing/deserializing");
            }

            var vm = new VisualizerDataViewModel(response);

            vm.PropertyChanged += (s, e) => {
                if (e.PropertyName != nameof(VisualizerDataViewModel.FirstSelectedToken))
                {
                    return;
                }
                if (vm.FirstSelectedToken is null)
                {
                    return;
                }
                tokens.ScrollIntoView(vm.FirstSelectedToken);
            };

            DataContext = vm;
            config      = data.Model.Config;
            Config?.Write();

            var assemblyLoadErrors = data.Model.AssemblyLoadErrors;

            if (assemblyLoadErrors.Any())
            {
                MessageBox.Show($"Error loading the following assemblies:\n\n{assemblyLoadErrors.Joined("\n")}");
            }
        }