XbimWindowsUI
XbimWindowsUI copied to clipboard
DrawingControl3D - SelectedEntityChanged RoutedEvent
I've seen, that the Event SelectedEntityChangedEvent
is called inside the setter of the SelectedEntity
dp. It will be fired before the value actually gets set. Therefore when subscribing to the Event the SelectedEntity
is not set at the moment of handling the event, so I can't interact with the SelectedEntity
(getting Properties, etc.). Is this by purpose? I mean the the Event-Name implies, the property has already been changed at this moment, doesn't it?
Sure I can solve this by some workaround, just were curios about the reason for the decision.
Hi, you want use somting like this ? ` private void DrawingControl_SelectedEntityChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) {
if (DrawingControl.SelectedEntity == null || DrawingControl.Selection == null || DrawingControl.Selection.Count() <= 0) return;
IPersistEntity persistEntity = DrawingControl.Selection.First();
if (persistEntity == null) return;
if (_currentEntity != null)
{
if ( _currentEntity.EntityLabel == persistEntity.EntityLabel)
{
return;
}
}
SpatialControl.ScrollIntoView(persistEntity);
SpatialControl.SelectedEntity = persistEntity;
e.Handled = true;
}`