public void RefreshProfile(GenDataBase genDataBase, GenObject genObject) { var selectedItem = ProfileNavigatorTreeView.SelectedNode; var dataProfile = GenDataEditorViewModel.Data.Profile; dataProfile.Fragment = ProfileEditorTreeViewBuilder.GetNodeData(selectedItem); var text = dataProfile.GetNodeProfileText(); // Don't change to prevent unnecessary rendering and side effects if (text != ProfileTextBox.Text) { var start = ProfileTextBox.SelectionStart; ProfileTextBox.Clear(); ProfileTextBox.Text = text; ProfileTextBox.SelectionStart = start; } text = dataProfile.GetNodeExpansionText(genDataBase, genObject); // Don't change to prevent unnecessary rendering and side effects if (text != ProfileExpansionTextBox.Text) { var start = ProfileExpansionTextBox.SelectionStart; ProfileExpansionTextBox.Clear(); ProfileExpansionTextBox.Text = text; ProfileExpansionTextBox.SelectionStart = start; } }
public void LoadData() { ProfileNavigatorTreeView.Nodes.Clear(); ProfileExpansionTextBox.Clear(); ProfileTextBox.Clear(); if (GenDataEditorViewModel == null || GenDataEditorViewModel.ProfileIsUndefined()) { return; } var data = GenDataEditorViewModel.Data; data.Profile.Fragment = data.Profile.Profile; var builder = new ProfileEditorTreeViewBuilder(data); IsBuilding = true; builder.CreateBodyChildTrees(ProfileNavigatorTreeView.Nodes, data.Profile.GetBody()); IsBuilding = false; if (ProfileNavigatorTreeView.Nodes.Count > 0) { ProfileNavigatorTreeView.SelectedNode = ProfileNavigatorTreeView.Nodes[0]; } }