This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I am using your DiagramSurface control with your WPF PropertyGrid control, and I wanted to be able to display details about multiple selected items in the diagram on the property grid. From the forums and documentation, I found that using the SelectedElementChanged event was the best route to take to be able to determine my selected items. My problem is that when I choose SelectionMode="Extended" on the DiagramSurface in xaml, the SelectedElementChanged event only fires on the first selected item, but does not fire on subsequent selections that are added using the CTRL key. How to reproduce the problem: 1) Take the FlowDiagramSamples.sln that you package with your product 2) Modify the CustomStyle project's MainWindow.xaml file, so that the DiagramSurface is setup for multiple selections, and has an event handler. <ms:DiagramSurface Name="ds" Formatter="{StaticResource Formatter}" 3) Put a breakpoint anywhere in the event method. private void ds_SelectedElementChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) 4) Run the application and select one of the nodes. You should see that the debugger stops in the event handler code. Continue thru the debugger to make the UI responsive again. 5) On the diagram, hold the CTRL key and select a second node. You'll notice that the event doesn't fire. Selecting a third node using the CTRL key also doesn't fire the event. On a side note, what I am trying to do is copy the SelectedItems from the DiagramSurface, to the SelectedObjects property of your WPF Property Grid control. Is there another way to do this? Thanks, Tam
|
|
|
Hello Tam Thanks for pointing this out. The SelectedElementChanged event is raised only when the SelectedElement property changes which deals with a single element. I have now added a SelectedElementsChanged event which will raise whenever any element is selected or deselected. This will be available through the nightly builds from tomorrow the 8th of February. Regards |
|