i'm struggling a bit about when or how to activate / make visible a MoveAdorner.
I try the following but have no success: In the element that is to be adorned i add the Adorner in the GotFocus event. That alone did not suffice so i added a call to InvalidateVisual(). But nothing happens. Has anyone a hint on how to make those Adorners Visible?
protected void MyUIElement_GotFocus( object sender, RoutedEventArgs e )
{
AdornerLayer layer = AdornerLayer.GetAdornerLayer( this );
layer.Add( new MoveAdorner( this ) );
layer.InvalidateVisual( );
}
For Clarification: the adorned element is a Control that is positioned inside a derived Panel of a custom ItemsControl.
The MoveAdorner
derives from Adorner
and simply draws two Boxes on the top and bottom line of the control.
with kind regards