private void ModulesTreeOnPropertyChanged(object sender, PropertyChangedEventArgs eventArgs) { if (eventArgs.PropertyName == nameof(ModulesTreeViewModel.SelectedModule)) { ModulePanel.RemoveAll(); if (viewModel.ModulesTree.SelectedModule != null) { Panel panel = (Panel)appBrowserViewModel.ViewContext.CreatePanel(viewModel.ModulesTree.SelectedModule); ModulePanel.Content = panel; ModulePanel.DataContext = viewModel.ModulesTree.SelectedModule; } } }