I'm developing a DSL. In the main window, I have two panes ( Panel ): on one, a listbox of the diagram , and on the other the diagram itself. I would like to click on an item in the list to center the corresponding shape on the screen.
I do not want to move the shape to the center of the diagram by changing its x, y coordinates. I want to roll the diagram to center the shape
Another way to explain: When a validation error occurs (Errors window at the bottom), and when you click on the error, it centers invalid shape on the screen, right? This is what I want.
Starting point:
private void symbolsListBox_SelectedIndexChanged(object sender, EventArgs e)
{
var listBox = sender as ListBox;
var symbol = listBox.SelectedItem as Symbol;
var compartment = PresentationViewsSubject.GetPresentation(symbol)
.FirstOrDefault() as SymbolCompartmentShape;
var diagram = docView.CurrentDiagram;
//Next step, center the shape
//How? God please help me!!!
}
The example with image is always better !! so ...
FriendFrancisco'stipincomments:Translationofimagetexts
Image1:"I want to click here ... so center it"
Image 2: "Clicked item; centered shape Note that the scroll that moved, not the shape"