Open dbalogh78 opened 1 year ago
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;
}`
I've seen, that the Event
SelectedEntityChangedEvent
is called inside the setter of theSelectedEntity
dp. It will be fired before the value actually gets set. Therefore when subscribing to the Event theSelectedEntity
is not set at the moment of handling the event, so I can't interact with theSelectedEntity
(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.